Hi,
I’m building a solution with internal logic like “open/close valve by schedule”, “open/close window by temperature”. And I’d like to use Blynk as a GUI (display stats, configure parameters).
Unfortunately most of source codes I’ve seen look like “always connected to the Blynk server. No connection - no need to do anything”. That’s fine for sensors (like weather station) but not good for the actuating mechanism.
Looking to the forums I’ve found some similar questions with complains like “if the Blynk server is not available, logic starts working much slower, becomes virtually unstable” and so on. But these posts are quire old (2016, 2017).
Is this problem solved?
Is there any best practice how to make the program run its logic without degradation when the Blynk server is not connected?
I need your advises/recommendations for:
- I configure schedule and temperature thresholds in the Blynk app
- ESP8266 connects to the Blynk server, receives this configuration data, stores it in its local EEPROM.
- if ESP8266 connected to the Blynk server it sends current temperature to it and can be reconfigured, pushed to open/close manually
- it ESP8266 not connected it just process its own logic (open/close by schedule or temperature)
- when the Blynk server becomes available ESP starts to communicate with it (sends temperature, receives configuration and commands)
- if ESP reboots when the Blynk server is not available it uses configuration stored locally in its EEPROM and still proceed its the logic
- it should survive either WiFI is not connected (router down) or the Blynk server is not available (router up, ISP down)
I also need your advice on the initial configuration.
Something like:
- no configuration in the EEPROM (no WiFi SSID defined, etc) - run a local web server where SSID, password, Blynk server, Blynk port, Blynk token can be defined
- Reset was pressed - clear configuration and goto 1.
I’ve seen solutions like “run a local Web server for the configuration if not connected on start within 1 minute” but it is not suitable in my case.
Thanks for your ideas in advance.