ESP8266 Program Over WiFi 
Sunday, September 18, 2016, 07:09 AM - Programs, Devices, Tutorials, IOT

ESP8266 Program Over WiFi


Purpose:


The ESP8266 is a very inexpensive microcontroller that has a full TCP/IP stack and WiFi, and is compatible with the Arduino IDE. It programs very similar to a standard non-WiFi Arduino.

This project demonstrates how to program the ESP8266 via WiFi rather than via a USB cable directly connected to your development computer. It lets you build IOT devices, deploy them, and then later reprogram them without having to bring them back to your computer.

Requirements:


- 1 x ESP826612E
- Arduino IDE, I think it needs to be >= version 1.6.4
- Code from my github - https://github.com/nshaver/esp8266_webupdate

Instructions



1. Setup compile/upload environment for ESP8266


You first need to be able to compile and upload programs to your ESP8266. There are dozens of tutorials that should get you going with uploading to your ESP8266.

2. Initial compile and upload


Get the code from my github.

https://github.com/nshaver/esp8266_webupdate

Modify the ssid and password variables to match your WiFi network. The program doesn't really do much other than deliver a hello message to the browser, wait for an http upload connection from a browser at /update, and blink the built in LED.

3. Verify WiFi



Use a web browser to visit your ESP8266. Ideally, you can visit it at http://esp8266.local, but you may have to use the IP address from step #2 above.

4. Change your code


Make a small change to your code so that you will be able to tell whether or not your WiFi upload worked, and click the "Verify" button in the Arduino IDE. That will rebuild a new binary and place it in /tmp/buildxxxx (have to find it). I'd recommend keeping your serial terminal open so that you can easily see the IP address of your ESP8266 after the upload has finished and it connects to your network.

5. Upload via WiFi



Now for the real excitement. Visit the /upload page of your esp8266 at http://esp8266.local/update and click the "Choose File" button. Browse to the binary you hopefully created in step #4 above, and then click the "Update" button. This will hopefully send your new program to the ESP8266, and then it will reboot. After a few seconds you can visit its webpage and see any of your latest changes reflected.

Comments

Add Comment
Fill out the form below to add your own comments.









Insert Special:






Moderation is turned on for this blog. Your comment will require the administrators approval before it will be visible.