This commit is contained in:
Lubos Petrovic
2020-12-06 22:09:46 +01:00
parent 94ebdc6653
commit 25ccc3b14a
5 changed files with 28 additions and 34 deletions

View File

@@ -2,12 +2,12 @@
### v2.1.0 2020-12-06 ### v2.1.0 2020-12-06
- m5stack mute speaker - m5stack mute speaker
- settings v4 (wifi/gprs/sdcard/ntp/..) - Settings v4 (wifi/gprs/sdcard/ntp/..)
- ble4 skipped if mac is not set (00:00:00:00:00:00) - BLE skipped if mac is not set (00:00:00:00:00:00)
- improved menu (L&R buttons hides menu, parent menu now keep position) - Improved menu (L&R buttons hides menu, parent menu now keep position)
- SD card car params logging (json format) - SD card car params logging (json format)
(note: m5stack supports max 16GB FAT16/32 microSD) (note: m5stack supports max 16GB FAT16/32 microSD)
- supported serial console commands - Supported serial console commands
serviceUUID=xxx serviceUUID=xxx
charTxUUID=xxx charTxUUID=xxx
charRxUUID=xxx charRxUUID=xxx

Binary file not shown.

Binary file not shown.

View File

@@ -413,9 +413,6 @@ bool sim800lSetup() {
serial->begin(9600); serial->begin(9600);
sim800l = new SIM800L((Stream *)serial, SIM800L_RST, 512 , 512); sim800l = new SIM800L((Stream *)serial, SIM800L_RST, 512 , 512);
// SIM800L DebugMode:
//sim800l = new SIM800L((Stream *)serial, SIM800L_RST, 512 , 512, (Stream *)&Serial);
bool sim800l_ready = sim800l->isReady(); bool sim800l_ready = sim800l->isReady();
for (uint8_t i = 0; i < 5 && !sim800l_ready; i++) { for (uint8_t i = 0; i < 5 && !sim800l_ready; i++) {
Serial.println("Problem to initialize SIM800L module, retry in 1 sec"); Serial.println("Problem to initialize SIM800L module, retry in 1 sec");
@@ -433,16 +430,16 @@ bool sim800lSetup() {
bool sim800l_gprs = sim800l->setupGPRS(liveData->settings.gprsApn); bool sim800l_gprs = sim800l->setupGPRS(liveData->settings.gprsApn);
for (uint8_t i = 0; i < 5 && !sim800l_gprs; i++) { for (uint8_t i = 0; i < 5 && !sim800l_gprs; i++) {
Serial.println("Problem to set GPRS APN, retry in 1 sec"); Serial.println("Problem to set GPRS connection, retry in 1 sec");
delay(1000); delay(1000);
sim800l_gprs = sim800l->setupGPRS(liveData->settings.gprsApn); sim800l_gprs = sim800l->setupGPRS(liveData->settings.gprsApn);
} }
if (sim800l_gprs) { if (sim800l_gprs) {
liveData->params.sim800l_enabled = true; liveData->params.sim800l_enabled = true;
Serial.println("GPRS APN set OK"); Serial.println("GPRS OK");
} else { } else {
Serial.println("Problem to set GPRS APN"); Serial.println("Problem to set GPRS");
} }
} }
@@ -454,27 +451,22 @@ bool sendDataViaGPRS() {
NetworkRegistration network = sim800l->getRegistrationStatus(); NetworkRegistration network = sim800l->getRegistrationStatus();
if (network != REGISTERED_HOME && network != REGISTERED_ROAMING) { if (network != REGISTERED_HOME && network != REGISTERED_ROAMING) {
Serial.println("SIM800L module not connected to network, skipping data send"); Serial.println("SIM800L module not connected to network!");
return false; return false;
} }
if(!sim800l->isConnectedGPRS()) { bool connected = sim800l->connectGPRS();
Serial.println("GPRS not connected... Connecting"); for (uint8_t i = 0; i < 5 && !connected; i++) {
bool connected = sim800l->connectGPRS(); delay(1000);
for (uint8_t i = 0; i < 5 && !connected; i++) { connected = sim800l->connectGPRS();
Serial.println("Problem to connect GPRS, retry in 1 sec"); }
delay(1000);
connected = sim800l->connectGPRS(); if (!connected) {
} Serial.println("GPRS not connected! Reseting SIM800L module!");
if(connected) { sim800l->reset();
Serial.println("GPRS connected!"); sim800lSetup();
} else {
Serial.println("GPRS not connected! Reseting SIM800L module!"); return false;
sim800l->reset();
sim800lSetup();
return false;
}
} }
Serial.println("Start HTTP POST..."); Serial.println("Start HTTP POST...");
@@ -514,6 +506,8 @@ bool sendDataViaGPRS() {
Serial.println(rc); Serial.println(rc);
} }
sim800l->disconnectGPRS();
return true; return true;
} }
#endif //SIM800L_ENABLED #endif //SIM800L_ENABLED

12
menu.h
View File

@@ -65,12 +65,12 @@ MENU_ITEM menuItemsSource[100] = {
{MENU_SDCARD_MOUNT_STATUS, 304, -1, "Status"}, {MENU_SDCARD_MOUNT_STATUS, 304, -1, "Status"},
{MENU_SDCARD_REC, 304, -1, "Record"}, {MENU_SDCARD_REC, 304, -1, "Record"},
{3070, 307, 3, "<- parent menu"}, {3060, 306, 3, "<- parent menu"},
{3071, 307, -1, "Auto mode"}, {3061, 306, -1, "Auto mode"},
{3072, 307, -1, "Basic info"}, {3062, 306, -1, "Basic info"},
{3073, 307, -1, "Speed"}, {3063, 306, -1, "Speed"},
{3074, 307, -1, "Battery cells"}, {3064, 306, -1, "Battery cells"},
{3075, 307, -1, "Charging graph"}, {3065, 306, -1, "Charging graph"},
{4010, 401, 4, "<- parent menu"}, {4010, 401, 4, "<- parent menu"},
{4011, 401, -1, "Kilometers"}, {4011, 401, -1, "Kilometers"},