Internet of Things
I found the populair ESP8266/ESP-07 WiFi shield. The WiFi shield is communicating via TX/RX hardware serial with the MEGA board. I programmed the ESP-07 module to read data from the board and send it to the internet by Wifi and vice versa. The software for the IoT communication is all on the ESP-07 board. The Mega board software is almost identical to the software where the communication takes place by a bluetooth, USB to serial or radio module (APC220) connection. The great benefit of having the IoT communication software on the ESP shield: the MEGA board is handling the I/O via the hardware serial port which is proved to be realiable in combination with servos, temperature sensors. So, there is no extra software, extra interrupt handling and processor time needed on the MEGA for communication with the internet. It is also nice to program the ESP-07 with the programming language and IDE the same as Arduino. Error correcting -repeating lost or corrupt messages, connection failure- is also handled (ok..., with some data loss in case of the communication problems).
For testing i've build a sketch for measuring the outside temperature and used the VBA IoT debug program on the PC to make a trend of the temperature. In the plot you can see the temperature curve and two extra signals. This red and bleu lines present an output and an input. The input is connected to the output. The output is switched at a frequency of 5 seconds and the input will follow the output signal (as expected). A thick red and bleu line is now painted on the form, because of a plotter interval of 2 minutes. Also visible are some interruptions; the white gaps in the red and bleu lines. At the position of the white gaps, the connection with the internet is disconnected and connected again (loss detection of the 5Hz block wave).
The sketch is now running for several days, no memory leaks, reconnected to internet when there is a connection problem. Altough i find a serial connection more reliable and faster than the Wifi internet, this communication can be used, especially for trending the "slower" analogue proces values on a PC. Remark; the sketch is reliable at all moments, only the connection to the PC/HMI by WiFi internet is less reliable, but still usefull. Ideal for weather station projects or that kind of stuff...
In the HMI screen you can see the amount of reconnects to the internet
(now 452 times, over a period of almost 7 days (1)). Still a lot of interrupts.
The FSM is now stable. Still in test phase, but very enthousiastic about the ESP8266 on the ESP-07 shield.
I've also programmed an ESP-01 module. When knowing how, everything is easy. What a nice modules.
(1) Remark: the start time of a certain Windows 10 process can be determined by the downloadable ProcesExplorer (procexp64.exe).