пропажа слешей
Dependencies: mbed mbed-STM32F103C8T6 MLX90614 Watchdog DS1820
Diff: main.cpp
- Revision:
- 12:7fe416cdac08
- Parent:
- 11:57fa27cb533e
- Child:
- 13:6dbc5383b7e0
--- a/main.cpp Fri Jan 08 12:20:48 2021 +0000 +++ b/main.cpp Sun Jan 10 13:37:58 2021 +0000 @@ -404,7 +404,8 @@ wait(1); _parser->flush(); - _parser->send("AT+CCOAPURL=\"" MTS_TELEMETRY_URL_STRING); + //_parser->send("AT+CCOAPURL=\"" MTS_TELEMETRY_URL_STRING); + _parser->send("AT+CCOAPURL=\"coap://193.227.232.26:5683/api/v1/MIEMHSE-TEST\""); checkIfOk(); //if(!checkIfOk()){ terminateCOAPSession();return false;} wait(1); @@ -424,7 +425,13 @@ _parser->send("AT+CCOAPACTION"); //checkIfOk(); if(!checkIfOk()){ return false;} - wait(0.5); + wait(2); + wd.Service(); + wait(2); + wd.Service(); + wait(2); + wd.Service(); + wait(2); terminateCOAPSession(); @@ -602,7 +609,9 @@ pc.printf("WAITNG gps to turn on \r\n"); #endif wd.Service(); - wait(5); + wait(2); + wait(2); + wait(1); wd.Service(); _parser->send("AT+CGNSINF"); if(checkIfOk()) @@ -629,7 +638,9 @@ cold_start = true; } wd.Service(); - wait(5); + wait(2); + wait(2); + wait(1); wd.Service(); } @@ -748,6 +759,7 @@ float bat_v = 100; //Form JSON as {"tempIR":1,"temps":[1,...,10],"latitude":37,"longitude":51,"altitude":21,"validGeo":true} snprintf(bufferString,2048,"{\"ID\":%s,\"tempIR\":%f,\"latitude\":%f,\"longitude\":%f,\"altitude\":%f,\"validGeo\":%s,\"battery\":%f,\"netlvl\":%d,temps:[",device_id, IRtemp, B_l, L_l, Alt, Fix_st ? "true" : "false", bat_v, rssiDB); + // snprintf(bufferString,2048,"{\"ID\":\"%s\",\"tempIR\":%f,\"latitude\":%f,\"longitude\":%f,\"altitude\":%f,\"validGeo\":%s,\"battery\":%f,\"netlvl\":%d,\"temps\":[",device_id, IRtemp, B_l, L_l, Alt, Fix_st ? ( 1: 0) , bat_v // device_id index = strlen(bufferString); @@ -815,6 +827,8 @@ state=STATE_SLEEPING; + sleepTimer=0; + } else if(state==STATE_SLEEPING){ #if DEBUG_PC pc.printf("STATE=SLEEPING already for %d\r\n",sleepTimer); @@ -859,6 +873,12 @@ wd.Service(); myled = 1; } + wait(2); + wd.Service(); + wait(2); + wd.Service(); + wait(2); + wd.Service(); int res = initSIM(); if(!res) @@ -866,7 +886,11 @@ #if DEBUG_PC pc.printf("Init Failed\r\n"); #endif - wait(5); + wait(2); + wait(2); + wd.Service(); + wait(2); + wd.Service(); if(!initSIM()); { wait(WATCHDOG_INTERVAL_S+10); // reset by dog @@ -879,7 +903,10 @@ state=STATE_STARTING_GPS; sleepTimer=0; } else { - wait(SLEEP_CHECK_TIME); + wait(2); + wait(2); + wait(1); + // = 5 = SLEEP_CHECK_TIME } wd.Service(); #if DEBUG_PC