kasbert / epsolar-tracer

Tools for EPsolar Tracer BN solar charge controller
Apache License 2.0
121 stars 76 forks source link

Why do you have to reinstall these drivers after each reboot??? #26

Closed pmitham closed 1 year ago

pmitham commented 6 years ago

I've gone through the install per the readme.txt file but when I re boot the pi I have to re run the make and insmod commands each time in order for the pi to see theses USB devices. There must be a step missing in the instructions!! help!

jhulstedt commented 6 years ago

What I had to do to get over this problem. I used these commands on my raspberry pi. from https://www.computerhope.com/unix/modprobe.htm#examples

Watchout for the ` grave accent marks around theuname -r` command! Can't display it correctly here because that is also the code delimiter on this website. You will have to know where your "xr_usb_serial_common.ko" file is: Mine was, ~/projects/epsolar-tracer/xr_usb_serial_common-1a/xr_usb_serial_common.ko

Then you will use the module name which should be "xr_usb_serial_common" in the modprobe command. Do not use "xr_usb_serial_common.ko"!

This made my /dev/ttyXRUSB0 persistent across the boots and sessions.

I also edited /etc/modules file adding to the last line of that file "xr_usb_serial_common". Not sure if I have to do that or not. The "modprobe" command may have added that? But if not add it so that the module gets loaded at boot.

jimlynnjulian commented 5 years ago

I wrote and installed a service file to do everything and made sure the service runs before any other Epever related services.

jimlynnjulian commented 5 years ago

[Unit] Description=Epever Exar driver install Service After=multi-user.target hwclock.service

[Service] Type=oneshot ExecStart=/bin/bash /home/pi/epdriver.sh

[Install] WantedBy=multi-user.target

jimlynnjulian commented 5 years ago

Run this after writing the bash script that follows, "epdriver.sh" Both the bash script and the driver module are in /home/pi The service is in /lib/systemd/system

sudo systemctl enable epdriver.service sudo systemctl start epdriver.service

jimlynnjulian commented 5 years ago

!/bin/bash

sudo rmmod cdc-acm sudo modprobe -r cdc-acm sudo insmod /home/pi/xr_usb_serial_common.ko

kasbert commented 1 year ago

Closing as stale