khoam wrote: It would be best if you showed all the code, not bits of it - it's really hard to get your head around when you're referencing (I think) global variables.
.
All the code, maybe useful for someone to experiment with.
.
The ESP8266 controls the lighting and extinguishing of the diode when it receives the commands :
btnW1_ON - lighting up the diode, it confirms this by sending the W1_ON command to the client
btnW1_OFF - turning off the diode, it acknowledges this by sending the W2_OFF command to the client,
I send the commands from a smartphone from a program I once wrote in B4A, but you can also use any UDP Terminal downloaded from the Play Store.
All comments very welcome.
Many thanks to the Fellows who have helped me on this forum, without whom I would not have got off the ground and learned anything.
I will be developing the code, I still need to somehow send to the module the time after which the LED on self extinguish and save this in the flash of the Module and I have some other ideas.