How to unload drivers on openhabian startup

Hi All
I am embarking on setting up openHAB to run a basic irrigation system. I have an old Raspberry Pi 2B and a Denkovi USB 8 channel relay board. I have OpenHAB 2 running on the RPi and can see this is going to be a long journey for a beginner - however we’ll get there.

The relay board will not natively integrate to OpenHAB but has a command line tool which I intend to use with the exec binding - more pain (and questions) to come there later.

The tool requires the commands "rmmod ftdi_sio" and "rmmod usbserial" be run as sudo to unload the respective drivers, which i presume cause problems with using the board on any linux system.

I cannot work out how to have openhabian do this automatically on every start up - though I presume (and hope!) it is simple??? It seems the blacklist file was the way to do this but has since been removed from raspbian - which I understand openhabian is based on?

Any help on how to do this would be greatly appreciated.

openHABian is standard Raspbian, so you can apply all common means of configuration such as systemd service framework or /etc/modules
There’s also config capabilities to unload modules (or rather to not load them).
There’s a manpage for modules-load.d. Or best to g**gle for that.

Then again, these drivers are not loaded on my system so you probably did something yourself to install them ?

[09:40:52] root@openhabianpi:/etc/modules-load.d# lsmod|egrep -i 'ftdi|usbserial'
[09:40:57] root@openhabianpi:/etc/modules-load.d#

Rather than unload the modules every time just uninstall if not needed.

1 Like