Pages: [1]
Author Topic: osc from OF to arduino  (Read 677 times)
plusplusweb

Posts: 16

Gravatar


osc from OF to arduino
« on: June 27, 2011, 02:28:19 PM »

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
Logged
joshua noble
Global Moderator
Cascadia

Posts: 1251

Gravatar

Let's make better mistakes tomorrow.


WWW
Re: osc from OF to arduino
« Reply #1 on: June 27, 2011, 03:38:23 PM »


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.
Logged

extrapixel
Basel, Switzerland

Posts: 6

Gravatar


WWW
Re: osc from OF to arduino
« Reply #2 on: March 12, 2012, 11:52:27 AM »

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).

Code:
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
Logged
Nixon

Posts: 43

Gravatar


Re: osc from OF to arduino
« Reply #3 on: January 09, 2013, 04:17:06 AM »

solid gold, saved my life today!
Logged
bilderbuchi
Global Moderator
Vienna, Austria

Posts: 902

Gravatar


Re: osc from OF to arduino
« Reply #4 on: January 09, 2013, 10:24:06 AM »

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
« Last Edit: January 09, 2013, 10:36:35 AM by bilderbuchi » Logged
Pages: [1]
 
Jump to:  

Powered by SMF 1.1.15 | SMF © 2011, Simple Machines
kinect

viagra priser