for some project I need 5 sensors. Their I2C address is fixed and can be changed to another fixed value by soldering. So without an I2C multiplexer (which I don't have), I need at least 3 I2C busses.
Hence, I added two additional I2C busses to my Raspberry Pi 3B by adding the following lines to
# open another i2c bus on GPIO 20 (SDA4) and GPIO 21 (SCL4) dtoverlay=i2c-gpio,bus=4,i2c_gpio_delay_us=1,i2c_gpio_sda=20,i2c_gpio_scl=21 # open another i2c bus on GPIO 20 (SDA3) and GPIO 21 (SCL3) dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=19,i2c_gpio_scl=26
On the breadboard, this works just fine and I receive the data reliably (using an adapted version of these instructions). Now I want to distribute the sensors at quite some distance from the Raspberry Pi using some 50m of data cable. I know that I2C isn't made for this and, in fact, it doesn't work out of the box. Using the built-in I2C bus (bus 1), I immediately get an IOError if I try to read the sensor over the data cable. However, if I alter the baud rate from the standard 100 kHz to 10 kHz by adding
/boot/config.txt, everything works fine.
My question is: How can I alter the baud rate of the additional I2C busses? Is this possible at all? I tried
i2c_gpio_baudrate without success and couldn't find any reference on how to do that.
Thank you very much!