osc from OF to arduino

Hi,
I’m trying to send OSC messages from OF to an arduino using the ardOSC library on the arduino side and ofxOsc in OF.
I’m creating single messages not bundle but when I send them to the arduino and print what the arduino receives through serial instead of the message address I get #bundle.
Did anyone experienced the same situation and could explain me what’s going on ?
If I send the same message from OF to SuperCollider I get the right address for the message.

E

1 Like

Sorry, I think I’m following along but it might help if you post your code? I’ve never used ardOSC but I could probably help if you post things up here.

hello

i know this is an old topic and you have probably solved it yourself already. I just had the same problem with the ofxOsc-Addon and the Arduino OSC-library. Basically the Arduino side doesn’t support OSC-Bundles. The ‘#bundle’ you get is the header for an osc-bundle (see http://opensoundcontrol.org/spec-1-0 ). The arduino-library interprets this as the osc-address wich is not correct.

ofxOSC for some reason creates OSC-Bundles even for simple messages. This is in ofxOscSender.cpp, ofxOscSender::sendMessage(). So if you comment out line 82 & 84 it will stop doing that. But as i don’t know why every message is packet into a bundle in the first place, i’m not sure what other implications this will have. BUT it will make it work with the arduino (Z_OSC library, https://github.com/djiamnot/Z-OSC in my case).

  
void ofxOscSender::sendMessage( ofxOscMessage& message )  
{  
	static const int OUTPUT_BUFFER_SIZE = 16384;  
	char buffer[OUTPUT_BUFFER_SIZE];  
    osc::OutboundPacketStream p( buffer, OUTPUT_BUFFER_SIZE );  
  
	// serialise the message  
	//p << osc::BeginBundleImmediate;  
	appendMessage( message, p );  
	//p << osc::EndBundle;  
  
	socket->Send( p.Data(), p.Size() );  
}  

cheers,
extra

2 Likes

solid gold, saved my life today!

hm, it would seem appropriate to report a bug against Z_OSC. bundles are a part of the OSC spec, after all…
edit: ah great, there is already a bug report: https://github.com/recotana/ArdOSC/issues/3

you save me ! :slight_smile: thanks!