Use ESP8266 module as a wireless switcher using Raspberry pi

After we managed to connect the ESP8266 WiFI module to Raspberry Pi, we can now try to change the module firmware to a custom one.

Use ESP8266 module as a wireless switcher using Raspberry pi

The firmware we will install on it is a simple webserver, that will handle HTTP requests. It will allow us to access a web interface for ESP8266. The interface will allow us to search for available WiFi networks, choose one and login. We will also have a page that will control the GPIO02 output (we can connect a led or something else to this pin). On the GPIO00 we can connect a button that will switch the GPIO02 state. Keeping the button pressed more than 3 seconds will restart the chip.

The firmware also contains a 3 simple API calls  which will allow you to switch or get the GPIO02 state from many devices, not only from its own web interface.

First we need a tool that will upload the firmware to ESP8266. It is available here or in the firmware zip archive.

# Lets assume that we are in the /home/pi/ESP8266 folder
cd /home/pi/ESP8266

# Get the zip archive containing the firmware and esptool.py from ExtraGSM
wget http://www.extragsm.com/blog/wp-content/uploads/2014/12/webserver.zip

# Unzip the archive
unzip webserver.zip

Connect the GPIO00 to GND, power up the module and run the following command:
# Upload firmware
# If you don't have python installed run: sudo apt-get install python
python esptool.py –port AMA0 write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin 0x12000 webpages.espfs

Now we need to connect to the ESP module using its own access point. Search for a wireless network named like ESPxxxx and connect.

 

For more detail : Use ESP8266 module as a wireless switcher using Raspberry pi

 


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top