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

 

Scroll to Top
Read previous post:
Build Your Own Smartphone using Raspberry Pi

This tutorial brings you from start to finish in constructing your very own smartphone. You will start by 3D printing...

Close