My last IoT challenge was to get an
working and the next was to get the Adafruit Huzzah with ESP8266 to connect to Wifi. To do that I found most the required code here:
and I’ve put my code on my Github here:
You’ll need to put in your own WiFi access point details at the top of the code to connect to your own environment.
This script uses a lot of commands like:
which basically outputs text to a serial port. This allows much easier troubleshooting so you can see what is going on. To see this output you will however need a dedicated serial monitor console program. I started off using Putty:
which works great but upon reflection, I wanted to use something that was integrated directly into Visual Studio code. After some poking around I found this extension:
which is from Microsoft and seems to do what I needed.
You can see the output from my code above in serial monitor. Always ensure you match the output port and baud rate in the serial monitor to the device you have (here COM3 and 115200). Configuring this is very easy with the serial monitor extension.
Without much alteration, I was able to take the initial code and easily connect to my network as well as the Internet. Once connected I could ping the Adafruit Huzzah with ESP8266 from another PC in the network. A pretty painless exercise. Nice that things are becoming a little easier now I’m becoming familiar with this stuff.
So far, all I’ve done is use the Adafruit Huzzah with ESP8266 for output. Next, I’ll be to start taking simple input into the device by reading something like a button press and then taking action on that.
Stay tuned for details on that soon.