digidotcom / xbee-python

Python library to interact with Digi International's XBee radio frequency modules.
Mozilla Public License 2.0
185 stars 93 forks source link

digi-xbee on raspberri pi 3 #106

Closed aang7 closed 5 years ago

aang7 commented 5 years ago

Hello, I'm just trying to connect to my XBee module with a raspberry pi 3 and I can't. Some one knows how to achieve this? I've already have installed the library and using python 3.7.3 within raspbian buster and stretch and nothing...

Traceback of error: Traceback (most recent call last): File "main.py", line 79, in <module> if not local_node.open_local_node(True): File "/home/pi/GreenRpi/nodes/local_node_handler.py", line 33, in open_local_node return self.local_node.open_local_node(open_=_open) File "/home/pi/GreenRpi/nodes/xbeenode.py", line 22, in open_local_node self.local_node.open() File "/home/pi/GreenRpi/env/lib/python3.7/site-packages/digi/xbee/devices.py", line 2043, in open self._do_open() File "/home/pi/GreenRpi/env/lib/python3.7/site-packages/digi/xbee/devices.py", line 2065, in _do_open self.read_device_info() File "/home/pi/GreenRpi/env/lib/python3.7/site-packages/digi/xbee/devices.py", line 509, in read_device_info self._role = self._determine_role() File "/home/pi/GreenRpi/env/lib/python3.7/site-packages/digi/xbee/devices.py", line 528, in _determine_role ss = self.get_parameter(ATStringCommand.SS.command) File "/home/pi/GreenRpi/env/lib/python3.7/site-packages/digi/xbee/devices.py", line 1584, in dec_function return func(self, *args, **kwargs) File "/home/pi/GreenRpi/env/lib/python3.7/site-packages/digi/xbee/devices.py", line 2121, in get_parameter return super().get_parameter(param, parameter_value=parameter_value) File "/home/pi/GreenRpi/env/lib/python3.7/site-packages/digi/xbee/devices.py", line 225, in get_parameter value = self.__send_parameter(parameter, parameter_value=parameter_value) File "/home/pi/GreenRpi/env/lib/python3.7/site-packages/digi/xbee/devices.py", line 315, in __send_parameter self._check_at_cmd_response_is_valid(response) File "/home/pi/GreenRpi/env/lib/python3.7/site-packages/digi/xbee/devices.py", line 334, in _check_at_cmd_response_is_valid raise ATCommandException(cmd_status=response.status) digi.xbee.exception.ATCommandException: There was a problem sending the AT command packet

EDIT 1: Ok for some reason it's working in raspbian stretch but not (yet) in buster.

EDIT 2: It works if I use the java xbee library. In other news still doesn't work in buster... :( Originally posted by @aang7 in https://github.com/digidotcom/xbee-python/issues/75#issuecomment-559623396

tatianaleon commented 5 years ago

Hi @aang7 ,

This might be related with issue https://github.com/digidotcom/xbee-python/issues/103. You can try with the source code in master.

Sorry for the inconvenience.

tatianaleon commented 5 years ago

Hi @aang7,

Thanks for reporting this issue. It is already fixed in master (see commit https://github.com/digidotcom/xbee-python/commit/a10f3dfc7eb283f93c46ed3e559b9429825e5a51) and will be included in the next release.

In the meantime, you can download the source code from the master branch and install the library from there (see instructions at https://github.com/digidotcom/python-xbee/blob/master/README.rst#install-from-source).

Sorry for the inconvenience.

Best regards.