15. Frequently Asked Questions (FAQ)
15.1 What I2C address is used by Witty Pi 4? Can I change it?
Witty Pi 4 implements its own I2C master to communicate with realtime clock and temperature
sensor, and only exposes one I2C slave device to Raspberry Pi, which has an I
2
C address: 0x08.
This address is configurable and you can change it if you want.
If you have Witty Pi 4 connected to Raspberry Pi and run “i2cdetect –y 1” command in the console,
you will see this:
If you want to change the I
2
C address used by Witty Pi 4, you can change the value of I
2
C register at
position #16. For example, if you want to change the I
2
C address to 0x35, you can run:
After that you also need to modify the “utilities.sh” file (in wittyPi directory). Find the
I2C_MC_ADDRESS variable and change its value from 0x08 to 0x35.
In order to access Witty Pi 4 in UWI, you also need to modify the “uwi/wittypi4/api.sh” file. Find “if
[ "$value" == "08" ]; then” and replace the “08” to “35”.
The final step is to shut down your Raspberry Pi, fully disconnect the power supply of your Witty Pi 4,
and then reconnect the power supply. Then the MCU will start working with new address.
pi@raspberrypi:~ $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- 08 -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi:~ $ i2cset -y 1 8 16 0x35