Muzer / python-xbee

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

can't send '}' character #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. sender invoke: xbee.tx(dest_addr='\x00\x02', data = '}')
2. receiver : packet = xbee.wait_read_frame() 
3. receiver: print packet['rf_data']
What is the expected output? What do you see instead?
Expected output:
   receiver prints: '}'

What do I see:
  receiver print nothing. it is still waiting for packet. 

What version of the product are you using? On what operating system?
XBee API version 2.1. Operating System: Mac OSX Mountain Lion

Please provide any additional information below.
Whenever the data field of the xbee.tx(...) is not '}', it does what it soposed 
to do. I am trying to send a JSON packet over from xbee to xbee communication 
between two computers in python. 

Original issue reported on code.google.com by takhan...@gmail.com on 31 May 2013 at 4:24

GoogleCodeExporter commented 9 years ago
Have you tried enabling escaped API mode, both on the attached XBee and on the 
PC?

This can be done with python-xbee like so:

   xbee = XBee(ser, escaped=True)

This also works for ZigBee.

I'll investigate in the mean time.

Original comment by pmalms...@gmail.com on 1 Jun 2013 at 8:44

GoogleCodeExporter commented 9 years ago
I added some tests for transmitting and receiving strings with '}'; see 
revisions 7155e3b5f2ce and 7100bb027a3a. These tests pass without issue.

Since '}' is a special character when using API mode with escaping enabled, the 
only thing I can think of is that your XBee and attached PC disagree about 
whether to use escaping.

If the attached XBee has API=2 (escaping enabled), but python-xbee does not 
have escaped=True, then the behavior you are seeing would likely result; 
packets containing unescaped '}' characters would be seen as malformed, and the 
attached XBee would silently discard them.

Let me know what the value of the 'API' setting is on your device and whether 
or not your python code includes escaped=True when creating an XBee or ZigBee 
object.

Original comment by pmalms...@gmail.com on 1 Jun 2013 at 9:28

GoogleCodeExporter commented 9 years ago
Here are links to the revisions I mentioned: r7155e3b5f2ce and r7100bb027a3a.

Original comment by pmalms...@gmail.com on 1 Jun 2013 at 9:31

GoogleCodeExporter commented 9 years ago
Yes I enable the XBee API mode through serial terminal (cool term).
+++OK
ATAP 2
OK
ATWR
OK

Thank you for investigating. Its really important for me for my project,
the only fix i found was to rid of the '}' character completely then send
it through XBee and the receiving end puts the '}' character back to its
place.

PS. Will you make a comprehensive document about the Python-xbee API
anytime soon? I didn't know I can enable the API mode like that.

Original comment by takhan...@gmail.com on 3 Jun 2013 at 2:04

GoogleCodeExporter commented 9 years ago
Sorry I didn't read your first e-mail. I'll go test that out right now.

Original comment by takhan...@gmail.com on 3 Jun 2013 at 2:05

GoogleCodeExporter commented 9 years ago
Sorry again. I left my equipments in my university. I'll contact you once I
test with the enable option.

Thank you again for taking the time to read my mail.

Original comment by takhan...@gmail.com on 3 Jun 2013 at 2:07

GoogleCodeExporter commented 9 years ago
Hi,

So i put in the escape = True. and...... IT'S WORKING!!. Thank alot. :)

Original comment by takhan...@gmail.com on 3 Jun 2013 at 5:23

GoogleCodeExporter commented 9 years ago
Excellent; I'm glad it's working for you.

To answer your earlier question about the python-xbee API, take a look at the 
documentation posted on the downloads page 
(http://code.google.com/p/python-xbee/downloads/detail?name=XBee-2.1.0-Documenta
tion.pdf&can=2&q=).

Original comment by pmalms...@gmail.com on 4 Jun 2013 at 3:23

GoogleCodeExporter commented 9 years ago

Original comment by pmalms...@gmail.com on 4 Jun 2013 at 3:24

GoogleCodeExporter commented 9 years ago
It's not working for you? Why the status is WontFix?

Original comment by takhan...@gmail.com on 4 Jun 2013 at 1:29

GoogleCodeExporter commented 9 years ago
Issue trackers provide status values like this to help developers keep track of 
how an issue is being resolved. In this case, I did not need to change or fix 
any code to resolve your issue, so I marked it as WontFix. 

It does not indicate that the code is broken; in fact it indicates that the 
code works properly. Issues with a status of New, Accepted, or Started, on the 
other hand, indicate that they need further investigation.

Original comment by pmalms...@gmail.com on 4 Jun 2013 at 5:22

GoogleCodeExporter commented 9 years ago
ahh ok. I assume that WontFix means there is no way of fixing it. I didn't
see it as an issue with the library itself doesn't need fixing. Thanks
again

Original comment by takhan...@gmail.com on 4 Jun 2013 at 6:16