Skip to content
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

fix: load i2c-dev modules #217

Merged
merged 1 commit into from
Apr 12, 2023
Merged

Conversation

ashthespy
Copy link
Contributor

@ashthespy ashthespy commented Apr 6, 2023

This PR adds to #196 with the required bits to enable i2c by default.

Fixes: #216

You might also just want to use raspi-config's undocumented noint mode directly from the chroot script?
And then use some sed magic to add the comments from #196 to config.txt.

@KwadFan
Copy link
Member

KwadFan commented Apr 8, 2023

Hey @ashthespy ,

First of all thank you for your contribution!
Unfortunatly, your patch does not work as intended. The build test failed.
Bildschirmfoto_2023-04-08_13-14-04

Please create this file using the unpack function. If you are interessted in doing it via raspi-config nonint I would prefer that method.

As soon the build is successful and we tested the resulting image, we will merge your fix and asap release a new version.

Regards Kwad

@KwadFan KwadFan self-assigned this Apr 8, 2023
@KwadFan KwadFan self-requested a review April 8, 2023 11:52
@KwadFan KwadFan added the bug Something isn't working label Apr 8, 2023
@ashthespy
Copy link
Contributor Author

Have switched to raspi-config nonint, which should be more future/backwards friendly.
It may just need a sudo, will know after the CI runs :-)

@KwadFan
Copy link
Member

KwadFan commented Apr 10, 2023

So, build was successful but didnt work for me.
image

I had to activate it in raspi-config to get it work.

@ashthespy
Copy link
Contributor Author

Will have a look, need to set up a build environment first..

@KwadFan
Copy link
Member

KwadFan commented Apr 10, 2023

Will have a look, need to set up a build environment first..

This is quite simple. Enable actions in your develop repo, then it should build an Image for debugging in your PR Branch, if it fails to start automaticly, you could force it to run via workflow_dispatch

@ashthespy
Copy link
Contributor Author

ashthespy commented Apr 10, 2023

Yeah, looks like using raspi-config won't work, will got back to enabling the module directly.

Enabling i2c-dev
+ echo -e -n '\e[0m'
+ raspi-config nonint do_i2c 0
mount: /config/device-tree: mount point does not exist.
* Failed to mount configfs - 2
modprobe: FATAL: Module i2c-dev not found in directory /lib/modules/5.15.0-1035-azure

@ashthespy
Copy link
Contributor Author

That should now work.

pi@mainsailos:~ $ cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

i2c-dev
bcm2835-v4l2

pi@mainsailos:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Sorry for the multiple attempts, it took a while to get up to speed with the workflow here :-)

Not sure how you feel, but it might be smart to include i2c-tools as part of the default packages?

@KwadFan
Copy link
Member

KwadFan commented Apr 10, 2023

Good point, would you mind to extend your PR?

This PR adds to mainsail-crew#196 with the required bits to enable i2c by default.
 - enable `i2c-dev` module
 - install `i2c-tools` package

Signed-off-by: ashthespy <ashthespy@users.noreply.github.com>
@ashthespy
Copy link
Contributor Author

Done 👍

@KwadFan
Copy link
Member

KwadFan commented Apr 12, 2023

A test of @meteyou went very well, so, will test that also, but think we can merge it soon.

@KwadFan
Copy link
Member

KwadFan commented Apr 12, 2023

My test went also well, so LGTM!

Copy link
Member

@KwadFan KwadFan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@KwadFan KwadFan merged commit 6846f82 into mainsail-crew:develop Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raspberry Pi | i2c only partially enabled by default
2 participants