Sketching the ESP8266

1 view
Skip to first unread message

NZ0I

unread,
Jun 18, 2017, 2:43:58 PM6/18/17
to Receiver Development Platform
Taking a first stab at making the Adafruit HUZZAH ESP8266 WiFi breakout board function in our transmitter and receiver applications, I wrote (hacked) an Arduino sketch (program) that does the following:

1. Receives commands over the UART port. Commands must start with $$$ as the escape sequence.

2. $$$m,#,val;  <- this command allows the ATmega328p to set variables that the WiFi board will use; such as the SSID and password for a hotspot for Internet access.

3. $$$t; <- this tells the WiFi to connect to an Internet hotspot and attempt to read the current NIST time; if successful the WiFi sends a command to the ATmega328p telling it to update the time stored in the real-time clock.

4. $$$b; <- this tells the WiFi to set itself up as a UART-to-TCP bridge, and accept TCP connections from any clients (like a smartphone or PC)

All of that is now working (though refinements would be desirable), and I think it constitutes the minimum functionality that we need in order to add WiFi support to the transmitter and receiver designs. With this functionality a transmitter (or receiver) can automatically synchronize its real-time clock to NIST time using a personal hotspot on a cellphone or a home wireless router. It also makes it possible for a PC, or smartphone running an app, to connect with and communicate over WiFi to a transmitter or receiver: send commands, receive data, and perform as a user interface for configuring a transmitter, or for operating a receiver.

This was my first experimentation with programming using the Arduino IDE. My impression is that the Arduino environment simplifies some things, such as WiFi interaction, but that simplification comes at a cost. With high-level commands that take care of much the underlying complexity/details, it is difficult to understand precisely what is going on internally to the ESP8266. And when things aren't working, there is only debug prints, and the "burn and learn" trial and error method available for debugging. I found it slow and frustrating. But if all you want to do is prove out a simple concept, especially if that simple concept involves complex configuration settings, then the Arduino IDE does shine.

I will add the sketch to the software on GitHub. Anyone wanting to use it only needs the Adafruit HUZZAH ESP8266 WiFi breakout board, an FTDI Serial TTL-232 USB Cable, and a PC (Linux, OS X, or Windows) running some free software (Arduino IDE v. 1.8.3), home WiFi, and some patience. 

BTW: the little ESP8286 breakout board running the right sketch, could probably be used for wireless/remote rig control, replacing hardware costing $100's more.
Reply all
Reply to author
Forward
0 new messages