OK, Headroom wrote:
I guess my explanation was a little convoluted ;-) You don't want to have to configure the IP address on your Teesny every time you connect it to your computer. Lets see how I imagine for this to work:
1. You connect your device to the computer. I am not exactly sure how that is done. Based on your description you are not using Internet Sharing but "create a new Network" and then connect to that. I am not at my home computer right now but will try test either tonight or tomorrow how that works.
2. The Teensy requests an IP address from the computer per DHCP and the computer picks one from the pool of available adresses and assigns it to the Teensy.
3. The Teesny registers an _osc._udp service per Bonjour. This registration will also include a name "e.g. "etrumpet.local" to the IP address the Teensy received from the DHCP server. When this step is completed you can open the "ping" command in a terminal window on your mac and ping etrumpet.local instead of having to know the IP address of the Teensy. The service registration will also include on what port this service is registert and whether it is a UPD or TCP service.
Beeing able to resolve etrumpet.local into an actual IP address actually may already all you need to do as you are in full control of the UDP ports on the Teesny as well as on the MaxMSP side.
4. You start your Max MSP application which will browse the available services for _osc._udp and will be able to show available services you can then select from. There is a MaxMSP plugin available that will do this for you
http://maxobjects.com/?v=objects&id_...=0&id_format=0
But, again as you are in full control of the port assignements you may not need the plugin.
That's it. The only "action you wuill have to perform is to connect the etrumpet-teesny to the computer. The rest is automatic!
I really would love to help you getting this to work. Your use case is a picturebook example of what can be done with OSC and Bonjour and you are using a very popular software in MaxMSP. I'd love to write an article of how to get this to work for my trippylighting.com blog.
I personally use OSC and Bonjour in a very similarly fashion to control my LED lighting systems. The Teensy in my LED system signs on to the router my home computes and iDevices connect to. Then it registers an OSC service per Bonjour, which in turn is picked up by TouchOSC on my iPhone or iPad and I can remotely controll my creations without having to configure an IP address or port or have to think about what protocol is in involved.
and I replied:
In answering
1. I have internet sharing on but probably I don't have to. Did not try without yet.
2. Yes. In my case that is always 192.168.2.4 so no worries there.
3. This is the step I don't understand.
The Teesny registers an _osc._udp service per Bonjour
. Is there any code involved or does this work automatically when including the ethernet library in my sketch?
Then the second step:
This registration will also include a name "e.g. "etrumpet.local" to the IP address the Teensy received from the DHCP server
. Where do I set this name? Is that in the software as well?
The rest is clear.
4. Ok. If I listen on the correct port and the teensy is connected to the local network and sends data to the IP address of that local network than I should see the data coming in in MAXMSP. The object for that is UDPreceive (formerly developed by CNMAT and now part of MAXMSP) which listens on the specified port address of the network that the computer is part of. (I am not totally clear where MAXMSP is listening exactly I must be honest)
Thanks for all your time again.
Best, Hans.