Hi, I'm trying to let Android and Arduino exchange data directly by IP. After 3 weeks work, it's ok to send OSC message from Android emulator to Arduino with Ethernet Shield. also,processing can receive OSC message from Arduino.
But the problem is, when run the Processing Sketch on Android emulator, it can not receive OSC message from Arduino.
byte myIp[] = { 131,113,xxx,xx7 }; // IP for Arduino with Ethernet Shield
byte destIp[] = { 131,113,xxx,xx5 };// IP for Processing sketch
int destPort = 12000;
int serverPort = 12000;
this is data receiving part from Processing for Android:
oscP5 = new OscP5(this,12000);
myRemoteLocation = new NetAddress("131.113.136.217",12000);
run the processing sketch on laptop it works very well(send and receive),
but when run it on Android emulator,it does not work.(send is ok, receive doesn't work)
processing console information shows like this:
" INFO @ OscP5 is running. you (127.0.0.1) are listening @ port 12000"
Guess is about IP address, cause i use specific IP address to send and receive OSC message between them.
but now the emulator use localhost address, does Emulator has IP address like this "
131,113,xxx,xx5"?
any ideas? any advices?
I'll post the working code after solve this problem. thanks so much.
Hi,
I had some troubles with receiving incoming values from Android Emulator, but when i replaced loopback address (127.0.0.1) with my private IP address (192.168.0.10), It works very well. Does anybody knows the reason? Or any ideas about how works with Multicast (239.0.0.1) ?
Anyway, here are working codes, I hope it will help newcomers like me.
Cheers and thanks in advance!
oscP5 on Processing:
/**
* oscP5sendreceive by andreas schlegel
* example shows how to send and receive osc messages.
I'm trying to build a SMS like system by Processing, it should works like this: One Sketch send sentence, another one receive. They should both have Text input area and display area. and for sure submit button.
I had try
oscP5 multicast to send mouse pressed data from one sketch to another one to change the background color,it works great.
But as a new guy for Processing. I still have no idea about:
1,How to send and receive Text not just number. (with oscP5 and String?)
2,How to display the received
Text like iPhone SMS pop-up dialog.
3,,,,,
any feed back will be very helpful and thanks so much for reading.
When building a PDE file without Libraries the android emulator works great,
but when building a PDE file with libraries such as processing.net.* or oscP5.*,emulator doesn't work and show me bad face.
The question is,can we using Processing Libraries with Android directly,or how to use Processing Libraries such as processing.net.* or oscP5.* with Android.or should i learning Android programming when i need this kind of Libraries.(its too difficult)
Any feedback,ill really appreciate that.thanks for reading.