me-no-dev / ESPAsyncTCP

Async TCP Library for ESP8266
GNU Lesser General Public License v3.0
758 stars 394 forks source link

WebSocket message not sent when client connects #105

Closed mdathersajjad closed 5 years ago

mdathersajjad commented 5 years ago

I have created a simple arduino program which starts a websocket and sends a message when ever a websocket client is connected. I have created a gist here of the program https://gist.github.com/mdathersajjad/b046b905d3239769b391253a99bac42c

I am using NodeMCU(ESP8266) Board when ever a client connects the message hello client is not sent. I am trying to connect to the socket using ARC Rest Client. The websocket connects but the message "Hello Client" is not sent.

If i connect to the websocket and send a message to it and then disconnect and reconnect again means the message hello client is received.

I tried another library https://github.com/Links2004/arduinoWebSockets the same issue is also there in that library.

mdathersajjad commented 5 years ago

Closing the issue the problem was in ARC Rest Client as it uses the latest draft of WebSocket specification. I connected to it from Android using https://github.com/TooTallNate/Java-WebSocket library by specifying the draft and it worked fine.

IN ARC Rest Client it may be using a different draft