Close

Adding GPIO Control

A project log for ESP 8266 / ESP32 Web Server

A web server to display data from ESP8266/ESP32 WiFi devices

michael-otooleMichael O'Toole 08/15/2015 at 04:500 Comments

If you configure an ESP8266's in server mode you can then use your phone of browser to set, or unset, individual GPIO pins to control Leds, Lights, Doors etc...

The test code provided allows you to control any available GPIO pin from the browser address bar.. here are a few examples....

Of course you don't have to enter this manually each time, we simply add a link to our html file...

You can also retrieve the current state of all GPIO pins by browsing to 192.168.1.1

As I'm using the version 1 of the ESP8266 I have only added code for GPIO0 and GPIO2 but of course adding more would only take a few seconds...

The image above shows a popup detailing the current status of GPIO's on my device and as I'm using version 1, I only have two IO's available...

To set or unset a GPIO I only need click on the ON/OFF form element, no need for buttons as I use an on change event to do the work... again any change will popup a small window showing the action as reported by the remote device... the popup closes automatically after two seconds...

Will add changes and server sketch to git soon... Mike



Discussions