diff --git a/README.md b/README.md index e24b4b8..0262b2e 100644 --- a/README.md +++ b/README.md @@ -133,14 +133,17 @@ the timing right, but that is not all. Geoffroy documented in his code that the interrupt driven data receive is unreliable but he did not name a reason. The reason is that the ESP8266 WiFi processing has precedence over all other MCU tasks and will disrupt time critical processing including ISRs. This is acceptable -for the data receive because the data repeats at a high frequency. Incomplete +for the data receive because the data repeats at a high frequency: incomplete frames can be ignored and invalid frame data can be filtered out by using only repeated identical data. But during the button signalling a receive error causes -side effects. A single button press might be ignored or may cause a double change. -With multiple consecutive button presses the error probability increases -significantly. To prevent this I decided to activate the ESP8266 WiFi modem sleep -when changing the water temperature. This improves the reliability noticeably but -the ESP8266 looses its connection to the AP and the MQTT server for a few seconds. +side effects: a single button press might be ignored or may cause a double change, +and with multiple consecutive button presses the error probability increases +significantly. Activating the ESP8266 WiFi modem sleep while changing the water +temperature improves the receive quality but then the ESP8266 looses its +connection to the AP and the MQTT server for a few seconds with every change. +That is why the latest firmware uses an iterative approach reading back the +new effective setting after each button press and even changing the direction +if an unintentional double change has resulted in overstepping the desired value. ## Building your own WiFi remote control @@ -225,7 +228,7 @@ Select your Intex PureSpa model based on the table in the at the beginning of the file [common.h](src/esp8266-intexsbh20/common.h). If changing the water temperature does not work reliably for you, rebuild the -firmware after commenting in *#define FORCE_WIFI_SLEEP* to use the "original" +firmware after commenting in *#define FORCE_WIFI_SLEEP* to use an alternative method where the WiFi will be disabled while changing the temperature. Note that this will also interrupt the TCP/IP connection to the MQTT server. @@ -234,10 +237,10 @@ The following **components** are required to build the firmware: Component | Version | Notes ------------ |:------- |:------------------------------------------------------------------------------------------------------- Arduino IDE | 1.8 | firmware does not build successfully with Arduino IDE 2.X, see [issue #30](../../issues/30) - ESP8266 SDK | 2.7.4 | install using the Arduino board manager,
3.1.2 is also reported to work, see [issue #13](../../issues/13) - ArduinoJSON | 6.19.4 | install using the Arduino library manager - PubSubClient | 2.8 | install using the Arduino library manager, compiler warnings can be ignored - + ESP8266 SDK | 3.1.2 | install using the Arduino board manager + ArduinoJSON | 6.21.3 | install using the Arduino library manager + PubSubClient | 2.8 | install using the Arduino library manager (ignore compiler warnings) + Other versions may also work but are not tested. The required **board settings** are documented at the top of the INO file. Make @@ -261,9 +264,8 @@ If you install the [Arduino ESP8266 LittleFS Filesystem Uploader](https://github you can use the Arduino IDE *Tools* menu to upload the content of the *data* subdirectory to the MCU. -With PlatformIO you should copy the *data* subdirectory from the *src* folder -into the project root folder to be able to use the task "Upload -Filesystem Image". +When using PlatformIO you should copy the *data* subdirectory from the *src* +folder into the project root folder to be able to use the task "Upload Filesystem Image". Example: diff --git a/platformio.ini b/platformio.ini index e7b95bb..e06f484 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,16 +10,18 @@ include_dir=src/esp8266-intexsbh20 [env] framework = arduino lib_deps = - knolleary/PubSubClient@^2.8 - bblanchon/ArduinoJson@^6.19.4 + knolleary/PubSubClient@^2.8.0 + bblanchon/ArduinoJson@^6.21.3 [env:d1_mini] -platform = espressif8266 board = d1_mini board_build.f_cpu = 160000000L board_build.filesystem = littlefs + framework-arduinoespressif8266@3.30102.0 build_flags = -D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY -D PIO_FRAMEWORK_ARDUINO_ENABLE_EXCEPTIONS -D VTABLES_IN_IRAM +platform = espressif8266 +platform_packages = monitor_speed = 74880 \ No newline at end of file diff --git a/src/esp8266-intexsbh20/common.h b/src/esp8266-intexsbh20/common.h index 7df77a0..c8c3b32 100644 --- a/src/esp8266-intexsbh20/common.h +++ b/src/esp8266-intexsbh20/common.h @@ -52,7 +52,7 @@ namespace CONFIG { - const char WIFI_VERSION[] = "1.0.7.2"; // 12.08.2023 + const char WIFI_VERSION[] = "1.0.8.0"; // 19.08.2023 // WiFi parameters const unsigned long WIFI_MAX_DISCONNECT_DURATION = 900000; // [ms] 5 min until reboot diff --git a/src/esp8266-intexsbh20/esp8266-intexsbh20.ino b/src/esp8266-intexsbh20/esp8266-intexsbh20.ino index 11986dc..810cb16 100644 --- a/src/esp8266-intexsbh20/esp8266-intexsbh20.ino +++ b/src/esp8266-intexsbh20/esp8266-intexsbh20.ino @@ -29,12 +29,12 @@ /** * BUILD ENVIRONMENT: * - * IDE: Arduino 1.8.13 + * IDE: Arduino 1.8.19 * * Libraries: * - * - Arduino Core for ESP8266 2.7.4 - * - ArduinoJson 6.19.4 + * - Arduino Core for ESP8266 3.1.2 + * - ArduinoJson 6.21.3 * - PubSubClient (MQTT) 2.8 * * Board: Wemos D1 mini (ESP8266)