-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various issues with lightsensor.service using TSL2561 #515
Comments
This bug is both to report the issue as well as to document the work I am doing to address it. |
I would like to add that the automatic brightness is not working at all with the sensor. On previous release (I don't remember which one, but it was a very old one like 2019) was working good. P.s.: As the author of this issue mentioned, randomly on startup the light sensor is not detected (the lux is not even display on the main screen.) The only way to make it work again is to re-pair up crankshaft with my mobile with WiFi (using client mode). |
@techdev5521 I suspect the brightness issue is due to Line 691 and Line 697 as they are erroring as per your issue report I suspect it got broken when i added the TSL2591 support TSL2591 support |
I agree @matt2005 -- my plan is to debug the service script by stopping the service and running the script as a standalone file to see where exactly issues are. I am confident I can resolve the issues with the TSL2561 but I do not have a TSL2591 and may need your help ensuring I don't broke that if you have one. I'll see what i can do later today. |
My TSL2591 isn't adjusting brightness. I have the same log errors as @techdev5521 |
I found the issue in the Python script that handles light sensor values but I'm currently traveling without my hardware or stable Internet. I should be back to both next week and can do some testing / post updates. |
@techdev5521 have you been able to fix the script? |
@matt2005 Yes -- I've resolved this issue. I'll try to make a PR this weekend. |
@techdev5521 any update on the pr for the fix? |
Yes! I’m back from Colombia finally and can get that in this week.
Cheers,
Justin
… On Apr 9, 2022, at 5:12 PM, Matthew Hilton ***@***.***> wrote:
@techdev5521 <https://github.com/techdev5521> any update on the pr for the fix?
—
Reply to this email directly, view it on GitHub <#515 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACEYZKDGCNQWJAE5QLY4OXTVEHXCZANCNFSM5IUEPFQQ>.
You are receiving this because you were mentioned.
|
Any joy with the pr? |
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 60 days. |
Hey -- sorry for dropping off the planet. I'll make time to work on this this week and submit work. The fix is fairly simple. |
@techdev5521 just wanted to see if you've had a chance to implement a fix. |
@techdev5521 just wanted to see if there was any movement on this? Don't mean to be a hassle and wish you the best, but I would love this simple fix to be implemented if you have the time. |
With the holidays here I think I’ll have time in the next couple of days to pull my work on this back up.
… On Dec 20, 2022, at 5:46 PM, MikeDotNetty ***@***.***> wrote:
@techdev5521 <https://github.com/techdev5521> just wanted to see if there was any movement on this? Don't mean to be a hassle and wish you the best, but I would love this simple fix to be implemented if you have the time.
—
Reply to this email directly, view it on GitHub <#515 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACEYZKHU2ZSGAG5PRHUU2VTWOIZMXANCNFSM5IUEPFQQ>.
You are receiving this because you were mentioned.
|
@techdev5521 Thanks, best of luck and happy holidays! |
@techdev5521 just wondering if you had a chance over the last few days to look into this? |
Hey all. Sitting down now with my dev kit to submit a fix for this. |
Hi, I have been struggling with this issue as well but I managed to make a workaround and I'm close to finding the source of the problem, I think. In short, the I am using sensor TSL25911 (which afaik is almost identical to TSL2591 but produced by Waveshare and has hardware more suitable for my application). My findings lead my to believe the error most likely originates in service_lightsensor.py:10.
>>> import subprocess
>>> CMD = 'echo $(source ./crankshaft_env.sh; echo $%s)' % 'DISP_BRIGHTNESS_1'
>>> p = subprocess.Popen(CMD, stdout=subprocess.PIPE, shell=True, executable='/bin/bash')
>>> print(p.stdout.readlines()[0].strip())
b'30' Running >>> import subprocess
>>> CMD = 'echo $(source ./crankshaft_env.sh; echo $%s)' % 'DISP_BRIGHTNESS_1'
>>> p = subprocess.Popen(CMD, stdout=subprocess.PIPE, shell=True, executable='/bin/bash')
>>> print(int(p.stdout.readlines()[0].strip()))
30
>>> This is why there are no errors for example on line 107 Changing lines 109, 113, 117, 121, 125 and 129 to Edit: Changed the example to use the same value, however values such as 'LUX_LEVEL_1' are also returned incorrectly (eg |
@myfrom just wondering if you've had any luck with this? |
I got stuck because my car went to a mechanic and with it the lightsensor setup 🫤 I'm expecting to get it back today or Monday and will work on that as soon as that happens. If you have a running setup and would be willing to test it before that time I can send more info |
@myfrom sorry to hear that...trips to the mechanic are never fun. I do have crankshaft setup in my car on my raspberry pi 3b+, and I have the TSL25911 sensor... I'd be more than happy to test for you. Just let me know. Thanks! |
Awesome! I'm really grateful for the help You would need to replace /opt/crankshaft/service_lightsensor.py on the Raspberry to this modified file from my fork (you can download with Save as). You can do it via ssh, once you connect you need to run Here's diff between og and my file and here's original file in case you need to roll back. If it doesn't solve the issue, please try to ssh and run |
Thanks! I'll do that this weekend and report my results. Much appreciated! |
Update: I got my car back (yay) and tested the changes right away. In my testing, they do work and lightsensor.service changes screen brightness as expected. PR opened. (Btw, @MikeDotNetty if you still want to carry on your own tests, I highly recommend editing the file with nano, trying to move the file is more elaborate than I thought, running into permission and chmod issues) |
That's great news! I'll certainly try it this weekend. And yes I go the nano way and report back. Thanks again! |
@myfrom While I was not able to get your modified code to work. I think it might be due to the fact that my TSL25911 is really a "TSL25911FN". I have attached the error. This error is NOT related to your updated code, but rather it's failing on obtaining the LUX value to work with. REGARDLESS, you set me on the right path, and I was able to update this service_lightsensor.py file specific to my sensor, such that it IS WORKING now. So thanks for that! Here's the error in case you are interested:
|
@myfrom actually, now that I think about it ..without your fix, my fix most likely would not have worked, so thanks for that! |
Glad I could help and thanks for trying it out 😉 |
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 60 days. |
This issue was closed because it has been stalled for 60 days with no activity. |
@MikeDotNetty @myfrom Would either of you mind giving instructions on how to get this working? I understand the changes that need to be made but I'm a Linux newb and I don't know how to actually do it. |
@MikeDotNetty @myfrom I figured out how to SSH and use nano to change the file. However, I noticed that the home screen doesn't display the lux value anymore in the upper left corner and the brightness still doesn't seem to be adjusting automatically. Edit: after rebooting a few times, now it shows initial lux value on startup but then it never updates after that. The GUI's brightness does actually change depending on this initial lux value. I have a TSL2591. Edit 2: after a few more reboots, it stopped showing any lux value again and isn't adjusting the GUI's brightness. |
I'd check the wiring and sensor first. It sounds like that might be the issue with what you're describing |
@CoordinatedEffort I have these issues mapped out with details, files, causes and whatnot but I've not the time to transfer my paper notes to a proper comment. Would you be interested in a voice/video chat sometime to go over that info? |
@techdev5521 I'm definitely not opposed to having a chat and I'm very grateful for the offer of your time, but my technical expertise is basically non-existent. I'd really only be able to follow detailed instructions (as you might be able to tell from my earlier comments) so I'm not sure that I'd have much to offer in a discussion. Is it that you have a possible solution that you'd like me to try? |
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.
-->
-->
-->
-->
-->
CS HW-->
Lightsensor = tsl2561-->
TSL2561-->
Check 'Show Lux value....'Please provide any further information that you might find helpful if available.
Issues include :
Debug Info
debug.zip
The text was updated successfully, but these errors were encountered: