XRUSB raspberry pi

812 views Asked by At

I'm working with a raspberry pi connected with xrusb to a controller using python.I use make file to Compile and install the common usb serial driver module and it works fine. After reboot i have problem. The driver is lost. I have to install the module again using this

modprobe usbserial
insmod ./xr_usb_serial_common.ko

Any idea?

2

There are 2 answers

0
Torxed On BEST ANSWER

Now my answer might be off because of the way you say "install the driver". I bet the make script most likely just loaded the driver just like you did via modprobe.

In order to get the module to be loaded at boot time, you need to tell udev what to load/do during bootup. And tell the kernel to load your driver.. Otherwise it assumes you don't want it to be loaded at boot time.

Either you can do a automatic module handling via:

#nano /etc/modules-load.d/usbserial.conf
usbserial

or, you can specify options:

#nano /etc/modprobe.d/usbserial.conf
options usbserial parameter_name=parameter_value

Here's some documentation on how this works:

(Even if you're not running Arch on your RPi, they still have one of the best documentation websites for Linux out there. User friendly, in depth etc. So apply the information there to your Distribution, they should be very much the same this day and age)

0
Billy Moukas On

I found maybe a temporary solution so i can finish my project and look for the best way later. I make a script to run after reboot to load the driver.

use:

sudo crontab -e

then go to the bottom and write

@reboot bash /your/path/script/script.sh

`