Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32 OSC over TCP? #121

Open
thorangutang opened this issue Apr 23, 2021 · 3 comments
Open

ESP32 OSC over TCP? #121

thorangutang opened this issue Apr 23, 2021 · 3 comments

Comments

@thorangutang
Copy link

Hi there, I have been using the OSC library with UDP to send and receive bundles from ESP32's for a good while and it mostly works really well.

However, I do at times experience dropped packages and since this is for robotic applications where I am generally sending commands and not continuous data, I was wondering if there are any examples as to how to use TCP as the transport. The highest priority is for all messages to actually arrive(in order).

Any pointers?

Thank you!

@adrianfreed
Copy link
Member

adrianfreed commented Apr 25, 2021 via email

@fastfourier666
Copy link

I did try using this library with TCP but can't find a way to use the SLIPEncodedSerial class - it always expects a HardwareSerial as a constructor.

I ended up using the PacketSerial library to do the SLIP decoding. It allows you to set the stream to the WiFiClient. When a SLIP packet is completed you get a callback, and from there you can do a msg.fill with the received bytes. The sending end is the osc.js library.

I did have a try at making my own "SLIPEncodedTCP" using the "SLIPEncodedSerial" class as a starting point but ran out of time. OSC over TCP is great, especially with these little wifi boards with small antennae that can often get a crappy signal.

@fastfourier666
Copy link

I went back to it and made it work. example

The SLIPEncodedTCP class I made only handles sending and receiving. You have to manage the client's open/closed state out in the sketch.

I wonder if this is all unnecessary ---- but I couldn't find any way of getting the SLIPEncodedSerial or SLIPEncodedUSBSerial to work as-is. You can recast to HardwareSerial when creating the object but the class calls methods on it like begin(), which don't work on a WiFiClient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants