The use of the ESP8266 in the world of IoT

User avatar
By indrajit
#75092 I have implemented chat system via Node.Js, whenever I send a text message from one browser window then from other browser window I can receive the text message, I have used one IP and port, where both browser hits the same IP and port,
Now I want esp8266 to hit the IP and port, and from browser I want to send some data(strings) to control on/off
switch via esp8266. Is it possible?

I want to control esp8266 through Global server with negligible time delay.
Can anyone help me?

Thanks
User avatar
By rogerisael
#75633 Oh yeah you can do it, I started to work on that just past week after trying a couple of libraries for Websocket I found this one https://github.com/morrissinger/ESP8266-Websocket I like this one because different from the others with this one you can send a received Strings not uint8_t like others others libraries I have try do, I'm setting up my ESP8266 as a Websocket server and after a client connect it will start to send data and at the same time I can send back commands to control the ESP8266, I hope this will help you. By the way, use native Websocket object on browser side, socket.io and libraries of that type won't work.
User avatar
By doebram
#76571 Here https://gist.github.com/bbx10/667e3d4f5f2c0831d00b is another example of how to control an LED with web socket. Also, on Assignment.EssayShark you can find similar information or get homework assignment help if you want to practice with this device. In general, there are a lot of different concrete examples on this subject on GitHub (here is another one https://github.com/espruino/Espruino/issues/605).