I would use remotely a I2C expansion (IO PCF8574) connected to a RPI 192.168.0.10 from a different RPI 192.168.0.11 like the remote GPIO. I followed the instructions from http://abyz.me.uk/rpi/pigpio/index.html but I'm a newbie and I can't see anything related to "networked" i2c but only local. I'm Using Python3 on Raspberry Buster Can someone help me with this solution or proposing different ones? Thanks in advance for any help Abartolo
Asked
Active
Viewed 311 times
0
-
You'll need to split that up: You need to write an application that controls the expansion chip on the Pi itself and then offers the ability to control this remotely. Do one step at a time. – PMF May 08 '20 at 12:50
-
Thanks a lot, I'll try – Abartolo May 08 '20 at 13:38
-
@PMF why one needs a user space application for the chip which has a well established driver in the kernel? https://elixir.bootlin.com/linux/v5.7-rc4/source/drivers/gpio/gpio-pcf857x.c – 0andriy May 10 '20 at 19:59
-
You need to enable the driver for this GPIO expander in the kernel and use its GPIOs via `libgpiod`. Simple forget about very custom and awful RPi approach... – 0andriy May 10 '20 at 20:01
-
@0andriy: I didn't know there was a kernel driver for this chip. Anyway, that wouldn't solve the networking issue, and it still requires talking to the driver from some application. – PMF May 10 '20 at 20:04
-
@PMF, true. But it will reduce a burden on the developer :-) – 0andriy May 10 '20 at 20:42
-
What about implementing the first part in python using pigpio and leave the communication to MQTT (mosquitto)? :-) Could this be a good proposal for networking or is it there something more appropriate? Thanks Abartolo – Abartolo May 11 '20 at 06:53
-
It will depend on **how** you plan to use the I2C, so how many devices are there on the remote end, how often do you need to read them, how much data they produce per read and whether much logic is required at that end or whether it is simply a case of reading a few bytes from a couple of devices once a second and sharing the values. Then it also depends how you plan to use the values at the local end. Do you need to know the order in which things change or just the latest readings... and so on. – Mark Setchell May 11 '20 at 10:33
-
(when you answer to somebody, put `@user` in your message to notify them) I'm not sure custom Pi GPIO library is anyhow better the official `libgpiod`. I recommend to use latter. – 0andriy May 11 '20 at 20:42