Getting the IP address of the device that sent an OSC message

I am doing some OSC stuff to control track devices, and what I want to do is have my Renoise handle an OSC message that is some sort of “current status” request and send an OSC message back with some device info.

Can anyone point me in the right direction for getting the IP address of an OSC client? (That is, the address of whatever just sent that “current status” request.)

Thanks!

For what you need this? Normally the senders address should be reachable under loopback 127.0.0.1 or under localhost.

look here…

https://files.renoise.com/xrnx/documentation/Renoise.Socket.API.lua.html

and here…

https://files.renoise.com/xrnx/documentation/Renoise.Osc.API.lua.html

maybe that helps you.

You should have access to sender ip address over the socket object that is given back when a successful connection is etablished.

happy tracking :slight_smile:

The sender is a separate physical device (a phone or tablet, but could be either at different times), so it’s not going to be localhost.

The “MyNotifier” example at the end of the Socket API docs might be a path.

Thanks!

1 Like

Thanks, but I don’t see how this allows Renoise Lua code to determine the IP address of the sender of an OSC message in order to send a reply back to that address.

snort can inspect a network package and see from what ip it came from.

I didn’t know it had to run in Renoise though

The example in the Socket docs is essentially correct but it needs updating because it says you can use socket.address but that throws an error. What worked for me is socket.peer_address (which I found further up on the same page.).

My tools that use OSC already had socket_message(socket, message) implemented in order to have an OSC server other than the default Renoise OSC server, so grabbing the peer_address is easy.

Next step is for the code to create an OSC client with that address (or re-use an existing one if has already been created).

1 Like

Yeah, I already know the addresses of all the devices but I want a tool to be able to detect it so that it can send back data to whatever client requests it. The Socket API docs offered a solution. But thanks, though.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.