-
Notifications
You must be signed in to change notification settings - Fork 129
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
Malformed packets when used with Oscuino #56
Comments
@Axagthoth thank you for bringing this to our attention. Could you please provide a minimal sketch to reproduce the issue? (ideally without OSC lib etc). |
@sandeepmistry thanks for answering so fast! Sure, I can provide an example sketch, but I'm not sure I understand what you mean by "without OSC lib". That's precisely what generates the issue. I can send "normal" UDP packets just fine (just like the WiFiUDPSendReceiveString example does). What should I attach, exactly? |
It would be nice to isolate the issue from the Oscuino library. So it would be great if you could reproduce just using the WiFi101 library (by using WiFiUDP to send similar data). Anyways, how about you start with sharing a sketch that others can run to reproduce the issue, even if it includes Oscuino. |
Oh, right! Excuse my denseness, it's getting late on this side of the ocean :) Here's the sketch WITH OSC. In a while I'll share the one without.
|
Ok, this should be the same exact message I'm trying to send with OSC, but translated to raw ASCII chars, as per this specification. Maybe you are right, and it isn't Oscuino after all! I've been checking the packets with Wireshark on my side, and I get the same packet as in my first picture, with 17 bytes of data! Even though now they can be clearly counted as being 32 bytes.
|
@Axagthoth nice work! |
@sandeepmistry @adrianfreed Ok, looking into the code in WiFiUDP.cpp I decided to change this line in my code:
for this line (the second definition of the write function, with a pointer and the size):
And things got a little better. Now the message data doesn't get truncated at the end, thus reaching the ending 28 bytes of correct hexadecimal values, but it somehow gets cut at the head (the first 4 bytes are still somehow considered part of the header and not the data). Maybe it has something to do with the defines in socket_buffer.h? I hope this is helpful and not a bother; like I said earlier I don't know enough about sockets to pinpoint the exact problem. |
Hi @Axagthoth, I think everything is ok, I tried it out locally. Initially I was seeing issues, but then I disabled the LLC protocol decoding. This can be done by:
Now I see this: So, Wireshark is just confusing us by auto-enabling LLC decoding. You should definitely be using This is why you are seeing: I'm going to close this now. Thank you for providing a detailed issue report and also investigating. |
I disagree with the issue being marked as resolved, as it is not. It's interesting to have found out that Wireshark wrongly interpreted the headers, but the fact remains that something fishy is going on when trying to encode the messages with OSCMessage::send(Print &p) from the Oscuino library (which was the original issue); and other programs than Wireshark aren't receiving the messages either.
That's twenty bytes missing at the tail. I'd really rather being able to leverage the power of the Oscuino library (which has worked before) than having to write the raw OSC messages each time. |
Please see my comment about the use of The OSC library needs to use |
@Axagthoth |
I'm re-opening this, |
Yep, sure: Oscuino I was gonna post the code of the OSCMessage::send(Print &p) function too:
So, as you can see it use both signatures of the |
@Axagthoth thank for this.
This would be more of a work around. |
@sandeepmistry Aaah I see. Thanks a lot for all the info! What you say about the buffering certainly sounds coherent with the actual problem. I'm afraid I can't be of further help there, though :( Should I change the title of the issue? |
@sandeepmistry ok, I've tested #59 and the issue seems resolved! Thanks a lot! Gonna make some further tests with beast-sized packets just to be on the safe side... |
@Axagthoth excellent, thanks for trying it out! I've made some notes on the buffer size here: #59 (comment). |
Fixed by #59 |
Hi,
I've justed started this same issue on the Oscuino end, but since I'm not sure which library is generating the problem, I'm opening it here too. Maybe someone has also encountered this problem?
I'm trying to use Oscuino with the new Arduino MKR1000 board, which uses the WiFi101 library (a modified version of the WiFi library) to communicate.
Receiving messages on the board works like a charm, I've tried it both with TouchOSC and Processing, and have managed to control one of the PWM pins on the board remotely.
The problem appears when trying to send messages from the board to the computer: no matter what I try, I can't seem to create "correct" OSC messages that my receivers can interpret.
Checking with the example codes I think the issue can only lie with one of the three following calls:
Udp.beginPacket(remIP, remPort);
msg.send(Udp);
Udp.endPacket();
I've reached this conclusion because comparing the code of WifiUDP with that of EthernetUDP (with which the same code works) I've seen that the code is quite different, but I'm not savvy enough to identify which pieces of the code might be critical.
The question is: do any of these functions add/require something to/from the UDP packet? The reason I'm asking this is that going deeper and analyzing the packets with Wireshark, I've realized that (at least) precisely 4 bytes are wrong, so maybe something is screwing the 4-padding requirement of OSC up? Here are the images of the capture that make me suspect this (I'm trying to send "layer1/clip1/connect 1"):
Any help and ideas would be greatly appreciated. Thanks a lot in advance!
The text was updated successfully, but these errors were encountered: