Hi Sara and Rui,
Thank you for your brilliant tutorials, guides and related support. They are so helpful.
I have one of those Arduino Mega 2560 plus ESP8266 boards, in which the Mega 2560 and ESP8266 on the board can be connected to each other via one of the serial ports. I have different sketches running on each of them (Mega 2560 and ESP8266). With your help I have the ESP8266 running a webserver and successfully fetching ntp time&date updates, which I can send to the Arduino Mega 2560 ok and plug them into the sketch running on the Mega 2560. However, what I want to do is have the Arduino Mega 2560 sketch request these updates on demand ie not have them sent to it when not needed or requested. The Mega 2560 sketch is running a nixie clock which has an RTC but I’d like to be able to resynchronize the RTC with ntp time&date intermittently. I’m just not sure how to code the Arduino sketch to request the ESP8266 webserver fetch and send an ntp time&date update to the Mega on request only? Once I can do this I think I can manage the RTC time&date update. I expect it is simple but I haven’t been able to figure it out yet.
Can you help me with this please?
Hi Roger.
I think the easiest way is to have a two-way communication via serial.
When the ESP8266 receives a certain message from the Arduino board, it will send the requested time.
If you already have the time being sent to the Arduino, I think you should already know how to send data via serial.
Regards,
Sara
Thank you Sara. Yes, having figured out how to pass the messages and deliver instructions between the two boards via the serial port, I have now got this all working. I had some frustrating inconsistency problems initially, which I initially thought might be related to the baud rate but were actually related to other timing issues. I was looking for the reply from the ESP8266 to the request for the time update too soon after the request had been made. A delay in looking for the response solved that but I was concerned that that might upset other processes in the sketch so opted for a periodic push update from the ESP8266 instead, which has proven much cleaner and simpler. Thanks for steering me in the right direction. This is my first ever web app (at probably more than twice your age).