pimoroni / inky

Combined library for V2/V3 Inky pHAT and Inky wHAT.
https://shop.pimoroni.com/?q=inky
MIT License
575 stars 121 forks source link

Search `/dev` directory for i2c interface #152

Closed georgeHall closed 1 year ago

georgeHall commented 1 year ago

Using SMBus initalisation with an integer will force the use of using i2c bus /dev/i2c-1. In RPi os 64 bit the bus does not exist, instead there is bus /dev/i2c-20.

The fix will retrieve the i2c bus from the directory and that should allow the correct bus to be used across an OS.

Resolving: https://github.com/pimoroni/inky/issues/113

Gadgetoid commented 1 year ago

I'd probably add an explicit failover to 20 or prompt the user for a bus address, since this could have unintentional side-effects.

This feels like a bug with 64bit, though, we have over-reliance on hard-coding /dev/i2c-1 basically everywhere and I don't really see why 64bit should break that expectation?

Gadgetoid commented 1 year ago

Sorry, GitHub has deprecated another Python version on Actions and blown up all of our tests. I need to go through and fix these. :sob:

Gadgetoid commented 1 year ago

Has something in the 64bit Raspberry Pi OS changed to render this obsolete?

georgeHall commented 1 year ago

HI Sorry, I have put this on hold as I've been working on something else.