George
George

Reputation: 193

XBee S1 read values from API mode

I have two XBees S1-one attached to a temperature sensor. This Xbee reads analog values, converts them into digital values thanks to the ADC and transmits them. The other XBee - the receiver, is connected to a computer via a USB Explorer. This XBee works in API mode. The XBee connected to a computer receives the data send by the transmitter. I monitor the received values with the X-CTU software, version 6.2.0. Up until this point, everything works fine.

However, the problem that I encounter is that the data received on the computer is coded: there are bits corresponding to the address of the receiver, bits corresponding to the address of the sender, the data itself, acknowledgment bits,etc. My question is how can I extract only the data bits without all th other information send by the transmitter?

I tried to read the values with a USB to TTL cable, connecting this cable to the Tx, Rx,GND and 5V(there is a 5V input in the USB Explorer despite that the XBee works at 3.3V) of the receiver XBee and using the screen command in Linux. However, in this way I receive ASCII characters and I want to receive the binary code. I want to put those values in a database in order to be able to treat them later.

Thank you for your assistance.

Upvotes: 0

Views: 118

Answers (1)

Thanatheos
Thanatheos

Reputation: 76

With a library like this one, you can use function to get the data from your Xbee in python ;) (if you use linux)

You just have to initialise the port (should be on /dev/tty...) and than catch the data with a loop which check if new data is coming.

If you need more help I can send you part of my code (doesn't have it near me, it's on my raspy)

I hope I've help you ;) Thana

Upvotes: 1

Related Questions