Home/Support/Support Forum/Get RSSI value with XBee Java Library in Raspberry Pi

Get RSSI value with XBee Java Library in Raspberry Pi

0 votes
Hello,

I have connected a XBee Pro S2B + XBee Usb Explorer + Raspberry Pi.

I used XBee Java Library and XBee's are in Api 2 Mode.

I need to get the RSSI value of remote XBee devices.

I have to connect the Raspberry Pi PIN6 (as is done in Arduino) or not needed if I have the XBee Explorer USB?

I tried so, but not works:
Code:
localXBee.setIOConfiguration(IOLine.DIO10_PWM0, IOMode.SPECIAL_FUNCTIONALITY); localXBee.setPWMDutyCycle(IOLine.DIO10_PWM0, 90);

and to get the value so:
Code:
double value = localXBee.getPWMDutyCycle(IOLine.DIO10_PWM0); LOG.info("RSSI Value: " + value);

But guess is wrong, because not works.

Best regards.
asked Feb 5, 2015 in RF Solutions and XBee by gpio New to the Community (22 points)
edited Feb 5, 2015 by gpio

Please log in or register to answer this question.

1 Answer

0 votes
Hi!

Thanks for the question.

There exists a parameter that returns the RSSI of the last received packet, DB.

You can read it as follows:
Code:
byte[] rssi = localXBee.getParameter("DB"); LOG.info("RSSI Value: " + ByteUtils.byteArrayToInt(rssi));

You don't have to change the configuration of the DIO10.

Hope this helps.
Regards.
answered Feb 6, 2015 by rmoral New to the Community (45 points)
Thank you!

Works fine.

But what I can use to update that value?

I used ScheduledExecutorsService to update each 5 seconds, and works, but when I changed (.setDIOValue(IOLine.DIO0_AD0, IOValue.LOW);) of RemoteXbee, ExecutorsService stops working.

Is there something that works better?

Should I use these interfaces , IPacketListener or IDataListener?


Regards.
What value do you want to update?
What exception is thrown when you use that method?
Of remote Xbee.

I have 30 Xbee's + 1 router (antenna) + 1 coordinator ( Raspberry Pi + PiTFT + Lipo Battery 3.7V 6000 mAh + pololu 3.7V to 5V converter).

On Raspbian I have a JavaFX application with a ListView with 30 items, each one associated to a XBee. I want that when the operator touch a item is recovered a rssi value of XBee selected.

Regards

PD: I got this error, https://github.com/digidotcom/XBeeJavaLibrary/issues/27
Of remote Xbee.

I have 30 Xbee's + 1 router (antenna) + 1 coordinator ( Raspberry Pi + PiTFT + Lipo Battery 3.7V 6000 mAh + pololu 3.7V to 5V converter).

On Raspbian I have a JavaFX application with a ListView with 30 items, each one associated to a XBee. I want that when the operator touch a item is recovered a rssi value of XBee selected.

Regards
Ok, you should read then the DB parameter for the selected remote XBee if you want to know its RSSI value.
[code]
int rssi = ByteUtils.byteArrayToInt(remoteXBee.getParameter("DB"));
[/code]
Thank you!

I'll try as soon as possible.

Best regards
...