How to get oscP5 library to use the correct ip?

edited August 2014 in Library Questions

I am currently making a interactive led board controlled by an iPad. I have a version up and running perfectly fine on my main computer. I am remaking it on my laptop(running xubuntu) for portability. I have run into a error that I did not find when doing it on windows. That is the the oscP5 library wants to use 127.0.1.1 for receiving data. I need it to be my computers lan ip and not my local ip. Is there any way to switch this? Thanks

Tagged:

Answers

  • Hi, can you give this new release a go?

  • Okay I am using the new library and now it doesnt give me an ip at all. This is what the log says: OscP5 2.0.1 infos, comments, questions at http://www.sojamo.de/libraries/oscP5

    Aug 26, 2014 1:20:10 PM netP5.UdpServer$InternalServer run INFO: starting server, listening on port 8000

    Is there anything I should have done before switching it?

  • This is the code I am using to test it:

    import oscP5.*;
    import netP5.*;
    
    OscP5 oscP5;
    
    void setup(){
      size(300,300);
      background(0);
      oscP5 = new OscP5(this,8000);
    }
    void draw(){
    }
    void oscEvent(OscMessage theOscMessage){
      String addr = theOscMessage.addrPattern();
      float toggle = theOscMessage.get(0).floatValue();
    
      println(toggle);
      println(addr);
    }
    
  • edited August 2014

    Hi, I have successfully sent OSC messages across several devices (osx, android) on my LAN. The log info with the above version does not show an ip address since it is not included in the message, but I will add that for future versions. Meanwhile, you can check your ip with adding NetInfo.print(); to setup() and you will see something like the following

    ### hostname/ip : yourMachineName/192.168.1.194
    ### hostname : yourMachineName
    ### ip : 192.168.1.194
    

    doing so on your host/server computer gives you the IP your client needs to send OSC messages to.

    OscP5 2.0.1 uses the wildcard address 0.0.0.0 (The wildcard is a special local IP address. It usually means "any" and can only be used for bind operations. link; The socket will be bound to the wildcard address, an IP address chosen by the kernel. link; In order to receive broadcast packets a DatagramSocket should be bound to the wildcard address. link), though I have now added an option to specifically set the host IP.

    Also, did you check if the port is not blocked by a firewall?

Sign In or Register to comment.