-->
Page 1 of 1

Websockets basics

PostPosted: Thu Aug 03, 2017 6:46 pm
by gbales
Hi all amazing ESPers...
Help with understanding the following please...

I have the following code...
WiFi.softAP("Socket1", "Socket1Password");

And I can connect to it on my phone by entering the IP from... WiFi.softAPIP()

The following line tells me how many connections have been established.
WiFi.softAPgetStationNum()

later in the code...
webSocket.begin("192.168.0.121", 81);
webSocket.sendTXT("Connected");

I want to receive the "Connected" on another ESP8266.
Everything I have tried has produced no results.

Can 2 websockets connect to each other?
Can I assume they each have their own IP? Duh moment I assume!
Is the AP required or could the webSocket.begin and webSocket.sendTXT function without an AP?

I am willing to do more researching and experimenting but I need to understand the base line of these so move forward without stumbling around.\

I will really appreciat any help

Thanks
Gary

Re: Websockets basics

PostPosted: Fri Aug 04, 2017 11:21 pm
by gbafamily1
I suggest looking at the examples included with the arduinoWebSockets library. Specifically, WebSocketClient and WebSocketServer.

https://github.com/Links2004/arduinoWeb ... r/examples