Change the I2C address of a Kmeter Unit



  • Hi.
    I need to connect 25 Kmeter Unit to one M5stack.
    Is there a simple way to change the I2C address of the unit ?

    Thanks.



  • Hello @meirmark

    from what I can tell the I2C slave address is defined within the internal Kmeter Unit firmware running on the internal ESP32C3. So changing the I2C slave address means creating a new firmware.

    One way would be to compile 24 different versions of the internal firmware (with 24 different I2C slave addresses) and then flash / update 24 Kmeter Units. (Leaving one Kmeter Unit with the original I2C slave address.)

    As an alternative you could modify the internal firmware and add an additional I2C command which would allow to modify the I2C slave address. You still would need to flash all your Kmeter Units (but at least all with the same firmware). Then, using this new I2C command, you'd need to modify the I2C slave address of at least 24 Kmeter Units.

    Thanks
    Felix



  • @meirmark said in Change the I2C address of a Kmeter Unit:

    Hi.
    I need to connect 25 Kmeter Unit to one M5stack.
    Is there a simple way to change the I2C address of the unit ?

    Thanks.

    You could try using multiple I2C hubs



  • Thanks.
    Do you know if the firmware source is available ?

    Meir.



  • Problem solved.
    To change the I2C address of a Kmeter one need to write to register 0x08 the new address (one byte) and to register 0x09 the same address but with the bits converted (1 is 0 , 0 is 1).
    After writing cycle the power.
    Thanks to M5 technical help team.



  • Hello @meirmark

    good to know. Thanks for sharing and sorry I missed that in my previous answer.

    Thanks
    Felix