the Grove Base HAT for Raspberry Pi v1.0 07/23/2018 can be found at 0x08
whereas
the Grove Base HAT for Raspberry Pi v1.1 04/06/2022 can be found at 0x04
As a workaround it can be overwritten in user_config: add
device.adc_0.config.i2c_address = 0x04
to the end of user_config.toml
How can we handle the incompatible hardware automatically? Must the user check the vnumber on the pcb and add this line if necessary? Could the code call i2cdetect on the fly and parse the output, selecting the ADC as required? By extention, if this works to autoselect different grove HATs, why not autoselect BC Robotics as well?
According to
sudo i2cdetect -y -a 1 0x03 0x77
,the Grove Base HAT for Raspberry Pi v1.0 07/23/2018 can be found at
0x08
whereas the Grove Base HAT for Raspberry Pi v1.1 04/06/2022 can be found at0x04
This address is baked into our core code: https://github.com/DigitalShoestringSolutions/PowerMonitoring/blob/f1f96bd940d401e32c35603c831148bc7ae105d4/current_sensing/code/core/device_modules/adc_grove.py#L12 This i2c_address is not usually overwritten in stock configurations.
As a workaround it can be overwritten in user_config: add
to the end of
user_config.toml
How can we handle the incompatible hardware automatically? Must the user check the vnumber on the pcb and add this line if necessary? Could the code call i2cdetect on the fly and parse the output, selecting the ADC as required? By extention, if this works to autoselect different grove HATs, why not autoselect BC Robotics as well?