General area when it fits no where else

Moderator: Mmiscool

User avatar
By Mmiscool
#48529 Yep. Source code is on the github under the web sockets branch.
User avatar
By livetv
#48635
Mmiscool wrote:The java script that is used for esp basic is 100% on the browser client side. There is no node.js or any other javascript stuff happening on the esp it self.


That makes sense. It would seem that what exists on the ESP side is a WS server that can take messages from the client (the javascript in the browser) and do variable and I/O maintenance on its side as well as returning status to the browser. This is a great feature!

At the risk of sounding less grateful, what would really be big would be support in BASIC to allow an ESP to be a client as well. Right now, the browser and javascript represent the client side. Imagine if these functions were added:

WSCONNECT( {ip address} , {branch} ) Connects to an ESP as a client, calling {branch} when messages arrive.
WSSENDMSG( {message} ) Sends a message to the server.
WSGETMSG() Retrieves a WS message that has arrived from the server.

Closing the connection could be WSCONNECT() with no arguments.

This would allow 2 ESPs to communicate in near real time. I have a need for this to do some remote robotics. While I could control a simple robot from a web based control panel, it would be way to cumbersome when the arm and hand become more articulated. For example, imagine that I use potentiometers as transducers on a "model" of the arm which is worn on your own arm and hand. By using natural movements, digitized into a local arduino/ESP and transmitted by web sockets to the remote end, you could seamlessly control a complex matching robotic arm around the globe. Believe it or not, I have a need for this.

What do you think?
User avatar
By Mmiscool
#48648 You can use UDP for esp to esp communications. It is already set up and can be used in an event driven way.

See https://docs.google.com/document/d/1EiY ... f9gnk1rfei

For UDP documentation.