2

I bought a Silicon Labs si7013/20/21 usb dongle and now I'm trying to install it onto a raspberry pi 1 running raspbian with kernel 3.18 +

I compiled a kernel after adding the drivers to drivers/hwmon added objs to Makefile, and Kconfig in the hwmon directory following the steps in the readme.txt that came with the download & elinux raspberrypi compiling.

When I try to use #modprobe si7034 I get a module does not exist error. Is there a way I can integrate this driver with minimum effort?

I attemted to cross compile the driver after cross compiling the kernel. Modules folder was empty in the directory. Not too sure what to do next.

2
  • At first: I had a quick look into the driver zip that I dwnloaded from the link you provided. This driver expects the Humidity/Temperatur Sensor connected to a linux box via I2C bus. You bought an USB Dongle connected to the USB bus. Perhaps you will also need a driver for your dongle. Second: The compiling guide you followed is out of date. Here is a link to the new version: raspberrypi.org/documentation/linux/kernel/building.md May 29, 2015 at 9:42
  • Also followed that guide to compile, new kernel ran fine in both instances. Those were the only drivers I could find on the site aswell. Well either way I'll give the bounty if you can install the drivers. I just want to be able to modprobe si7034
    – Mikeec3
    May 29, 2015 at 18:05

1 Answer 1

2
+100

I compiled a linux kernel on my RasPi, following the Guide from the Raspberry Dokumentation and the Readme file from the driver sources.

sudo apt-get update
sudo apt-get upgrade
mkdir temp
cd temp
git clone --depth=1 https://github.com/raspberrypi/linux
# bc must be installed
sudo apt-get install bc
wget http://www.silabs.com/Support%20Documents/Software/Si70xx-Linux.zip

unzip Si70xx-Linux.zip

# After unzip Si7034.c starts with a uppcase letter
# I renamed it

mv Si7034.c si7034.c
cp *.c files to linux/drivers/hwmon
cp si7005 linux/Documentation/hwmon
cp si7034 linux/Documentation/hwmon
cp si70xx linux/Documentation/hwmon

cd linux/drivers/hwmon


# remove all occurrences of  __devinit, __devexit and
# __devexit_p(<do not delete this content>) in the *.c file 
# (there are no longer supported by modern kernels >= 3.8).          

# edit the Makefile and Kconfig
# I used vi but nano can be used too ;-)

vi Makefile

# insert the drivers objectfiles between sis5595 and smm665

obj-$(CONFIG_SENSORS_SIS5595)   += sis5595.o

obj-$(CONFIG_SENSORS_SI7005)    += si7005.o
obj-$(CONFIG_SENSORS_SI7034)    += si7034.o
obj-$(CONFIG_SENSORS_SI70XX)    += si70xx.o

obj-$(CONFIG_SENSORS_SMM665)    += smm665.o

# save Makefile and exit vi

vi Kconfig

# search for SENSORS_SIS5595

# add the content of the Kconfig file from the 
# driver zip before the config of SIS5595 

# open file arch/arm/bcmrpi_defconfig
# search for HWMON (its a comment line)
# insert the following lines to it
CONFIG_HWMON=y
CONFIG_SENSORS_SI7005=m
CONFIG_SENSORS_SI70XX=m
CONFIG_SENSORS_SI7034=m

# go back to the linux dir
make bcmrpi_defconfig

# The first execution of make takes about 15h
# After it had completed the 
# next runs (I started many of them ;-) ) took just minutes.
make

sudo make modules_install
sudo cp arch/arm/boot/Image /boot/kernel.img
sudo reboot

Then on my Pi modprobe si7005 worked even if had no sensor hardware connected.

I also tried to cross compile it on my linux box. (Linux Mint 17)

As mentioned in the driver description, the driver is part of the hwmon module. HWMON is not enabled by default if you use the bcmrpi_defconfig-defaults to configure the kernel using:

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcmrpi_defconfig

In your kernel sources there's a config file arch/arm/configs/bcmrpi_defconfig.

Search for HWMON. That line is comment out. Edit the file by adding the following lines:

CONFIG_HWMON=y
CONFIG_SENSORS_SI7005=m
CONFIG_SENSORS_SI70XX=m
CONFIG_SENSORS_SI7034=m

Be sure to paste the drivers Kconfig into the drivers/hwmon/Kconfig and add the object files to drivers/hwmon/Makefile as described in the driver docs. Then restart a build cycle:

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcmrpi_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

Because I had succes with my build on the RasPi, Idid not try the copy the cross compiled kernel to the device.

3
  • I found a solution that worked on my RasPi. I edited the answer. May 31, 2015 at 21:26
  • I did that last time aswell, I added to bcmrpi_defconfig but since I used the config.gz from live kernel I think there were issues. The big part was removing devinit this solution worked perfectly! Thank you so much! Take my bounty sir.
    – Mikeec3
    Jun 1, 2015 at 1:33
  • Thank you. I found a comment of a commit of other driver sources which mentioned why the developer had removed the attributes. permalink.gmane.org/gmane.linux.drivers.acx100/1788 Jun 1, 2015 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.