Skip to content

[Bug]: TSL2591 mis-detection as TSL2561 on I²C address 0x29 #9124

Description

@jamesjsm

Category

Other

Hardware

Linux Native

Is this bug report about any UI component firmware like InkHUD or Meshtatic UI (MUI)?

  • Meshtastic UI aka MUI colorTFT
  • InkHUD ePaper
  • OLED slide UI on any display

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.

Image

src\detect\ScanI2CTwoWire.cpp Line 490

Image

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions