On 23/11/2019 08:55, R.Wieser wrote:
> Hello all,
>
> I've got a few I2C modules (clock, temperature sensor, etc) that I would
> like to access using different programs.
>
> The question is: how do I allow multiple programs to access the same I2C
> bus, but not interfering with each other ?
Normally for a device which requires reading and writng you would create
a driver providing an API to clients, which would serialise access to
the device.
However if it is only reading the value of sensors, it is probably
easiest to have one program which regular reads the values, and
publishes them for other programs to use.
For example, to get a running average of the CPU temperature over a
period of 15 minutes, I wrote a python program which runs as a daemon at
start up, reading the CPU temperature every second calculating the
running average, min and max values. The values are read by running
another instance of the program which communicates with the daemon
instance via a named pipe.
---druck
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|