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