September 2019 Update

New! We're moving to the new forum!

ALL new Blog posts will be on the forum.

Please join us there.

This Blog will no longer be updated...

Tuesday, May 28, 2019

Wifi and MySql Login info - wrapping it up

I've implemented the Config Library on the Wemos Mega 2560's.

When the 8266 boots, it's exactly the same as the ESP-01, it will wait 15 seconds for you to hit 'C' in the Serial Monitor.

The 2560 boots, it will wait 10 seconds for you to press 'C'.

In both cases, if you do not hit 'C', everything boots up as usual...

If you do hit C, then the 2560 sends a 'C' to the 8266 to put it into Config mode. The 2560 then goes into a loop, reading from Serial3 and writing that to Serial, for me to see, and if I type, it reads my input on Serial, and sends it to the 8266 on Serial3.

This is in an endless loop, so when you hit 'Q' to exit the configuration, and the 8266 reboots, you must manually reboot the board again, since the 2560 is trapped in its endless loop. In terminal, just disconnect and reconnect, and DTR will reset the whole board.

I have it working on the Wemos Mega that I'm using for my development board as Sensor Module 3. 

As part of this code change, I'm replacing all my calls to sprintf( with the safer snprintf( allowing me to specify the maximum size of the buffer to fill, thus preventing really strange behaviour when you accidentally overwrite memory used for other things :eek:

No comments:

Post a Comment

Any comments deemed off topic or offensive will be removed