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

Convert from Adafruit_GPIO library (which is archived) to smbus2 library #28

Open
chrisb2 opened this issue Nov 17, 2021 · 2 comments
Open
Assignees

Comments

@chrisb2
Copy link
Owner

chrisb2 commented Nov 17, 2021

The Adafruit_GPIO library is now archived and so does not correctly support later versions of Raspberry Pi and OS. The plan is to replace this with smbus2.

This stacktrace occurred on a Raspberry Pi 4 with 'Bullseye' Raspberry Pi OS:

File "/usr/local/lib/python3.9/dist-packages/ina219.py", line 116, in __init__
    self._i2c = I2C.get_i2c_device(address=address, busnum=busnum)
  File "/usr/local/lib/python3.9/dist-packages/Adafruit_GPIO/I2C.py", line 63, in get_i2c_device
    busnum = get_default_bus()
  File "/usr/local/lib/python3.9/dist-packages/Adafruit_GPIO/I2C.py", line 55, in get_default_bus
    raise RuntimeError('Could not determine default I2C bus for platform.')
RuntimeError: Could not determine default I2C bus for platform.

A work-around for this is described in the readme.

@chrisb2 chrisb2 self-assigned this Nov 17, 2021
@chrisb2
Copy link
Owner Author

chrisb2 commented Feb 14, 2022

@eliran-n - please raise this as a new issue, a PR is not a suitable place to ask unrelated questions. Thx

@eliran-n
Copy link

@eliran-n - please raise this as a new issue, a PR is not a suitable place to ask unrelated questions. Thx

Sorry, I was connected from a mobile device and I didn't find a way to contact you.
I post my question as a new issue. Thank you

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

No branches or pull requests

2 participants