I have finally created a “Hello World” project that works with the Espressif IOT API.
First, in the upper right hand side of this page is a link to the GitHub repository for this project firmware. The general rule for version systems is that you only commit if the code is runnable. I hope to break the code up into small enough chunks that I won’t get a majorly broken version in the repository, however things happen. If I get stuck, I’ll commit broken code to the repository to keep it current with these blog postings. GitHub maintains Versions, I’ll try to name each commit in a way that ties back to the current blog entry. The current commit is the same as the post title, “Hello World Firmware V0A”
Things happened again, I did a security update on my OS and the esptool.py firmware uploader stopped working altogether. I did a quick search online and found that the pyserial library started failing with this update. So I figured out how to roll back to the previous version of the OS kernel and I could get the firmware upload to work.
I copied the AT firmware project into the app directory and ran the gen_misc.sh script file to configure the libraries. I had some problems with this and I feel I need to know more about how the makefile works. The gen_misc.sh (gen_misc.bat for windows users) creates a file with the needed libraries for the project. For GitHub I ended up moving the project to the folder named UProgrammer-Firmware in the same folder that the app folder was in.
I deleted the AT firmware files from the project directory, keeping the user_config.h file in the include folder. I then created a new user_main.c file that just set up the serial port to 115200 baud and sent the text “Hello World” out the serial port from the user_init() function. This worked and I wanted to do something a little more in depth of the API functionality. So I started a timer that calls my code called user_state() once every second. I set up this function to send “Hello World” over the serial connection on the second call of it. I also removed the sending “Hello World” from the user_init() function. The function user_init() is called once during boot up of the processor.
I also added the commands to connect to my wifi network. I verified this by using a utility to see what devices were connected to my network. When I saw the name espressif for one of the devices, I knew it was connected. I took one more step and added a new file called wifi.c and a new file wifi.h to the project. To the file wifi.c, I copied a function from the API documentation that reports connection status changes to the serial connection. I changed which UART is used so it would report back over the serial connection. I put the prototype for the function in wifi.h.
Finally, I created a file called simple_serial.c and another file called simple_serial.h. I plan on moving the initialization code into simple_serial.c to clean up the user_init() function. I also plan on creating a simple text interface for configuring the connection details.
On the hardware side, I couldn’t re-solder the connector to the board because of too much damage so I cut a USB cable and used the A connector end with wires soldered to the board. I then used super glue to form a strain relief for the wires.

