File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -338,6 +338,8 @@ bool SendJson(WiFiClient client) {
338
338
if (result != DeserializationError::Ok) {
339
339
SPIFFS.remove (jsonFileName); // if json file is invalid, remove it and trigger re-download
340
340
updstate == REQUEST_JSON;
341
+ retries = 50 ;
342
+ DBG_OUTPUT_PORT.println (" JSON file invalid, re-downloading" );
341
343
return false ;
342
344
}
343
345
@@ -350,7 +352,7 @@ bool SendJson(WiFiClient client) {
350
352
if (id > 0 ) {
351
353
requestSdoElement (SDO_INDEX_PARAM_UID | (id >> 8 ), id & 0xff );
352
354
353
- if (twai_receive (&rxframe, pdMS_TO_TICKS (10 )) == ESP_OK) {
355
+ if (twai_receive (&rxframe, pdMS_TO_TICKS (10 )) == ESP_OK && rxframe. data [ 3 ] == (id & 0xFF ) ) {
354
356
kv.value ()[" value" ] = ((double )*(int32_t *)&rxframe.data [4 ]) / 32 ;
355
357
} else {
356
358
failed++;
You can’t perform that action at this time.
0 commit comments