User avatar
Hurky
Posts: 2
Joined: Mon Jun 18, 2018 11:04 am
Location: Spain

Help installing a new kernel module.

Mon Jun 18, 2018 11:24 am

Hi there, I have a pi 2 B with a Maxim MAX1668 temperature sensor chip attached to the i2c interface. That chip is correctly detected by lm-sensors but I am not able to load the kernel module as it doesn't seem to be available per default:

Code: Select all

[email protected]:~# cat /etc/debian_version 
9.4
[email protected]:~# uname -a
Linux raspberrypi 4.14.34+ #1110 Mon Apr 16 14:51:42 BST 2018 armv6l GNU/Linux

Code: Select all

[email protected]:~# sensors-detect
# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)
# Kernel: 4.14.34+ armv6l
# Processor: ARMv6-compatible processor rev 7 (v6l) (//)
...
Next adapter: bcm2835 I2C adapter (i2c-1)
Do you want to scan it? (YES/no/selectively): 
Client found at address 0x19
...
Probing for `Maxim MAX1668'...                              Success!
    (confidence 7, driver `max1668')
...
Driver `max1668':
  * Bus `bcm2835 I2C adapter'
    Busdriver `i2c_bcm2835', I2C address 0x19
    Chip `Maxim MAX1668' (confidence: 7)

Code: Select all

[email protected]:~# modprobe max1668
modprobe: FATAL: Module max1668 not found in directory /lib/modules/4.14.34+

[email protected]:~# ls /lib/modules/4.14.34+/kernel/drivers/hwmon/
ads1015.ko  ds1621.ko  hwmon.ko  ina2xx.ko  jc42.ko  lm75.ko  sht21.ko	sht3x.ko  shtc1.ko  tmp102.ko
On my CentOS 7 host system I have this module available in /usr/lib/modules/3.10.0-862.3.2.el7.x86_64/kernel/drivers/hwmon/max1668.ko.xz So I suppose that I would need to compile or install that missing module.


Does anyone have experience installing missing / custom kernel modules on this OS ?

Thanks for reading !

User avatar
The Traveler
Posts: 361
Joined: Sat Oct 21, 2017 3:48 pm

Re: Help installing a new kernel module.

Mon Jun 18, 2018 2:46 pm

In general you'll need the ARM compiler tool chain for your model.
Are you cross compiling? Windows -> RPi or Linux (Ubuntu, etc) -> RPi?
If from Windows, you can download the toolchain here: http://gnutoolchains.com/raspberry/
If from Linux, this article has very useful info: https://hackaday.com/2016/02/03/code-cr ... pberry-pi/
If your building directly on the RPi, the hackaday article still applies for installing the compiler/linker.
You many have to make some adjustments for your RPi model but this should get you into the ballpark.

Cheers.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

User avatar
DougieLawson
Posts: 33785
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Help installing a new kernel module.

Mon Jun 18, 2018 2:57 pm

Pull the kernel source that matches your Raspbian kernel with the rpi-source helper script from https://github.com/notro/rpi-source.

Get the current config with
sudo modprobe configs
zcat /proc/config.gz > .config


Change that .config so that CONFIG_SENSORS_MAX1668=m is set.

Make oldconfig, build it, install it, boot it.

Then create an issue at https://github.com/raspberrypi/linux to ask the RPF/RP(T)Ltd. folks to build it into their standard kernel.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

User avatar
Hurky
Posts: 2
Joined: Mon Jun 18, 2018 11:04 am
Location: Spain

Re: Help installing a new kernel module.

Wed Sep 19, 2018 8:24 pm

Sorry for the very late reply, thank both of you for your answers.

I am trying to compile on the rpi itself.

I had no success with the modprobe config as those files do not exist on my system, it is a OSMC and not a direct raspbian:

Code: Select all

[email protected]:~ # dpkg -l | grep `uname -r` 
ii  rbp1-image-4.14.34-6-osmc   6   armhf   Linux kernel binary image for version 4.14.34-6-osmc
ii  rbp1-source-4.14.34-6-osmc 

[email protected]:~ # modprobe configs
modprobe: FATAL: Module configs not found in directory /lib/modules/4.14.34-6-osmc

[email protected]:~ # ls /lib/modules/4.14.34-6-osmc
kernel	modules.alias  modules.alias.bin  modules.builtin  modules.builtin.bin	modules.dep  modules.dep.bin  modules.devname  modules.order  modules.softdep  modules.symbols	modules.symbols.bin

Code: Select all

[email protected]:/lib/modules/4.14.34-6-osmc # zcat /proc/config.gz
gzip: /proc/config.gz: No such file or directory

[email protected]:~ # ls /proc/con*
/proc/consoles
Regards.

fruitoftheloom
Posts: 17434
Joined: Tue Mar 25, 2014 12:40 pm

Re: Help installing a new kernel module.

Thu Sep 20, 2018 2:37 am

Hurky wrote:
Wed Sep 19, 2018 8:24 pm
Sorry for the very late reply, thank both of you for your answers.

I am trying to compile on the rpi itself.

I had no success with the modprobe config as those files do not exist on my system, it is a OSMC and not a direct raspbian:

Code: Select all

[email protected]:~ # dpkg -l | grep `uname -r` 
ii  rbp1-image-4.14.34-6-osmc   6   armhf   Linux kernel binary image for version 4.14.34-6-osmc
ii  rbp1-source-4.14.34-6-osmc 

[email protected]:~ # modprobe configs
modprobe: FATAL: Module configs not found in directory /lib/modules/4.14.34-6-osmc

[email protected]:~ # ls /lib/modules/4.14.34-6-osmc
kernel	modules.alias  modules.alias.bin  modules.builtin  modules.builtin.bin	modules.dep  modules.dep.bin  modules.devname  modules.order  modules.softdep  modules.symbols	modules.symbols.bin

Code: Select all

[email protected]:/lib/modules/4.14.34-6-osmc # zcat /proc/config.gz
gzip: /proc/config.gz: No such file or directory

[email protected]:~ # ls /proc/con*
/proc/consoles
Regards.

OSMC is based of Debian Stretch, not Raspbian Stretch !
Adieu

Return to “Raspbian”

Who is online

Users browsing this forum: No registered users and 18 guests