XBee Android Library errors with XBee Pro SX Dev Kit

I have written a basic Android app that uses the XBee Android Library (GitHub - digidotcom/xbee-android: Android library to interact with Digi International's XBee radio frequency modules from mobile devices.) however when I test the App using the XBee Pro SX Dev kit (XK9X-DMS-0 - Digi XBee SX RF Module Dev Kit, US/CA | Digi International) the device is unable to be opened. The library gives the following error.

  [main] INFO com.digi.xbee.api.android.XBeeDevice - com.digi.xbee.api.android.connection.usb.AndroidUSBInterface@584a703Connection interface closed.
  com.digi.xbee.api.exceptions.InvalidOperatingModeException: Could not determine operating mode.

This error only occurs when I use the solder dev board with the 1 watt SX chip. The SMT Socket board with the 20mW dev board works as expected. Does anyone know how to remedy the situation? Both boards are configured for API Mode.

This sounds like you are not able to provide the necessary power for the 1W product to operate.

Hello, Thank you for taking the time to offer your suggestion. However, considering this is a Digi OEM development kit with provided power supplies, I seriously doubt that a lack of power is the issue. I am using the provided wall outlet power bricks to provide power. The boards also function flawlessly with the XCTU utility with range testing for example.

The problem appears to be how the dev boards init the XBee Pro SX 900 chip when using the XBee-Android library. I say this because the XBee-Python library on Windows works with the boards.

This is an old kit. Do you have the radios in API mode? That would be AP1 or 2.

Hello, yes. The radio is set to API Mode 1 (non-escaped). I’ve also tried API Mode 2 (escaped) but the same error gets reported by the XBee-Android library code.

I have used XCTU to write the “Default” values to both radios and then changed the API Mode on both radios to 1.

I did some searching and I am finding that it may be one of the following:

  • Make sure that the USB cables are properly connected (secure)
  • Check for any timeout values that may occur if there is no data being received/sent
  • Make sure you application has permissions to access the necessary USB ports and are handling the permissions properly.
  • Implement some sort of Error handling to log more details as to when the connection in closed
  • If you are not doing so, make sure you have some sort of logic that will attempt a re-connection to the port

Hello, thanks for trying to help, all of your suggestions are being done already.

If you are able to contact the Digi people involved with the XBee-Android-Library github that would be very helpful. I opened a issue 2 weeks ago and have not heard anything back from them.

Finally figured it out, the dev board does not use the 0 index of the usb device’s interface. I had to update the Android library to use index 2.

1 Like