Skip to content

Commit

Permalink
Changed ESP32 SDK to final 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel-Sensate committed Feb 26, 2021
1 parent 84bb3d1 commit 1657fb6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Find out more at https://www.sensate.io

# The Sensate Firmware for ESP32 currently uses the following Libraries:

- Arduino IDE ESP32 Base Library (https://github.com/espressif/arduino-esp32 v1.0.5-rc7)
- Arduino IDE ESP32 Base Library (https://github.com/espressif/arduino-esp32 v1.0.5)
- ArduinoJson (https://github.com/bblanchon/ArduinoJson v5.13.5)
- Thingpulse SSD1306 (https://github.com/ThingPulse/esp8266-oled-ssd1306 v4.0.0)
- Soligen2010 fork of Adafruit_ADS1x15 (https://github.com/soligen2010/Adafruit_ADS1X15) v1.2.1
Expand Down
20 changes: 20 additions & 0 deletions src/controller/Bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ bool serverError = false;

int registerRetry = 0;
int configRetry = 0;
int postSensorDataRetry = 0;
int sensorCycle = 1;

extern VisualisationHelper* vHelper;
Expand Down Expand Up @@ -1205,19 +1206,26 @@ boolean postSensorData(Data* data[], int dataCount)
httpClient.begin(urlString, testCertificate);
else
httpClient.begin(urlString);

Serial.print("p");

int httpCode = httpClient.PUT("");

if (httpCode == HTTP_CODE_UPGRADE_REQUIRED)
{
Serial.print("u");

httpClient.end();
restart();
return true;
}
else if (httpCode == HTTP_CODE_OK)
{
Serial.print("o");

if(serverError || wasDisconnected)
{
postSensorDataRetry=0;
serverError = false;
wasDisconnected = false;
if(display!=NULL)
Expand Down Expand Up @@ -1252,6 +1260,8 @@ boolean postSensorData(Data* data[], int dataCount)
}
else
{
Serial.print("e");

if(display!=NULL)
{
wasDisconnected=true;
Expand All @@ -1265,6 +1275,16 @@ boolean postSensorData(Data* data[], int dataCount)
Serial.println(WiFi.status());

httpClient.end();

postSensorDataRetry++;

if(postSensorDataRetry>=25)
{
postSensorDataRetry=0;
restart();
}

Serial.println("Retry #"+String(postSensorDataRetry)+", restart at 25");
}
return false;
}
Expand Down

0 comments on commit 1657fb6

Please sign in to comment.