Git Product home page Git Product logo

Comments (6)

hgonzaleDigi avatar hgonzaleDigi commented on August 20, 2024 2

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:

  1. Get the code from master.
  2. In the root directory you will see a "digi" directory.
  3. Go to your python distribution (<path_to_python3.x>/Lib/site-packages)
  4. If the "digi" directory exists there from a previous distribution, uninstall it through pip, or remove it manually.
  5. 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.

FRVisser avatar FRVisser commented on August 20, 2024

Same here, can never use device.close() without exception.

from xbee-python.

hgonzaleDigi avatar hgonzaleDigi commented on August 20, 2024

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.

ciel77 avatar ciel77 commented on August 20, 2024

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.

FRVisser avatar FRVisser commented on August 20, 2024

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.

  1. I am using the xbee 868LP on the official digi development board
  2. I am using MacOS with python3 in a virtualenv.
  3. Versions:
    osx 10.13.4 (17E199)
$ pip freeze
digi-xbee==1.1.0
pyserial==3.4
  1. 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.

rubenmoral avatar rubenmoral commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.