My setup: Raspberry Pi 3B+, 2 BigRelays connected to it over different I2C busses (1hw, 1sw).
I had hoped to daisy-chain the two boards over the hardware I2C pins, though as the boards have the same address I had to set up an additional I2C software bus + solder two 2K resistors to pull the lines high.
Long story short, my problem is that some commands sent to one bus (e.g. /dev/i2c-1) toggle a relay on the second bus (/dev/i2c-3).
/boot/config.txt relevant part looks like this:
dtparam=i2c_arm=on # Add additional bus for I2C as BigRelays have the same address and # do not work through the same bus. dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=2,i2c_gpio_scl=3
Last time I've seen this was by doing this:
# Turn on rPI # Note, the `bw_tool` software is provided by the BigRelay author. # I've tried my own implementation through Node.js and `i2c-bus` with similar results. # turn on first relay of SW bus. > bw_tool -I -D /dev/i2c-3 -s 50000 -a 9c -W 20:1:b # turn off first relay of SW bus > bw_tool -I -D /dev/i2c-3 -s 50000 -a 9c -W 20:0:b # turn on relay on hw I2C bus board > bw_tool -I -D /dev/i2c-1 -s 50000 -a 9c -W 20:1:b # turn off hardware relay > bw_tool -I -D /dev/i2c-1 -s 50000 -a 9c -W 20:1:b #
And BOOM - the software Relay (on
i2c-3) is turned on, as if I'd run the (2) marked command.
Some other info:
- At first I've had the I2C implementation done through a Node.js library, but as I was getting strange results, I've tried the bw_tool. Got a bit more reliable results though still another bus is affected when targeting one.
- Some commands turn other board's relays as expected. Sometimes I have to repeat a "-W 23:0:b" command 4 times for it to turn off the relay. Though sometimes I do hear relays clicking, which probably means that another board is getting the commands.
- I've tried using the HW I2C pins in software mode, same results.
Maybe someone had similar issues and has solved them?