-->
Page 3 of 4

Re: Websocket sketch with several problems.

PostPosted: Sun Feb 25, 2018 8:53 am
by rudy
When I need to interface 3v to 5 volt logic I use NLSX4373. It is available through normal distribution, like Digikey and Mouser. TXS0102 and PCA9306 can be found on modules for hobbyists on places like Aliexpress.

The level converter you tried would probably work if you removed the resistor between the RX pin of the ESP8266 and the USB to serial chip.

Image

Re: Websocket sketch with several problems.

PostPosted: Tue Feb 27, 2018 4:14 pm
by moose4621
rudy wrote:When I need to interface 3v to 5 volt logic I use NLSX4373. It is available through normal distribution, like Digikey and Mouser. TXS0102 and PCA9306 can be found on modules for hobbyists on places like Aliexpress.

The level converter you tried would probably work if you removed the resistor between the RX pin of the ESP8266 and the USB to serial chip.

Image


Great info thanks Rudy, greatly appreciated.
I have used the TXS0106 in the past and it worked well then. Thanks again.

Re: Websocket sketch with several problems.

PostPosted: Sat May 12, 2018 8:34 pm
by moose4621
I am a bit further down the track with this project. I have a working websockets connection and am able to control the stepper motor from the client.
The ESP server receives a command from the client and broadcasts a text string to all clients in return as confirmation.

My next problem is, after receiving data from a client I need to broadcast that data back to all clients.
It sounds simple enough but I seem to be unable to come to grips with the relationship between byte, payload, array, sizeof, length, blob, etc.

What I have on the ESP server to broadcast the data: (Data does not exceed 300).
Code: Select all uint8_t payload[] = {0,0};
        payload[0] = setpointVariable;
        payload[1] = targetGroundSpeed;
                       webSocket.broadcastBIN(payload, sizeof(payload));


And what I see in the Chrome developer tools console:
Code: Select allBlob(2) {size: 2, type: ""}
size:2
type:""
__proto__:Blob
size:(...)
slice:ƒ slice()
type:(...)
constructor:ƒ Blob()
Symbol(Symbol.toStringTag):"Blob"
get size:ƒ ()
get type:ƒ ()
__proto__:Object


Despite reading all sorts of references from google, I still don't seem to know what I am doing.
If anyone can point me in the direction of a good tutorial I would appreciate it.

If anyone wants to have a go at helping me with the code, I would really really appreciate it. :D

Re: Websocket sketch with several problems.

PostPosted: Fri Dec 07, 2018 11:44 am
by engi
[quote="moose4621"]
Code: Select all uint8_t payload[] = {0,0};
        payload[0] = setpointVariable;
        payload[1] = targetGroundSpeed;
                       webSocket.broadcastBIN(payload, sizeof(payload));


And what I see in the Chrome developer tools console:
Code: Select allBlob(2) {size: 2, type: ""}
size:2
type:""
__proto__:Blob
size:(...)
slice:ƒ slice()
type:(...)
constructor:ƒ Blob()
Symbol(Symbol.toStringTag):"Blob"
get size:ƒ ()
get type:ƒ ()
__proto__:Object


Hello,
I have the same problem.
Do you have any solution ?