-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Use TSL2561 and RTC ds1307 using a different bus #514
Comments
This is a wonderfully informative bug report -- thanky you! I'm working on an unrelated TSL2561 issue #515 and from that work I believe I know what is happening here. First I'll explain how things should work then why i think they aren't. How Things Should WorkOn boot, there are two services that run relating to I2C and the light sensor:
The Problemi2ccheck.service calls
Later, lightsensor.service call
crankshaft/stage3/03-crankshaft-base/files/opt/crankshaft/service_lightsensor.py Lines 10 to 20 in cbb8e79
Potential SolutionThe files associated with i2ccheck.service should account for potential custom I2C busses. The implementation method isn't clear to me though. |
The service needs editing to support bus 1 and 2. i2ccheck I can take a look in a few days, but feel free to submit a PR if you get it working |
Hard coding buses 1 and 2 solves this particular problem however if someone were to make a bus on any port greater than 2 then we run into the same issue. It may be more robust to first build a list of the enabled buses then check each of those buses for devices. The list of buses could theoretically be built by listing files in |
That's what I was thinking 👍 |
I'm thinking it would be better to add a var in the crankshaft_env for i2c_rtcbus and fix the script to use that, that way it can hide the dtoverlay setup as it's handled by scripts. |
If you need support: Please post on https://www.reddit.com/r/crankshaft/ as this is a bug tracker, not a support forum.
Note: Reporting issues not based on official published builds will be closed without any comment.
What phone do you have?
Poco F3
What OS version?
Android 11 / Miui 12.5.6 Global
What crankshaft version?
Alpha-7.4 2021-09-22
Steps to reproduce the bug, if you're planning to report a bug. Please indicate whether the bug is always repoducible.
On my RPI I have the RTC ds1307 using the regular pins (vcc, gnd, scl, sda) and using a dtoverlay (dtoverlay=i2c-gpio,bus=2,i2c_gpio_sda=17,i2c_gpio_scl=27) on config.txt, i'm using the TSL2561 connected to the pins as per dtoverlay.
Changed TSL_I2C_BUS to 2 on crankshaft_env.sh but TSL2561 is not recognized.
Please provide any further information that you might find helpful if available.
debug.zip
Thanks for any advice.
The text was updated successfully, but these errors were encountered: