cthuun / python-xbee

Automatically exported from code.google.com/p/python-xbee
MIT License
1 stars 0 forks source link

XBee ZB devices: DIO lines 12 and 4 never parsed as enabled #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a bunch of Xbee Pro 900HP module and i got a major error, the frame 
decoding is putting a @ symbol when it should be a 40 in the source_addr_long 
field.
{'source_addr_long': '\x00\x13\xa2\x00@\xa5P\xe2', 'source_addr': '\xff\xfe', 
'id': 'rx_io_data_long_addr', 'samples': [{'adc-1': 0, 'adc-2': 933, 'adc-3': 
306}], 'options': '\xc2'}

The real source_addr_long is: 0013a20040a550e2
So
00 13 a2 00 40 a5 50 e2
You can see that the 40 is seen as @ and the 50 is seen as P, what it does is 
that the rest of the frame is shifted so the values are not right!!
Is there any quick bug fixes ?

Original issue reported on code.google.com by martin.e...@gmail.com on 19 Sep 2013 at 1:06

GoogleCodeExporter commented 9 years ago
This is not a bug; Python prints binary values in strings which match up with 
ASCII characters as the character.

You can try this yourself with a Python console:
>>> '\x40'
'@'

Original comment by pmalms...@gmail.com on 19 Sep 2013 at 1:14

GoogleCodeExporter commented 9 years ago
Do you know any reason why i don't have the good analog value? it is like we 
are off 1 or 2 bytes?

7E – Start Delimiter
00 18 – Length Bytes
92 – Frame type
0013a200 40A550 E2 – 64 bit senders address
FFFE – 16 bit network address
C2 – Receive Option
01 – Number of Samples
1000 - CD/DIO12 Enabled
0E - A1 2 and 3 enabled
1000 – Value for enabled DIO lines
ADC1 = 03 A4
ADC2 = 01 31
ADC3 = 03 31
01 – Checksum

This is what i receivem the complete frame grabed in X-CTU

Original comment by martin.e...@gmail.com on 19 Sep 2013 at 4:26

GoogleCodeExporter commented 9 years ago
I don't know if you have seen my reply or not? Since the ticket was closed, 
will it reopen ? like i said, i got corruption in the data but the API frame is 
OK!

Original comment by martin.e...@gmail.com on 20 Sep 2013 at 2:55

GoogleCodeExporter commented 9 years ago
I saw it, yes; I will take a closer look when I have time.

Original comment by pmalms...@gmail.com on 20 Sep 2013 at 2:59

GoogleCodeExporter commented 9 years ago
I am willing to pay for your service, i don't know if there is anyway we can 
communicate and get this sorted out ASAP, since i will use this in our 
application, i don't care paying for commercial services!! Thanx a lot!

Original comment by martin.e...@gmail.com on 20 Sep 2013 at 3:01

GoogleCodeExporter commented 9 years ago
I look a closer look at your example. I could not find a message with Frame 
Type 0x92 defined for Xbee Pro 900HP devices in the product manual; they are, 
however, defined for XBee ZB (ZigBee) devices.

If you are really using an XBee ZB device, then this does appear to be a bug. I 
am investigating.

Original comment by pmalms...@gmail.com on 20 Sep 2013 at 11:15

GoogleCodeExporter commented 9 years ago
This was a confirmed bug for XBee ZB (ZigBee) devices: the enabled DIO lines 
value in sample data was masked incorrectly; as a result, DIO lines 12 and 4 
would never be parsed as enabled. If these lines were the only enabled lines, 
this would result in improper parsing of any ADC data to follow.

This was fixed in revision 75ae5e903e10; please try checking out the latest 
version from the project's repository and let me know if that solves your 
problem.

Original comment by pmalms...@gmail.com on 21 Sep 2013 at 12:07

GoogleCodeExporter commented 9 years ago
Yes! seems to be working pretty good now!!
Thanx a lot! You have done a really good work on this one!! This library is 
really good!!

Original comment by martin.e...@gmail.com on 21 Sep 2013 at 3:49