-->
Page 1 of 1

Websockets on ESP8266-12E

PostPosted: Fri Nov 27, 2020 4:36 pm
by john123
Hello, I run the "server" code from here:
https://github.com/gilmaimon/ArduinoWebsockets
and although is compiled and downloaded correctly, when I try to access the WIFI server from the browser in the laptop, I can't... Any idea what is wrong? I use ESP8266-12E

Re: Websockets on ESP8266-12E

PostPosted: Sat Nov 28, 2020 2:08 pm
by quackmore
if everything is fine on the server side you may want to check the client side

you could check your client against this echo server
https://www.websocket.org/echo.html

or you could verify if a different client works
for instance one like "websocket-test-client"
https://chrome.google.com/webstore/detail/websocket-test-client/fgponpodhbmadfljofbimhhlengambbn

Re: Websockets on ESP8266-12E

PostPosted: Sat Nov 28, 2020 2:21 pm
by john123
Ok, I am looking at it...

On this website: https://www.websocket.org/echo.html

I got the messages: "CONNECTED" and the "This browser supports WebSocket".

I run the example code from this website:

https://www.tutorialspoint.com/websockets/websockets_opening_connections.htm#:~:text=Once%20a%20connection%20has%20been,handshake%20between%20client%20and%20server.&text=All%20you%20have%20to%20do,the%20URL%20of%20your%20server.

with the IP that the ESP8266 writes on the serial (from the server code that I have posted to my first message), and the message I get on the serial is:

Code: Select allGot Message:
or
Code: Select allGot Message:
followed by two ASCII symbols...

and this happens everytime I refresh the browser...

Also I installed the extension you have posted, Iopen it and I put the IP address of the ESP8266, I press "Open" and it stucks in "CONNECTING" mode...

Any idea??

Thanks

#update: The google extension works!!! I had another client running that's why it was stuck! You are amazing! Thanx..
2 Questions:
1) In case I want the ESP8266 be accessible from more than 1 clients, can it work?
2)In case I want to access from an android phone, what should I do?

Thanks a lot for your help

Re: Websockets on ESP8266-12E

PostPosted: Sat Nov 28, 2020 4:23 pm
by quackmore
I'm glad you figured it out

I really did nothing...

Code: Select all1) In case I want the ESP8266 be accessible from more than 1 clients, can it work?

it should, you may want to check with the server docs

Code: Select all2)In case I want to access from an android phone, what should I do?


now that you have tested your server
build your own client application, it's just an html doc with some js,
then you can open it in whichever browser including android chrome for example
you will find a working example on the echo site, just below the echo section
Code: Select allhttps://www.websocket.org/echo.html