ESP8266 WEBSOCKETS?
Posted: Sun Apr 19, 2020 8:09 am
Hello all,
I've been trying to get websockets to run on the ESP8266 and I finally got it working. I assume that you can read the program and figure out what is going on. The code below should work 'out of the box' just check it out, upload it to your ESP and start your browser. It displays the runtime, a datacounter, a slider and a button. You can regulate an LED with the slider and the button. My LED is on pin 16, yours may be on another pin, you can set it on line 8. Don't forget to set your WIFI loginname and password in lines 6 and 7.
Try opening the ESP-website in two browsers. Notice how changes you apply in one browser are updated in the second browser also ... it's magic. Websockets are a new technology that may not work in older browsers. On line 33 the website controls the slider with an ONCHANGE command. This works fine if you use Internet Explorer but in Firefox an Chrome you should replace ONCHANGE with ONINPUT.
Enjoy!
I've been trying to get websockets to run on the ESP8266 and I finally got it working. I assume that you can read the program and figure out what is going on. The code below should work 'out of the box' just check it out, upload it to your ESP and start your browser. It displays the runtime, a datacounter, a slider and a button. You can regulate an LED with the slider and the button. My LED is on pin 16, yours may be on another pin, you can set it on line 8. Don't forget to set your WIFI loginname and password in lines 6 and 7.
Try opening the ESP-website in two browsers. Notice how changes you apply in one browser are updated in the second browser also ... it's magic. Websockets are a new technology that may not work in older browsers. On line 33 the website controls the slider with an ONCHANGE command. This works fine if you use Internet Explorer but in Firefox an Chrome you should replace ONCHANGE with ONINPUT.
Enjoy!