WiFiChron with software support for ESP8266

Another great software update from MikeM (download here)! This one has support for the ESP8266 module, allowing the WiFiChron clock to:
Before getting excited and jumping to compile and upload the new sketch, there are a few steps to be done on the ESP8266 module:

1. pull the CHPD pin high with a 10k resistor to Vcc;

2. make sure you can communicate with the module using a serial port; this could also include checking the version of the installed firmware (AT+GMR);

3. upgrade the firmware on ESP8266 to version 0.9.6.

After you download the bin files, the next step is to find a tool that would upload those bin files onto the chip. There are many tutorials on how to do this, some sketchy and ambiguous, some detailed and very helpful. In my search, I found references to a few different tools: XTCOM (old MFC Windows app), "NODEMCU Firmware Programmer", ESP flash downloader, ESPtool (python).

The easiest one to use for me seemed XTCOM, with my only complaint being that COM port selection was limited to COM1-6. Luckily, on Windows XP I am using, I was able to change the serial port from the default (assigned by the OS) COM9 to COM2 (the only one available in the range COM1 - COM6). I used this tutorial to load this firmware.

4. Change the baud rate from the default (after firmware upgrade) 115200 to 38400, for the following reason: according to the datasheet (table 20-6, page 189), ATmega328 running at 8MHz has an error rate of approx. 8% communicating on serial port at 115200.

Now, with the ESP8266 module prepared and plugged in, to connect to your wireless network, you will need to configure the module by providing the SSID and the password. To start this process, select "Init" for the "Wifi" menu item. There is an additional "init y/n" option to confirm the init. Once in "init" mode, the ESP8266 module starts acting as access point (another wireless network), using the SSID "WiFiChron". Connect to it using the key "WiFiChron" (*).


The clock will display (scrolling) an IP address, something like "192.168.4.1". Connect to the WiFiChron's access point with your computer/laptop/tablet/phone and web-browse to that IP address, as shown in the screenshot below.


Use that page to configure your local access-point SSID and key.  You can also configure an optional SNTP host for synchronizing time and an optional RSS URL.  Fill in something like pool.ntp.org for the SNTP host or http://w1.weather.gov/xml/current_obs/KNYC.rss for the RSS URL.

Clicking on the "Submit" button will send the configuration to the WiFiChron system, which will write it into its eeprom. If you check "Activate" before submitting, the WiFiChron will immediately switch out of access-point mode and attempt to connect to the SSID/key that you've entered.  If you have problems, you can power-cycle the WiFiChron.  It will use whatever settings it has stored in eeprom.

(*) Although the "WiFiChron" network was detected, I could not connect to it from my Windows XP machine (acquiring network address takes forever and eventually fails). It worked much better with my Android tablet. This is the reason why the first screenshot above is from my XP machine and the second is from my tablet.

NOTE: The ESP8266 module must be taken out of the socket while uploading the sketch (since it's connected to Rx/Tx as well).

Comments

Popular posts from this blog

Read analog input of Arduino Due board

Application Note of Cortex-M3 Embedded Software Development