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

issue when using with smbus #7

Open
fl1ck3r opened this issue Dec 9, 2016 · 0 comments
Open

issue when using with smbus #7

fl1ck3r opened this issue Dec 9, 2016 · 0 comments

Comments

@fl1ck3r
Copy link

fl1ck3r commented Dec 9, 2016

I am not sure if this is an issue, i am very new to classes and as such i apologies if this is a really simple question.

I am trying to read values from the SMbus python module, when i run it inside the class i get a bad descriptor error. If i run it outside the class it works fine, but i need to be able to call it withing the main program...

This is the error:
File "powertracker.py", line 100, in
daemon_runner.do_action()
File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 186, in do_action
func(self)
File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 131, in _start
self.app.run()
File "powertracker.py", line 80, in run
amps = selfed.read_ain()
File "powertracker.py", line 61, in read_ain
bus.write_byte(0x48, 0)
File "/usr/local/lib/python2.7/dist-packages/smbus_cffi-0.5.1-py2.7-linux-armv
return fn(*args, **kwdefaults)
File "/usr/local/lib/python2.7/dist-packages/smbus_cffi-0.5.1-py2.7-linux-armv
self._set_addr(addr)
File "/usr/local/lib/python2.7/dist-packages/smbus_cffi-0.5.1-py2.7-linux-armv
ioctl(self._fd, SMBUS.I2C_SLAVE, addr)
IOError: [Errno 9] Bad file descriptor

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

1 participant