[SOLVED] How can I send an OSC signal to arduino
I've been using arduino with isadora for a long time via serial. But now i want to put the arduino further away and control a lot of electromagnetic valves. So I decided to use an ethernet shield and osc.
The problem is that i have an ethernet shield 2 and i have to use the ethernet2 library. Not al osc library's work together wit the ethernet2 library. The only one that works fine is OSCuino (attached).
I can send signals from the arduino to Isadora. But I couldn't send anything from Isadora to arduino.
Is it possible to send data from Isadora to Arduino using the OSCuino library?
According to this website it works with touchOSC I have tried to send data trough the same address via isadora but no luck.
The receiving examples I have seen work with OSC bundles, rather than individual messages. I am using a Huzzah board with oscuino, and using the receive example for that board I can receive messages sent from Processing using bundles. It does not work with Processing sending bare messages, or Isadora OSC transmit actor. I haven't looked at writing code to receive individual messages in OSCuino, but it may be possible.As far as I am aware Isadora cannot send OSC bundles.It would be easy to write a sketch in Processing to receive the message from Izzy and forward it on as a bundle as a quick workaround.
I just tried with the multi transmit actor (which possibly does send bundles), but that isn't being received by the board either.I am getting errors when I try to send OSC messages from Izzy to Processing too, haven't done that for a while, but all the examples I have tried generate errors on the processing side, even very basic stuff that should just print out whatever message/s it has received -### received an osc message. addrpattern: /led### [2016/3/19 11:46:4] ERROR @ OscP5 ERROR. an error occured while forwarding an OscMessage to a method in your program. please check your code for any possible errors that might occur in the method where incoming OscMessages are parsed e.g. check for casting errors, possible nullpointers, array overflows ... .method in charge : oscEvent java.lang.reflect.InvocationTargetExceptionTurning off use type means the error is not generated by Processing, but the message is not received eitherIsadora can receive the messages it send correctly, and can receive messages from Processing..Anyone else seeing issues transmitting OSC to other programs ?
Ok got Isadora to send a message to processing - I had multiple Processing sketches running on that port - the window for one of them was under the Izyy window
Hi,Thanks for the response, i tried to work via processing. To send and receive from isadora to processing is no problem. But i don't have enough experience to send bundles to the arduino.Would it be possible to send the sketch you are using?
My way of solving long distances between isadora and arduino has been the ethernet shield.I use processing to parse midi and osc from isadora and send it on as UDP from processing to the arduino, basically using the built in ethernet "sendReceive" example.Works like a charm over very long RJ45 cables and switches.In the future I hope to cut processing out of the loop entirely by sending TCP instead of UDP directly from isadora.
Thanks for your help.After a lot of hours and help from different people i finally got it to work without processing.This is what I did:
everything is in the attached file just enter the arduino's mac and ip address and it should work.
- Replace the standard ethernet library so it works with the ethernet shield 2 (w5500) (the new library is in the attached files)
- Use the ArdOSC library (some people told me not to use it because it is an old library bit it works the best with osc messages from isadora)
- Then i used the simple receive example
- added an ethernet test example
- added: "t =_mes->getArgFloat(0);" (not int32)
- and now you can send osc numbers from isadora to arduino using the osc multi transmit actor
A handy tip is to get node-red up and running, and use it’s visual flow editor to knock up a translation chain for the incoming OSC (after installing node-red-contrib-osc) - transform it as necessary to suit what Arduino / beagle bone / whatever is expecting, and forward that back out as OSC again (or as a web socket, or JSON, or whatever preferred format suits the hardware / sketch).