I'm trying to write code to connect my Android phone with an XBee-PRO.
Here's my code:
XBee xbee = new XBee();
try {
xbee.open("COM22", 115200);
// ..
Why doesn't it work?
You probably need to use a different name for the serial port, something along the lines of /dev/ttyS##
where ##
is the serial port number. You'll have to open a shell on the Android device and get a listing of ports (ls /dev/tty*
).
If this is a USB connection, get a listing of ports before and after connecting the XBee so you can identify it's device name (the tty that shows up after connecting the device).
Do you have a terminal emulator on the Android device that you can use for debugging? Maybe ssh in and use minicom?