Category
Other
Hardware
Linux Native
Is this bug report about any UI component firmware like InkHUD or Meshtatic UI (MUI)?
Firmware Version
2.7.17
Description
On Linux native builds (meshtasticd), the TSL2591 ambient light sensor is incorrectly detected as a TSL2561 when scanning I²C address 0x29. This results in the wrong driver being initialized and causes reported lux values to remain at 0.
The detection logic can be fixed by reading the TSL2591 ID register using the required command bit, allowing reliable differentiation between TSL2591 and TSL2561 devices.
Both TSL2591 and TSL2561 can respond at I²C address 0x29.
The current scan logic attempts to distinguish them by reading register 0x12:
getRegisterValue(RegisterLocation(addr, 0x12), 1);
Fix
Update the scanner to read the ID register using the proper command-bit address:
getRegisterValue(RegisterLocation(addr, 0xA0 | 0x12), 1);
This matches the addressing used by the Adafruit TSL2591 driver and allows correct identification (ID == 0x50) of TSL2591 devices.
Ive tested this fix on Femtofox and it properly detects and displays lux.
src\detect\ScanI2CTwoWire.cpp Line 490
Relevant log output
Category
Other
Hardware
Linux Native
Is this bug report about any UI component firmware like InkHUD or Meshtatic UI (MUI)?
Firmware Version
2.7.17
Description
On Linux native builds (meshtasticd), the TSL2591 ambient light sensor is incorrectly detected as a TSL2561 when scanning I²C address 0x29. This results in the wrong driver being initialized and causes reported lux values to remain at 0.
The detection logic can be fixed by reading the TSL2591 ID register using the required command bit, allowing reliable differentiation between TSL2591 and TSL2561 devices.
Both TSL2591 and TSL2561 can respond at I²C address 0x29.
The current scan logic attempts to distinguish them by reading register 0x12:
getRegisterValue(RegisterLocation(addr, 0x12), 1);Fix
Update the scanner to read the ID register using the proper command-bit address:
getRegisterValue(RegisterLocation(addr, 0xA0 | 0x12), 1);This matches the addressing used by the Adafruit TSL2591 driver and allows correct identification (ID == 0x50) of TSL2591 devices.
Ive tested this fix on Femtofox and it properly detects and displays lux.
src\detect\ScanI2CTwoWire.cpp Line 490
Relevant log output