If you have read my previous blog post, the next step comes pretty natural. Just having one device creating and displaying morse code, defeats the purpose of this early way of communication. So I sat down, to set up a network communication between the Arduino and my laptop, which sounded easier than it was.
Since I had used OSC messages in countless classes before, I wanted to come up with a sketch, that could send those messages. Searching for a possibility to send this messages over WiFi, I started by looking at the examples, that were already provided by Arduino and I found something! Part of the WifiS3 library, there was a sketch, that showed how to send & receive UDP messages. Great! I uploaded the sketch and tried sending a message to the Arduino, using a simple Max patch. The message was received, although the response message wasn’t.


As you can see on the screenshot above, Max received a message, but it wouldn’t display its contents, since I had no idea what went wrong, I tried to adjust the message, so it would be a multiple of four, just like Max asked. But I just got another error message:

Still no idea what this error message was supposed to mean, but I kept trying. I reduced the length of the “message name string”, but without any success. I still got the same error message, as before, even though an even shorter message name wouldn’t have made any sense.
Defeated, I went to class the next day and talked about my problem with a fellow student. He brought to my attention, that Daniel Fabry had shared an example for the same thing last semester, which I knew worked, since I tried it in class, I just had forgotten about it. So I took a look at his sketch, which used an entirely different library. The code syntax was early identical, but the library was different. With my new knowledge, I adapted my code again and this time, it worked!

Now my Max patch could receive strings from the Arduino, great! As a next step, I updated my patch to actually replay the received morse code message. And my new version was done! Now messages could actually be sent wirelessly to other devices making actual communication possible.
This little detour into OSC & WiFi with Arduino really got me interested to explore this topic further. I am excited to find out the things that are possible using this technology.
Instructions
For the second version, you need:
- an Arduino (capable of using Modulinos)
- the three button Modulino
- a Laptop with Max
Before uploading the sketch to the Arduino, you need to go into the “secrets.h” tab and enter your WiFi SSID (Name) and password. After this, go to the “sendIP” variable and change the Ip Address, to target your laptop. After applying these changes, upload the patch & build a simple UDP receive logic in Max, similar to the one you can see on my screenshots.