Hacking an analog clock to sync with NTP - Part 2


Since I am more familiar with C/C++, it makes sense for me to use the Arduino IDE (rather than Lua, the other alternative).

Everything was surprisingly easy to setup. I first installed the Arduino IDE, Then I followed the instructions here to setup the board manager within the IDE. I really wanted to base the WiFi configuration part of the project on WiFi Manager, so I added that to the IDE using the library manager.


I also setup the board type under "Tools". There is no entry for ESP-12F, so I went with the ESP-12E since the two should be virtually identical as mentioned previously.

With all the setup done, I went with the simplest possible WiFi Manager sample code, which looks like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#include <DNSServer.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>

void setup() {
  WiFiManager wifiManager;
  wifiManager.autoConnect("ESPCLOCK");
}

void loop() {
}

Then I click on "Sketch, Upload" and let the magic happen...


Lo and behold, a new WiFi network appears!


Connecting to it automagically brings me to the front page of the captive portal.


To be continued...

Comments

Popular posts from this blog

Adding "Stereo Mixer" to Windows 7 with Conexant sound card

Attiny85 timer programming using Timer1

Hacking an analog clock to sync with NTP - Part 5