SLIP Message

I'm looking at trying to send a simple OSC message via SLIP using an example in the OSC library.

I'm just wondering about the section in void loop where you set up the message. This is the code: -

void loop(){
  //the message wants an OSC address as first argument
  OSCMessage msg("/analog/0");
  msg.add((int32_t)analogRead(0));

I am new to UPD so am a little unsure of how the message should look. Is the "/analog/0" in
OSCMessage msg("/analog/0");
supposed to be left as it is unless I want to call it something else?

Is this just a name given in the form of a string which I then look for at the other end of the network?

And also does the next line...
msg.add((int32_t)analogRead(0));
just append the actual reading from the pin (as a 32 bit integer) to the end of the message?

I've uploaded this code and I seem to be getting a constant flash on my RX pin. WHich seems bizarre as I'm trying to send data not receive it.

Oh also, I'm using a simple potentiometer setup on analogue pin 0

1st pin -> ground
wiper -> A0
3rd pin -> 5v

Thanks

theobsoletemovement:
I am new to UPD so am a little unsure of how the message should look.

You seem to be mixing up protocols: OSC is a Presentation Layer protocol in the OSI model (layer 6), it defines a format for two applications to share a specific type of data. OSC is built on top of UDP, which is a Transport Layer protocol (layer 4) to transport messages between hosts on a network. SLIP is a Data Link Layer protocol (layer 2) that can be used to transfer data between two adjacent nodes in a network. It's an alternative to the Ethernet or WiFi.

theobsoletemovement:
Is the "/analog/0" in OSCMessage msg("/analog/0");
supposed to be left as it is unless I want to call it something else?

Is this just a name given in the form of a string which I then look for at the other end of the network?

"/analog/0" is the OSC address. See the OSC Semantics section in the OSC specification.
It's the address that's used to identify the message at the receiver.

You can change it if you want, but you have to follow the format specified by the OSC spec.

theobsoletemovement:
And also does the next line...
msg.add((int32_t)analogRead(0));
just append the actual reading from the pin (as a 32 bit integer) to the end of the message?

Yes, it adds the actual data to the message.

theobsoletemovement:
I've uploaded this code and I seem to be getting a constant flash on my RX pin. WHich seems bizarre as I'm trying to send data not receive it.

That seems to indicate that your computer is sending data to the Arduino for some reason.

The CNMAT/OSC library is a pretty terrible Arduino library. It turns your heap into swiss cheese in no time. It constantly allocates and reallocates dynamic memory. Just have a look at the add function, for instance: OSC/OSCMessage.h at master · CNMAT/OSC · GitHub

Even relatively simple OSC sketches crashed my Arduino Uno after a couple of messages. (Especially when receiving data.)

You should also keep in mind that in the OSC library, SLIP is not used as an internet protocol, it's just used for framing. Also, most modern operating systems don't have any SLIP drivers enabled by default. This means that you'll need an application on your computer to translate the OSC messages coming from the Arduino to real UDP OSC packets. This is the code I used:
Projects/Arduino/NodeJS/SLIP at master · tttapa/Projects · GitHub. It comes with an example Arduino sketch that sends OSC messages.

Pieter