Comments (6)
Hello all,
As @FRVisser said, this issue has been resolved in master, but a new release has not been generated. This means that PyPI does not have the latest packaged code to upgrade the library trhough pip.
We are working on generating a new version of the library to distribute through pip, and it will be released shortly.
In the meantime, if any of you needs the changes from master, you can update your python distributions manually. To do so:
- Get the code from master.
- In the root directory you will see a "digi" directory.
- Go to your python distribution (<path_to_python3.x>/Lib/site-packages)
- If the "digi" directory exists there from a previous distribution, uninstall it through pip, or remove it manually.
- Add the "digi" directory just copied from master.
These steps should do it for you. Again, we are planning to do the official release soon, which would allow you to upgrade your library thrugh pip: pip install --upgrade digi-xbee
from xbee-python.
Same here, can never use device.close() without exception.
from xbee-python.
Hello guys,
With the given information we have not been able to reproduce your problem, so to try it more accurately, you should give us the following information:
- Hardware and Firmware versions of your modules (HV and VR commands, respectively)
- The type of environment you are using. I mean, are you plugging your devices directly to a PC, or are you using another kind of product, like a Raspberry Pi?
- What code version are you running your example with? Is it the latest released version (Tag 1.1.0) or the latest code from master (Commit: 02febb6)?
- We assume that you are running the exact example named above with the minor change of removing the try/finally blocks and including the close() and break actions in the if clause when a message is received, is that correct?
Regards,
Hector.
from xbee-python.
Thanks for reply Hector.
1 I am using Digi XBee® SX RF Modems
2 & 3 I am running with latest version(1.1.0) on Raspberry Pi 3 B+ (Raspbian GNU/Linux 9 (stretch)). My python version is 3.5.3.
4 Correct
from xbee-python.
Hi Hector,
For me it seems to be a duplicate of #23 and #24. It understand the is issue has been solved in master but not trough the pip repository.
If I install the latest version on pip with 'pip install digi-xbee' I do get the same error message as the above. However, installing from git master branch solved the issue.
- I am using the xbee 868LP on the official digi development board
- I am using MacOS with python3 in a virtualenv.
- Versions:
osx 10.13.4 (17E199)
$ pip freeze
digi-xbee==1.1.0
pyserial==3.4
- This is the complete code and complete output
$ python
Python 3.6.4 (default, Mar 22 2018, 13:54:22)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from digi.xbee.devices import DigiMeshDevice
>>> local_xbee = DigiMeshDevice("/dev/tty.usbserial-141430", 9600)
>>> local_xbee.open()
>>> local_xbee.close()
>>> Exception in thread Thread-1:
Traceback (most recent call last):
File "/Users/.../digivirt/lib/python3.6/site-packages/serial/serialposix.py", line 483, in read
ready, _, _ = select.select([self.fd, self.pipe_abort_read_r], [], [], timeout.time_left())
OSError: [Errno 9] Bad file descriptor
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/.../digivirt/lib/python3.6/site-packages/digi/xbee/reader.py", line 299, in run
raw_packet = self.__try_read_packet(self.__xbee_device.operating_mode)
File "/Users/.../digivirt/lib/python3.6/site-packages/digi/xbee/reader.py", line 671, in __try_read_packet
xbee_packet[0] = self.__serial_port.read_byte()
File "/Users/.../digivirt/lib/python3.6/site-packages/digi/xbee/serial.py", line 89, in read_byte
byte = bytearray(self.read(1))
File "/Users/.../digivirt/lib/python3.6/site-packages/serial/serialposix.py", line 509, in read
raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: [Errno 9] Bad file descriptor
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/Users/.../digivirt/lib/python3.6/site-packages/digi/xbee/reader.py", line 327, in run
self.__xbee_device.serial_port.close()
File "/Users/.../digivirt/lib/python3.6/site-packages/serial/serialposix.py", line 451, in close
os.close(self.fd)
OSError: [Errno 9] Bad file descriptor
from xbee-python.
Closing this issue since the fix is already included in the latest release: https://github.com/digidotcom/python-xbee/releases.
To update the library through pip, run pip install digi-xbee --upgrade
.
from xbee-python.
Related Issues (20)
- Sending HTTP request after getting packet from Xbee HOT 1
- GettingStarted Code Returns Cannot Import Name XbeeDevice HOT 1
- add_io_sample_received_callback() always using the same remote device HOT 3
- How to receive io samples from one specific node on a network?
- Accessing LQI value HOT 2
- [REQUEST] Open ZigBee Coordinator Backup Format support for Zigbee network backups and restoring from and to Digi XBee 3 Zigbee 3 RF modules HOT 1
- `Serial exception while reading: device reports readiness to read but no returned data HOT 1
- How can I change AP mode to 0 or 2? HOT 3
- Route hops order in `create_source_route` vs `CreateSourceRoutePacket` vs XBee User Guide HOT 4
- Need help with Xmodem HOT 9
- Problems getting the LQI value HOT 4
- Node timeout doesn't work in my script HOT 4
- except TimeoutException, ex: HOT 1
- OTA Failure
- Can't set channel via library. HOT 1
- Large delay in continuous read_data() operations HOT 6
- Broadcast other node information in a mesh network HOT 7
- Error while trying to get 64-bit address of XBee HOT 2
- Reading sensor data using SMT development board HOT 2
- Extracting Transmit Statis for coordinator device HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xbee-python.