Need to send more than one byte via TCP-Socket

I would like to send a couple of bytes (not string) via TCP , like 0x25 0x25 0x25 0x06 0x00
in one shot.
All I found on the web does not work in may case.

I checked several proposals I found here and on the WEB, but most of them are for BT connection.

Can anybody advice how to realize this?

Have you tried

That's all I could find on this board.

Thanks,

I checked it, but I do not see how it could be used in my environment to fix the problem.

You can try this Appinventor-SerialOTG/SerialOTG_1.5.pdf at main · rkl099/Appinventor-SerialOTG · GitHub. SerialOTG can use serial line, BT classic and TCP/IP.

1 Like

Thanks, it looks interesting and it works!

I quickly modified the WIFI example and I was able to send a bunch of binary data in
a single shot to control another MC. Now I can try to modify my own project.

May I ask if the picture below shows the equivalents between
the ClientSocketAI2 and the SerialOTG solution?

Is there something else I need to know about the differences ?

Thanks.

I'm not familiar with ClienSocketAI2, but it seems to be equivalent. SerialOTG is built to use the same communication methods for serial, BT and TCP/IP. Note: it as no callback functions so you have to poll for data returned.

Thank you very much for this information, it helps a lot.

I'll take care of this.

Have nice weekend.

Hello rkl099,
I was able to switch from ClientSocketAI2 to SerialOTG and so far everything
works perfect. I just mixed up the length of the received buffer by the length of the
data in the buffer I get via .available.

Thank you again!