Change I2C address of 4-channel relay

Hi,

I’m trying to change the I2C address of a 4-channel relay because I want to use two of them, and from factory they both have 0x11. Since there’s no library from Seeed I need to use lunix command. I found this: ./addresschange (i2c address) (new i2c address) but I think I need to find the directory of this command. Any other ideas besides using another bus ?

Thnx!

I think this part:

 Serial.println("Start write address");
  relay.changeI2CAddress(old_address, 0x11);  /* Set I2C address and save to Flash */  
  Serial.println("End write address");

changeI2CAddress(uint8_t old_addr, uint8_t new_addr) change the device address,the old_addr is the current address; the new_addr is the address which you want to use. The new address can be successfully set only by entering the correct old address.

thnx, will this run as Pyton on a Pi ?

No. The example is for Arduino. For Raspberry Pi, you must use this library: GrovePi/grove_spdt_relay.py at master · DexterInd/GrovePi · GitHub

thnx, but I don’t see relay.changeI2CAddress in this lib.

I installed GrovePi:
curl -kL dexterindustries.com/update_grovepi | bash

But now Python can’t find module di_i2c. It should be in the obove repository.

Here you may find some clues: Changing I2C address of Seeed 4 channel relay - #6 by KyleGabriel - Mycodo - Radical DIY Forum

thnx, I already stumbled upon that, but as you can see no solution.

Sad. I hope somebody from the seedstudio admin panel will come forward with a solution. @Citric

This has been more of a headache for us and we have scheduled to verify and resolve this issue, but this product has not been in stock … We need to wait for the product to be in stock before we can move forward to the next step, so sorry for the inconvenience this has caused you.

ok, thnx, I will wait :slight_smile:

Hi Mike,
I managed to do this using the following command :

from smbus2 import SMBus
bus = SMBus(1)
bus.write_byte_data(0x11, 0x11, 0x12)

to change from I2C adress 0x11 to 0x12

Previous example for 4-relay chip I2C address works.

Where is documentation for this feature? There might be multiple protocol versions. One thing is to read firmware version and identify what protocol device should follow. The github repo Multi_Channel_Relay_Arduino_Library is dated 2020 and there might be changes. My PCB has text “4-Channel SPDT Relay v1.0”.

Newest chips might be simplified? In my case
bus.write_byte_data(0x11, 0x10, 0x2) sets relay 2 to ON, as expected. Not found way to ask current status or firmware version. I suppose that firmware is not 1.255.255.

This is an important feature to work on for all seeed-grove products