You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using a growing number of I2C type sensors.
Ans we use libraries for I2C sensors that naively set-up their private I2C (import smbus etc). Then they are using the shared I2C bus resource as if they are the only user from their private smbus objects.
As it seems having multiple smbus objects, governing the same I2C bus seems to work if you are not using asyncio, threading or multi-processing that is. The smbus object probably does not keep much state or may use a singleton under the hood).
Anyway, the model breaks down when there are concurrent users of the bus. And in our case there will be. So we'll need a locking mechanism for the bus that works for multiple processes / threads sharing the bus.
Most appropriate solution may be using fcntl on a dummy lock file. @MichielBbal, should/can we put a card in Trello to solve this issue?
The text was updated successfully, but these errors were encountered:
We are using a growing number of I2C type sensors.
Ans we use libraries for I2C sensors that naively set-up their private I2C (import smbus etc). Then they are using the shared I2C bus resource as if they are the only user from their private smbus objects.
As it seems having multiple smbus objects, governing the same I2C bus seems to work if you are not using asyncio, threading or multi-processing that is. The smbus object probably does not keep much state or may use a singleton under the hood).
Anyway, the model breaks down when there are concurrent users of the bus. And in our case there will be. So we'll need a locking mechanism for the bus that works for multiple processes / threads sharing the bus.
Most appropriate solution may be using fcntl on a dummy lock file. @MichielBbal, should/can we put a card in Trello to solve this issue?
The text was updated successfully, but these errors were encountered: