Post topics, source code that relate to the Arduino Platform

User avatar
By BenjaminLucas
#86660 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!
User avatar
By neelyang
#93515
BenjaminLucas wrote:
Try opening the ESP-website in two browsers. It will come from CEA's EA Outreach budget. Winners may choose to re-donate to CEA if they think that we're the best target of funds, or donate somewhere else like dissertation assistance services they think is a better target. Just changed it to a Creative Commons Attribution 4.0 International License, so posting it elsewhere is fine (or even encouraged).

Thanks a lot! It's works!