ESP8266 sketch Template with OTA, EEPROM WEB config and NTP
Posted: Fri Sep 16, 2016 9:36 am
I have been doing my first steps on ESP8266 and I am using Arduino IDE to do so.
Putting together some information I have been collecting and trying to understand some Internet communication concepts, I have constructed a template sketch to help me start my next sketch.
This template implements a few functionalities that I have considered basic and expect to use on almost all my sketch.
First it implements a OTA server to allow for wireless sketch loading avoid the fuss of using a serial hardwired connection.
Second it implements a EEPROM saved configuration so that the board connects to my router when it reboot.
If no configuration is saved it starts as an AP (access point) allowing a wireless connection from your PC or phone to set your home router SSID and password for the next reboot.
This is available through a configuration webpage.
A blank load with this sketch or with your own sketch built upon this template, allow you to dynamically configure the board after upload your sketch, making it easy to relocate the board to a new environment without changing the code.
Template code can be found here https://github.com/Pedroalbuquerque/template
Hope you can find it interesting and useful.
Putting together some information I have been collecting and trying to understand some Internet communication concepts, I have constructed a template sketch to help me start my next sketch.
This template implements a few functionalities that I have considered basic and expect to use on almost all my sketch.
First it implements a OTA server to allow for wireless sketch loading avoid the fuss of using a serial hardwired connection.
Second it implements a EEPROM saved configuration so that the board connects to my router when it reboot.
If no configuration is saved it starts as an AP (access point) allowing a wireless connection from your PC or phone to set your home router SSID and password for the next reboot.
This is available through a configuration webpage.
A blank load with this sketch or with your own sketch built upon this template, allow you to dynamically configure the board after upload your sketch, making it easy to relocate the board to a new environment without changing the code.
Template code can be found here https://github.com/Pedroalbuquerque/template
Hope you can find it interesting and useful.