[SOLVED] ESP8266 publishes four topics but not 5

Thanks. Deleted the unnecessary code. Removed delay (10000) and substituted:

unsigned long interval=10000; // the time we need to wait
unsigned long previousMillis=0; // millis() returns an unsigned long.

unsigned long currentMillis = millis();
if((unsigned long)(currentMillis - previousMillis)>= interval)
{
previousMillis = millis(); // save the “current” time
// The closing brace is at the end of all the code

Seems to work. The millis() and simple timing loop took a few iterations.

Do you know of a good starting point to use OTA to update an ESP-8266?

Thanks again for all your help.

Not really, I did try the examples provided in the arduino IDE but I never got it to work.
I don’t really need it. so I gave up trying

Try this link:

https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html

I got it to work first try, although the OTA update works, it seems to hang without finishing the update. I’ll need to look into that.

One more question: is it possible to transmit the temperature and humidity data as numerical not characters?

MQTT sends Strings, it’s up to the clients to interpret the data