I need to know how to send and receive OSC messages between two computers with remote IPs. I have tried this with patches that work on a local network by trying to connect first with udpsend and after with tcpsend to the remote IP and port 9001. However I have not been able to establish connection for the data.
Best
-
OSC messages on remote IP
-
@oscarsantis maybe have a look at netpd which is based around doing this. it connects any computers taking part to the same server.
Online Pure Data Jams: NetPD https://www.netpd.org/ NetPD Discord https://discord.gg/RYbq43DqfX
-
@oscarsantis
NetPd could be a solution if you have a local server running.
But if you don't?When connecting on a local network there is no problem because security is relaxed for communications on your private network.
For connections to the outside world though, your firewall and your router settings are involved.
For UDP and TCP there are small differences.UDP is a "one way" protocol. Data is sent without any confirmation that it has arrived correctly.
For OSC that is usually fine as there is usually a flow of messages (as a fader is moved for example) and if one message is dropped it does not matter much.TCP waits for a confirmation message to be returned, and so it is a "two way" protocol.
The data is always correct, but timing can suffer when data has to be resent.(((A remote computer address is not something like 192.168.1 35 (a reserved private network address).
It will be something like 133.92.158.230......... the address set by the internet service provider (ISP) for your router.
That works because there are never any direct incoming communications unless you are running a server. That is another can of worms though.
Any incoming connection has been set up by your computer (browser, email etc.) which has told the remote sever how to get back in touch....... and opened the ports to allow it to do so.
See below.......)))Your firewall will need to allow Pd to send data over the public network..... so check your firewall settings.
It is usually possible to restrict the port range so as to increase security.
But sending is not dangerous. It is incoming data that the router protects you from.Your router will need to be set to allow an incoming connection for the port that you are using to receive from the remote computer.
Look for "port forwarding" on your router web page. Usually there is some help on the page.
You need to "forward" the port on your computer that the remote computer will be trying to connect to.
You have to set the port and the local IP address of your computer....... so you should fix (static address) the local IP address of your computer and not rely on DHCP because if the address changes it will not be found.The remote computer cannot use your local IP address..... it will just look for it on its own local network.
It needs to send to the port........ at the web IP address of your router...... set by your ISP.
There are browser tools that will tell you your web IP address....... just a google search "what is my IP" will probably do that.
You might need to tell your ISP that you want your IP fixed..... another can of worms.All of that is going to apply to the remote computer and its router too.
And of course you need to know the web IP address of the remote router (again...... set by its ISP) so as to send to that address and not the local IP address of the remote computer.
David. -
@whale-av Thanks David. I'll try and I hope to send you good news.
-
@oscarsantis Did you have any success Oscar?
I've been trying to use ngrok.com with PD. It allows me to open secure tunnels through the router and firewall, but I haven't had any luck getting it working with netsend yet. -
There is an experimental snapshot of aoo (audio over osc) that may support sending osc messages on remote ip .
https://git.iem.at/cm/aoo/-/issues/14#note_6262 -
@LL1 ngrok exposes local servers to their cloud based router so that from the web you can send a tunnelled request to a server on your computer.
But Pd is not a server as such and the protocols could well be ignored by Pd.
Try this........ comms_over_web.zip
You will need access at least to the settings for your router serving the local computer.... and firewall settings for both computers.
I hope I haven't forgotten anything.
David.Setting DMZ on for your router is a last resort while you try to figure out the port forwarding.
Gamers turn it on because they just can't figure out what port ranges might need to be open.Usually you can set port forwarding ranges for UDP and TCP separately or both and it is a good idea to set a range rather then a fixed port if you are likely to use a number of [netreceive]s.
If you are going to open lots of ports in the router for various reasons it is a good idea to fill in the "application" column so you can remember which is which...... putting "Pd OSC" for example.
And leaving both protocols routed will help if you need to change from UDP to TCP because of missing packets.YOU CAN SEND data back from [netreceive] on the same port...... from the same object........ if you use TCP instead of UDP.
That could be useful because you probably don't have access to the router that your remote computer is connected to........ so no possibility of punching a hole through its firewall for another port for return messages.
But I have not tested whether that will really work over the web and I would be interested to know....Of course the IP addresses are not likely to be the same as in the example below..........
-
@LL1 and @oscarsantis - I just got my remote netsend working with ngrok - it wasn't too hard to set up in the end! As an example of what you get when you run
./ngrok tcp 4000
isForwarding tcp://2.tcp.ngrok.io:15524 -> localhost:4000
- this gives you the clue to what you then need to setup on your 'netsend' on your remote pd patch (with you local simply setup with 'netreceive 4000' ). So then on your remote, the message box coming in to 'netsend' wants to read 'connect 2.tcp.ngrok.io 15524' (ip and port number respectively).I tested this with one laptop connected to my wifi, and with another connected to a mobile phone running a 4G hotspot. The next test it too see if it works with someone in Japan! Hope this helps