Qwiic_relay.py does not support the CHANGE_ADDRESS command

The CHANGE_ADDRESS command is supported for Arduino but is missing in the python package, which is the one I need for controlling several qwiic dual solid state relays using a Raspberry Pi. I see that this command is implemented in the ATtiny84 firmware, so I have to believe it should be possible to make it work using Python just as easily as it can for Arduino.

I have searched in the Qwiic System area of Sparkfun Community for any help with this but have not found anything of help.

Possible solutions I have thought about;

  1. Rebuild the ATtiny84 firmware with a new default I2C address and flash it (risks bricking a $60 board if I screw up)
  2. Try to send a CHANGE_ADDRESS command bare metal using pigpio or roll-your-own I2C code (also risks bricking)
  3. Get a qwiic Arduino red board and do it in C. I found an example of this for a qwiic LCD board.
  4. Fgure out if it’s possible to do idea #3 in C natively on the Pi and not have to learn Arduino from square zero

I need to get going quickly on a fix for this dilemma. Thanks for helping.

I think no.2 will be the best approach. , look at the Arduino library or the firmware code to determine the exact bytes sent over I2C.Then use the smbus2 library to change the address.

Hi -

There is a big upgrade of our python drivers brewing (out late March) - it has some dependancies, but this feature was added to our qwiic_relay_py driver. The added method is here, which is on the “feature/change_address” branch.

I don’t know if this will work with the current qwiic_i2c driver - I haven’t tested this - but if not, the logic from this method can easily be copied and used .

-Kirk

1 Like