Skip to content

Various issues with lightsensor.service using TSL2561 #515

Description

@techdev5521

What phone do you have?

Google Pixel 5

What OS version? / What crankshaft version?

Alpha 7.4

Steps to reproduce the bug, if you're planning to report a bug. Please indicate whether the bug is always repoducible.

  • Results vary according to unknown factors.
  • Connect TSL2561 to Pi
TSL2561 Pin Pi Pin
VCC --> Pin 1 (3.3v)
GND --> Pin 9 (GND)
SCL --> Pin 5 (SCL)
SDA --> Pin 3 (SDA)
  • Enable light sensor in settings: Settings --> CS HW --> Lightsensor = tsl2561
  • (Optional) Enable Lux output on screen: Settings --> TSL2561 --> Check 'Show Lux value....'
  • Restart

Please provide any further information that you might find helpful if available.

Issues include :

  • Occasional inability to detect TSL2561 device. (This could be my own connection.)
  • Occasional issue with rounding Lux value resulting in non-integer value used for screen brightness:
# Relevant lines from journalctl -u lightsensor.service -b
Nov 23 18:02:35 CRANKSHAFT-NG systemd[1]: Started Crankshaft Lightsensor Service.
Nov 23 18:02:36 CRANKSHAFT-NG service_lightsensor.py[4466]: TSL2561
Nov 23 18:02:36 CRANKSHAFT-NG service_lightsensor.py[4466]: Lux = 4.3 | Level 1 -> trigger night
Nov 23 18:02:36 CRANKSHAFT-NG service_lightsensor.py[4466]: /usr/local/bin/crankshaft: line 691: [: b30: integer expression expected
Nov 23 18:02:36 CRANKSHAFT-NG service_lightsensor.py[4466]: /usr/local/bin/crankshaft: line 697: [: b30: integer expression expected
Nov 23 18:02:36 CRANKSHAFT-NG root[4507]: CSMT-LOGGER: --------------------------------------------------------------------
Nov 23 18:02:36 CRANKSHAFT-NG root[4508]: CSMT-LOGGER: Brightness Level Set To: b30
Nov 23 18:02:36 CRANKSHAFT-NG root[4509]: CSMT-LOGGER: --------------------------------------------------------------------
  • Occasional issue with communicating with TSL2561 at all.
# Relevant lines from journalctl -u lightsensor.service -b
Nov 23 17:35:24 CRANKSHAFT-NG service_lightsensor.py[1542]: TSL2561
Nov 23 17:35:24 CRANKSHAFT-NG service_lightsensor.py[1542]: Traceback (most recent call last):
Nov 23 17:35:24 CRANKSHAFT-NG service_lightsensor.py[1542]:   File "/opt/crankshaft/service_lightsensor.py", line 101, in <module>
Nov 23 17:35:24 CRANKSHAFT-NG service_lightsensor.py[1542]:     Luxrounded = get_LUX(LIGHTSENSOR)
Nov 23 17:35:24 CRANKSHAFT-NG service_lightsensor.py[1542]:   File "/opt/crankshaft/service_lightsensor.py", line 34, in get_LUX
Nov 23 17:35:24 CRANKSHAFT-NG service_lightsensor.py[1542]:     Lux = get_LUX_TSL2561(TSL_I2C_BUS, TSL_ADDR)
Nov 23 17:35:24 CRANKSHAFT-NG service_lightsensor.py[1542]:   File "/opt/crankshaft/service_lightsensor.py", line 46, in get_LUX_TSL2561
Nov 23 17:35:24 CRANKSHAFT-NG service_lightsensor.py[1542]:     i2cBus.write_byte_data(TSL_ADDR, 0x80, 0x03)
Nov 23 17:35:24 CRANKSHAFT-NG service_lightsensor.py[1542]: OSError: [Errno 121] Remote I/O error

Debug Info

debug.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions