How to send OSC from iPhone to a computer on a different network

Auris's icon

I am using touchOSC on my iPod touch, and everything's fine, I'm sending messages to and from Max using [udp] objects. But now I want to be able to connect to internet with my iPod in any location (any network) and send/receive messages to/from a computer that is connected to a different network, e.g. in another country. There must be a way to do that, but I just don't know it. Any suggestions? Thanks.

Trond Lossius's icon

In order to send from the iPhone to Max, Max would need to run on a computer with a static IP or a known DNS server name. Furthermore you would need to ensure that Firewalls are not blocking UDP traffic on the required ports.

And next you would need to be able to set IP or host name of the OSC Server on the OSC client (iPhone). I haven't checked if TouchOSC permits this or not.

Receiving from Max would be the harder part. The best would probably be to develop a web-based solution so that you use a browser on the iPhone that is interfacing with a web application, and the web application forwards messages to and from Max.

At BEK we did a project last year where a web application programmed in Hobo/RubyOnRails and Max/FTM was interacting with the same sqlite3 database.

Jesse Allison has done some work that might be of interest to you: http://allisonic.com/project/4

Auris's icon

Thanks. I did all the things you mentioned, unblocked firewall, set IP and ports, etc. but so far it looks that it is only possible to send data through LAN. I also tried to use a free app UDP Tool, which sends udp packets, and like OSCtouch allows to set the IP and port of the host. But both work only when my iPhone is connected to the same network.

so it looks like a way to do it is your suggested:

"Receiving from Max would be the harder part. The best would probably be to develop a web-based solution so that you use a browser on the iPhone that is interfacing with a web application, and the web application forwards messages to and from Max."

which is probably beyond my abilities.

Is there possibly a website that provides some forwarding thing...or sending data to certain IP's over udp...

k9's icon

quintet.net by Georg Hajdu is an example where many computers talk to each other over the Internet. I'm not sure if that helps you since you are looking to connect an iPod, but I'd think theoretically it can be done.

not sure if that helps, but whatsmyip.net gives you exactly that and maybe that helps you connect in the right way.

Auris's icon

So now that I figured out my problem, it looks really straight forward. In order to send OSC or UDP from your iPhone , iPod touch, iPad or any other similar device using apps such as OSCtouch, UDP Tool or Cycling74 app through WAN (basically any location where you can connect to internet) you need to route ports on your router at home, which means you send packets to the IP of your router, then it directs them to the IP and specific port of your computer. Preferably the computer should be set to a static ip address.

Modifying port forwarding parameters in routers is easy. First you enter the default address of your router,enter password which is very often "admin" and you're there. In different routers port forwarding might be called slightly differently.

The idea is that there you type in your ip address of the computer and the port to which you'll be sending the data. So in your iphone app you have to set the ip address of your router (not computer anymore) and port number in which you'll be receiving data, this is the one specified in [udpreceive] or similar object in Max.

alersito's icon

Why dont you route first the osc information to one computer and then from this computer to the other.

i usually do that with my touchosc in ipad and 2 computers