Python – XBee Coordinator API not receiving data from Router AT pin 20

arduinopythonxbeezigbee

A Xbee Series 2 in Router AT configuration with a potentiometer wiper output connected to XBee's pin 20 AD0 is supposed to send the analog data every 100 ms. It was set with ATD02 and ATIR64.

A Xbee Series 2 in Coordinator API config is connected to the computer.

Using XCTU terminal, we can see that the Coordinator is constantly receiving Explicit RX Indicator frames from the Router. However there are no frames containing the analog data read by AD0 on the Router XBee.

enter image description here

enter image description here

Using Python with the XBee module, we also notice the same thing, just rx_explicit frames being received and nothing containing the analog data samples!

{'profile': '\xc1\x05', 'source_addr': '6T', 'dest_endpoint': '\xe8', 'rf_data': '\x01\x00\x00\x01\x02(', 'source_endpoint': '\xe8', 'options': '\x01', 'source_addr_long': '\x00\x13\xa2\x00@\xb1\x92\x13', 'cluster': '\x00\x92', 'id': 'rx_explicit'}

{'profile': '\xc1\x05', 'source_addr': '6T', 'dest_endpoint': '\xe8', 'rf_data': '\x01\x00\x00\x01\x02I', 'source_endpoint': '\xe8', 'options': '\x01', 'source_addr_long': '\x00\x13\xa2\x00@\xb1\x92\x13', 'cluster': '\x00\x92', 'id': 'rx_explicit'}

{'profile': '\xc1\x05', 'source_addr': '6T', 'dest_endpoint': '\xe8', 'rf_data': '\x01\x00\x00\x01\x01\xeb', 'source_endpoint': '\xe8', 'options': '\x01', 'source_addr_long': '\x00\x13\xa2\x00@\xb1\x92\x13', 'cluster': '\x00\x92', 'id': 'rx_explicit'}

{'profile': '\xc1\x05', 'source_addr': '6T', 'dest_endpoint': '\xe8', 'rf_data': '\x01\x00\x00\x01\x01\xce', 'source_endpoint': '\xe8', 'options': '\x01', 'source_addr_long': '\x00\x13\xa2\x00@\xb1\x92\x13', 'cluster': '\x00\x92', 'id': 'rx_explicit'}

What do you think may have happened? I checked the value at AD0 by reading it with an Arduino and indeed there is a value to be read.

Best Answer

Did you configure the AD0 pin as analog properly?

  • If you configured it properly, then it will send the IO sample frame.
  • If you did not connect anything to AD0 then it will send garbage value in the IO sample frame.

A router must have to be configured in API mode to use its analog pin.

See IO sampling using XBee for more information.