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....
- 192.168.1.1?gpio=0&state=1 (sets GPIO 0 output to 1)
- 192.168.1.1?gpio=5&state=0 (sets GPIO 5 output to 0) etc...
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
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.