diff --git a/build-flags/build_flags_esp32-wifi b/build-flags/build_flags_esp32-wifi index d61532f..704b8e3 100644 --- a/build-flags/build_flags_esp32-wifi +++ b/build-flags/build_flags_esp32-wifi @@ -1,13 +1,15 @@ -DWIFI_ENABLE -#-DDMX_DISABLE +-DDMX_DISABLE +# - exeption in DMX.update/begin #-DSPILED_DISABLE #-DAC_DISABLE -#-DSYSLOG_ENABLE - udp errors -DMODBUS_DISABLE +#-DMBUS_DISABLE -DCOUNTER_DISABLE +#-DSYSLOG_ENABLE - udp errors -DOTA -#-DMCP23017 +-DMCP23017 -DMODBUS_TX_PIN=13 #-DARTNET_ENABLE - udp rx errors (( --DUSE_1W_PIN=16 --DW5500_CS_PIN=15 +#-DUSE_1W_PIN=16 +#-DW5500_CS_PIN=15 diff --git a/build-flags/build_flags_mega2560-slim-5100 b/build-flags/build_flags_mega2560-slim-5100 deleted file mode 100644 index 0848369..0000000 --- a/build-flags/build_flags_mega2560-slim-5100 +++ /dev/null @@ -1,2 +0,0 @@ --DMODBUS_DIMMER_PARAM=SERIAL_8E1 --DAVR_DMXOUT_PIN=18 diff --git a/build-flags/build_flags_mega2560slim-5100 b/build-flags/build_flags_mega2560slim-5100 new file mode 100644 index 0000000..ce56958 --- /dev/null +++ b/build-flags/build_flags_mega2560slim-5100 @@ -0,0 +1,14 @@ + +#-DMODBUS_DIMMER_PARAM=SERIAL_8E1 +#-DAVR_DMXOUT_PIN=18 +-DDMX_DISABLE +-DMODBUS_DISABLE +-DMBUS_DISABLE +#-DOWIRE_DISABLE +-DDHT_DISABLE +-DCOUNTER_DISABLE +-DNO_HOMIE +-DCSSHDC_DISABLE +-DSPILED_DISABLE +-DAC_DISABLE +-DSYSLOG_ENABLE diff --git a/compiled/esp32-wifi/firmware.bin b/compiled/esp32-wifi/firmware.bin index 1897345..409ae37 100644 Binary files a/compiled/esp32-wifi/firmware.bin and b/compiled/esp32-wifi/firmware.bin differ diff --git a/lighthub/item.cpp b/lighthub/item.cpp index 99b5461..059d1fe 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -907,7 +907,7 @@ bool send = isNotRetainingStatus() ; if (!suffixCode && defaultSuffixCode) suffixCode = defaultSuffixCode; - + yield(); debugSerial<name); if (it.isValid()) it.Stop(); - + yield(); } item = item->next; @@ -246,7 +247,7 @@ void mqttCallback(char *topic, byte *payload, unsigned int length) { payload[length] = 0; int fr = freeRam(); if (fr < 250) { - debugSerial<next; } //if //strncpy_P(topic, outprefix, sizeof(topic)); @@ -737,6 +739,7 @@ void onInitialStateInitLAN() { delay(500); wifi_connection_wait -= 500; debugSerial<<"."; + yield(); } wifiInitialized = true; //??? } @@ -973,6 +976,7 @@ configLocked++; SetAddr(item->name, addr); owAdd(addr); } + yield(); item = item->next; } } @@ -1013,6 +1017,7 @@ configLocked++; break; } //switch } //isValid + yield(); item = item->next; } //if pollingItem = items->child; @@ -1762,29 +1767,34 @@ void loop_main() { #if defined(M5STACK) // Initialize the M5Stack object + yield(); M5.update(); #endif wdt_res(); + yield(); cmdPoll(); if (lanLoop() > HAVE_IP_ADDRESS) { mqttClient.loop(); #if defined(OTA) + yield(); ArduinoOTA.poll(); #endif #ifdef _artnet + yield(); if (artnet) artnet->read(); ///hung #endif } #ifdef _owire + yield(); if (owReady && owArr) owLoop(); #endif #ifdef _dmxin - // unsigned long lastpacket = DMXSerial.noDataSince(); + yield(); DMXCheck(); #endif @@ -1793,14 +1803,16 @@ void loop_main() { if (isNotRetainingStatus()) pollingLoop(); // #endif //#ifdef _owire + yield(); thermoLoop(); //#endif } - + yield(); inputLoop(); #if defined (_espdmx) + yield(); dmxout.update(); #endif @@ -1815,16 +1827,19 @@ void owIdle(void) { return; #ifdef _dmxin + yield(); DMXCheck(); #endif #if defined (_espdmx) + yield(); dmxout.update(); #endif } void ethernetIdle(void){ ethernetIdleCount++; wdt_res(); + yield(); inputLoop(); ethernetIdleCount--; }; @@ -1832,10 +1847,12 @@ ethernetIdleCount--; void modbusIdle(void) { wdt_res(); if (lanLoop() > 1) { + yield(); mqttClient.loop(); #ifdef _artnet if (artnet) artnet->read(); #endif + yield(); inputLoop(); } @@ -1861,6 +1878,7 @@ configLocked++; Input in(input); in.Poll(CHECK_INPUT); } + yield(); input = input->next; } nextInputCheck = millis() + INTERVAL_CHECK_INPUT; @@ -1873,6 +1891,7 @@ configLocked++; Input in(input); in.Poll(CHECK_SENSOR); } + yield(); input = input->next; } nextSensorCheck = millis() + INTERVAL_CHECK_SENSOR; @@ -1889,6 +1908,7 @@ configLocked++; Input in(input); in.setup(); } + yield(); input = input->next; } configLocked--; @@ -1906,6 +1926,7 @@ if (items) { if (it.isValid()) { it.Poll(POLLING_FAST); } //isValid + yield(); item = item->next; } //if } @@ -1925,6 +1946,7 @@ configLocked--; } }//if if (!pollingItem) return; //Config was re-readed + yield(); pollingItem = pollingItem->next; if (!pollingItem) { pollingItem = items->child; diff --git a/platformio.ini b/platformio.ini index 7b35721..8900c55 100644 --- a/platformio.ini +++ b/platformio.ini @@ -37,7 +37,7 @@ default_envs = ; esp8266-wifi ; ESP-32 - esp32-wifi +; esp32-wifi ; M5Stack core (ESP32 based) ; m5stack @@ -170,13 +170,15 @@ lib_deps = [env:esp32-wifi] platform = espressif32 framework = arduino +monitor_filters = esp32_exception_decoder +build_type = debug ;board = pico32 board = esp32-evb upload_speed = 115200 build_flags = !python get_build_flags.py esp32-wifi lib_ignore = ;COMMENT/UNCOMMENT next line for software 1-wire driver on/off - DS2482_OneWire + ;DS2482_OneWire DmxSimple DMXSerial DmxDue @@ -329,6 +331,7 @@ lib_deps = platform = atmelavr board = megaatmega2560 ;upload_port = net:192.168.88.31:23 +upload_port = net:192.168.88.2:23000 framework = arduino build_flags = !python get_build_flags.py mega2560slim-5100 lib_ignore =