We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hi all,
i have an Android sketch sending to an sketch in Java mode (running on my pc) i can receive messages on my android client, but not send any message to the pc server ???... (it works well when both run in Java Mode) NetInfo.print() tells me that the Server has the real IP, but the Android (running on my Phone) says "INFO @ OscP5 is running. you (127.0.0.1) are listening @ port 5002" and not its Wifi IP (does this matter?)
I tried out many possibilities, no success :-( ... Please help, thanks!
here is the send part / summarized
OscP5 oscP5; NetAddress myRemoteLocation; OscMessage myMessage;
void setup() { oscP5 = new OscP5(this, incoming_port); myRemoteLocation = new NetAddress(remote_ip,remote_port); }
void mousePressed(){
// create an osc message OscMessage myMessage = new OscMessage("//"); myMessage.add("Message:"+id); // add a string to the osc messag
try{ //myRemoteLocation = new NetAddress(remote_ip,remote_port); oscP5.send(myMessage, myRemoteLocation); //oscP5.flush(myMessage, myRemoteLocation); msg_out=myMessage.get(0).stringValue(); println(msg_out); id++; }catch(Exception e){ msg_out="Error: " + e.getMessage(); println(msg_out); } }
console Output (Android Client, not connected to internet) debug:
Either the http://checkip.dyndns.org is unavailable or this machine is notconnected to the internet ! OscP5 0.9.9 infos, comments, questions at http://www.sojamo.de/oscP5 Register Dispose java.lang.NullPointerException
Inefficient font rendering: use createFont() with a TTF/OTF instead of loadFont().
Answers
** Sorry, now with better formatting **
** Console **
it must be a networking issue, because the code works (when sending the message to itself/127.0.0.1, it receives it properly)
A generic answer: Do you have the
INTERNET
permission enabled for the Android sketch (Android > Sketch Permissions from the PDE)?yes of course :-); nevertheless, i found a work around -> using instead the UDP Library, it seems to work. Reason - maybe when creating a new udp object, you can set your (real) ip adress => udp = new UDP(this, incoming_port, own_ip);
But i would really prefer to use oscP5 ... any ideas?