Arduino & TouchOSC Tutorial

I've posted a little tutorial on how to get an Arduino to exchange OSC messages with TouchOSC, for example to remote control "something"

This uses the Oscuino library, the most complete implementation of the OSC protocol written and maintained by the inventors of the protocol. Links are in the tutorial :wink:

Something I forgot to mention in the tutorial is that while it uses W5100/W5200 based Ethernet shields/modules, these are easily connected to a little pocket router such as the TP Link TL WR703n (or 702n or3020 etc) and that will get you connected through WiFi easily and very quickly. I've done this successfully in several projects.

I thought I'd give this a little bump as the tutorial I've linked to above receives an increasing number of views.

TouchOSC Is an application that allows you to control your Arduino from an iPhone/iPad or Android device using the OSC protocol though Ethernet and the UDP protocol.

It goes along with an Editor (Windows and Mac) that allows you to create your own layout with your own controls e.g faders, push buttons, multi toggle buttons X/Y controls etc. and upload that layout to TouchOSC on your mobile device.
TouchOSC controls can also to a degree controlled from an Arduino.

hi, good work, really look foreward to try this and make some cool osc controllers for art/music performances :slight_smile:

in my research, I always refer back to your instructions, but have a few little queries before I go ahead and buy components and try.

my questions are:

why is it preferable, if it is at all, to connect the teensy or arduino via an ethernt shield instead of plugging directly into a tp-link router via usb?

ive found this written in in the oscuino readme:

We recommend that you add a Teensy to
the USB port of an OpenWrt router to get good performance and reliability with our library.

is that a lot more work? does that mean one has to install openWRT?

and lastly, ive seen an instruction on flashing the tp-link tlwr703 with english firmware
http://www.teensynet.com/teensynet-hardware/wireless-teensynet/

does that help here?

ok enough questions, thanks again for your tutorial, much appreciated
Anton

babyjaws:
hi, good work, really look foreward to try this and make some cool osc controllers for art/music performances :slight_smile:

in my research, I always refer back to your instructions, but have a few little queries before I go ahead and buy components and try.

my questions are:

why is it preferable, if it is at all, to connect the teensy or arduino via an ethernt shield instead of plugging directly into a tp-link router via usb?

ive found this written in in the oscuino readme:

We recommend that you add a Teensy to
the USB port of an OpenWrt router to get good performance and reliability with our library.

is that a lot more work? does that mean one has to install openWRT?

and lastly, ive seen an instruction on flashing the tp-link tlwr703 with english firmware
http://www.teensynet.com/teensynet-hardware/wireless-teensynet/

does that help here?

ok enough questions, thanks again for your tutorial, much appreciated
Anton

Thanks for the positive feedback!

I find it preferable to connect through an Ethernet shield because it gets you going very fast!
However, it it is the most performant connection in terms of data rate I cannot say.

Connecting from the Teensy USB directly to an openWRT router may be more performant. However, a lot of the comments on the CNMAT site are based on the old Ethernet shield that uses the W5100 Ethenet chip. In my projects I use the Teensy in conjunction with a WIZ820io Ethernet Module that utilizes the much faster W5200 chip.
Yes, you would first have to install openWRT on your router. In that case you need to use at least the TL WR703n, a 702n will not work as it has too littel memory and a less sophisticated processor.
Naturally this will be rather difficult to debug as you will have occupied the one USB port on the Teensy that is also the only way to program the Teensy.
For printing debugging messages in that case you could also not use the Serial Monitor as that works over USB but you would have to use one of the serial1/2/3 (Rx/Txt pins) connections on the Teensy hooked up to a terminal program. If you do discover a bug you'll have to unhook USB, reprogram, reconnect USB etc.

I have decided all that is not worth the effort for my projects.

The other major drawback for ME is that without the Ethernet shield I cannot use Bonjour to announce an OSC service on the Network that would allow auto configuration in TouchOSC. I use that in all my TouchOSC projects.

I've been meaning for a while to add the bonjour part to either this, or another tutorial but have not had the time. If that interests you, let me know. Teensy is a great platform for that because it has so much more memory than the standard Arduinosand the Bonjour library is rather large in memory footprint.

Headroom:
Thanks for the positive feedback!

I find it preferable to connect through an Ethernet shield because it gets you going very fast!
However, it it is the most performant connection in terms of data rate I cannot say.

Connecting from the Teensy USB directly to an openWRT router may be more performant. However, a lot of the comments on the CNMAT site are based on the old Ethernet shield that uses the W5100 Ethenet chip. In my projects I use the Teensy in conjunction with a WIZ820io Ethernet Module that utilizes the much faster W5200 chip.
Yes, you would first have to install openWRT on your router. In that case you need to use at least the TL WR703n, a 702n will not work as it has too littel memory and a less sophisticated processor.
Naturally this will be rather difficult to debug as you will have occupied the one USB port on the Teensy that is also the only way to program the Teensy.
For printing debugging messages in that case you could also not use the Serial Monitor as that works over USB but you would have to use one of the serial1/2/3 (Rx/Txt pins) connections on the Teensy hooked up to a terminal program. If you do discover a bug you'll have to unhook USB, reprogram, reconnect USB etc.

I have decided all that is not worth the effort for my projects.

The other major drawback for ME is that without the Ethernet shield I cannot use Bonjour to announce an OSC service on the Network that would allow auto configuration in TouchOSC. I use that in all my TouchOSC projects.

I've been meaning for a while to add the bonjour part to either this, or another tutorial but have not had the time. If that interests you, let me know. Teensy is a great platform for that because it has so much more memory than the standard Arduinosand the Bonjour library is rather large in memory footprint.

Hi Headroom!

I thought I'd give this a bump to ask if you've made a tutorial on Bonjour to evade changing TouchOSC IP addresses each and every time.

I'm working on a project where I'm controlling 4 stepper motors and a 12V LED strip. What I've come to realize is that everything more or less halts if I use more than 3 types of OSC signals. Am I pushing the limits of my UNO? Do you think it would make sense if I turned to a Mega instead?

No, I never made that tutorial, but I'd be more than happy to help you get that to work.
If you want to get this to work you should consider using another micro controller because the Bonjour library is quite big.

I personally always have an Arduino Uno around, but I work exclusively with Teensy boards as they are superior in every aspect. Even the smallest Teensy board the Teensy LC runs circles around the Arduino Uno or Mega. They are less expensive, smaller and have better performance. Teensy USB Development Board

As explained above the Ethernet shield is also not the most performant solution. By now a WIZ850io is the replacement for the WIZ820io and is directly supported by the Ethernet library that comes with the Teensy processors in form of the Arduino IDE plugin Teensyduino. This is much faster than a Standard Ethernet shield.