Page 1 of 1

Upload to PushingBox error

Posted: Wed Aug 14, 2019 11:33 am
by lareina1993
Hi all,

I am new in here and also quite new with programming. The issue I have is the following:
I start a simple rotational measurement and try to write the measured data (rpm) to pushingbox and further to my google sheet (all 10 revs.). I have a display, showing me the right rpm values and it works . Also a small testing porgram worked to write data to my google sheet, but with static values.

So here it goes:
after 10 revolutions, a program is started to write the measure and calculated rpm value to my sheet, and it fails. I have to restart my ESP32. Right when I hit "WiFiClient client;" it goes off and shows an error... I can not post the error message right now sorry... But maybe you guys have an idea what's wrong with my code... Already tried to disable interrupts when writing function is called with "noInterrupts()"....

Using ESP32 Heltec WiFI Lora 32 v2 and Arduino IDE...

Many thanks!
Lareina
  1. #include "WiFi.h"
  2.  
  3. const char WEBSITE[] = "api.pushingbox.com";    //pushingbox API server
  4. const String devid = "XXXmyIDxxxx";         //device ID from Pushingbox
  5.  
  6. const char* MY_SSID = "TestWiFi";
  7. const char* MY_PWD =  "123456890";
  8.  
  9. // VARIABLEN  ### TEST mit 1 Sensor! ##
  10. volatile byte cISR_V1;
  11. unsigned long timeold;
  12. int iWriteToSheet;
  13.  
  14. float fRCVentil_1;
  15. /* float fRCVentil_2;
  16. float fRCVentil_3;
  17. float fRCVentil_4;
  18. float fRCVentil_5;
  19. float fRCVentil_6;
  20. float fRCVentil_7;
  21. float fRCVentil_8;
  22. float fRCVentil_9;
  23. float fRCVentil_10;
  24. float fRCVentil_11;
  25. float fRCVentil_12; */
  26.  
  27.  
  28. void setup()
  29. {
  30.   Serial.begin(115200); //baud rate
  31.   Serial.print("Connecting to "+*MY_SSID);
  32.   WiFi.begin(MY_SSID, MY_PWD);
  33.   Serial.println("going into wl connect");
  34.  
  35.   while (WiFi.status() != WL_CONNECTED) //not connected,..waiting to connect
  36.     {
  37.       delay(1000);
  38.       Serial.print(".");
  39.     }
  40.   Serial.println("connected to "+*MY_SSID);
  41.   Serial.println("");
  42.   Serial.println("Credentials accepted! Connected to wifi\n ");
  43.   Serial.println("");
  44.  
  45.   // INTERRUPT
  46.   attachInterrupt(digitalPinToInterrupt(36), ISR_V1, FALLING); //attachInterrupt(digitalPinToInterrupt(pin), ISR, mode)
  47.   int cISR_V1 = 0; // counter Ventil1
  48.  
  49. }
  50. // ##################### ISR #################################
  51.  
  52. void ISR_V1()
  53. {  
  54.     cISR_V1++;
  55. }
  56.  
  57. // ##################### LOOP #################################
  58. void loop()
  59. {
  60.     //delay(10000);
  61.    
  62.    
  63.     if(cISR_V1 >= 1) {
  64.         fRCVentil_1 = 60*1000/(millis() - timeold)*cISR_V1;
  65.         timeold = millis();
  66.        
  67.         cISR_V1 = 0;
  68.     iWriteToSheet++;
  69.     }
  70.    
  71.  
  72.   //Print @ 115200 Baud
  73.   Serial.print("RCV1: ");
  74.   Serial.print(fRCVentil_1);
  75.   // Serial.print(" %\t");
  76.   /* Serial.print("Temperature in Cel: ");
  77.   Serial.print(celData);
  78.   Serial.print(" *C ");
  79.   Serial.print("Temperature in Fehr: ");
  80.   Serial.print(fehrData);
  81.   Serial.print(" *F\t");
  82.   Serial.print("Heat index in Cel: ");
  83.   Serial.print(hicData);
  84.   Serial.print(" *C ");
  85.   Serial.print("Heat index in Fehr: ");
  86.   Serial.print(hifData);
  87.   Serial.print(" *F\n"); */
  88.    
  89.   WiFiClient client;  // Initialize the client library
  90.  
  91.     //Start or API service using our WiFi Client through PushingBox
  92.   if(iWriteToSheet >= 100){
  93.    
  94.     if (client.connect(WEBSITE, 80))
  95.       {
  96.          client.print("GET /pushingbox?devid=" + devid
  97.        + "&fRCVentil_1="  + (String) fRCVentil_1
  98. /*        + "&celData="      + (String) celData
  99.        + "&fehrData="     + (String) fehrData
  100.        + "&hicData="      + (String) hicData
  101.        + "&hifData="      + (String) hifData */
  102.          );
  103.  
  104.       client.println(" HTTP/1.1");
  105.       client.print("Host: ");
  106.       client.println(WEBSITE);
  107.       client.println("User-Agent: ESP32/1.0");
  108.       client.println("Connection: close");
  109.       client.println();
  110.       }
  111.    iWriteToSheet = 0;
  112.   }
  113. }
  114.  

Re: Upload to PushingBox error

Posted: Wed Aug 14, 2019 7:40 pm
by martinayotte
At first look, your password is too short ...
Googling "WiFi minimum password length" will reveal you that minimum password length is 8 characters and maximum 64 !

Re: Upload to PushingBox error

Posted: Mon Aug 19, 2019 2:01 pm
by lareina1993
oh well I changed it for posting it here... the original one has 10 characters.

sorry :/

Re: Upload to PushingBox error

Posted: Tue Sep 17, 2019 6:00 am
by lareina1993
No one has any idea...?
Still having this issue... :(

Re: Upload to PushingBox error

Posted: Tue Sep 17, 2019 6:55 am
by ESP_Sprite
Perhaps it helps if you can copy-paste the error message here?