Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOError when trying to connect sensor to Raspberry Pi #12

Open
anuj-sp opened this issue Dec 31, 2019 · 3 comments
Open

IOError when trying to connect sensor to Raspberry Pi #12

anuj-sp opened this issue Dec 31, 2019 · 3 comments

Comments

@anuj-sp
Copy link

anuj-sp commented Dec 31, 2019

After following the instructions to install required packages and changing the dev rules, the CO2monitor() functions throws an IOError as open failed. The command and error log can be seen as follows:

python -c "import co2meter as c; m=c.CO2monitor(); print(m.info)"

The error log is:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/co2meter/co2meter.py", line 95, in __init__
    with self.co2hid():
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/usr/local/lib/python2.7/dist-packages/co2meter/co2meter.py", line 144, in co2hid
    self.hid_open(send_magic_table=send_magic_table)
  File "/usr/local/lib/python2.7/dist-packages/co2meter/co2meter.py", line 114, in hid_open
    self._h.open(self._info['vendor_id'], self._info['product_id'])
  File "hid.pyx", line 66, in hid.device.open
IOError: open failed
@richmidwinter
Copy link

I get the same, but on a Macbook Pro.

@richmidwinter
Copy link

Ah. Think it just means the device isn't connected.

Tried a different USB hub and it's working for me.

@davidskeck
Copy link

davidskeck commented Apr 26, 2020

Hello, I got this same issue, but after updating the dev rules as shown in the README, it works as expected. Make sure you run sudo udevadm control --reload-rules && udevadm trigger as the root user by calling sudo su followed by the command, and then exit out of root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants