forked from kassl-2007/dbus-epever-tracer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
48 lines (35 loc) · 1.54 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
read -p "Install Epever Solarcharger on Venus OS at your own risk? [Y to proceed]" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Download and install pip3 and minimalmodbus"
opkg update
opkg install python3-pip
pip3 install -U minimalmodbus
echo "Download driver and library"
cd /data
wget https://github.com/peterxxl/dbus-epever-tracer/archive/master.zip
unzip master.zip
rm master.zip
wget https://github.com/victronenergy/velib_python/archive/master.zip
unzip master.zip
rm master.zip
mkdir -p dbus-epever-tracer/ext/velib_python
cp -R dbus-epever-tracer-master/* dbus-epever-tracer
cp -R velib_python-master/* dbus-epever-tracer/ext/velib_python
rm -r velib_python-master
rm -r dbus-epever-tracer-master
echo "Add entries to serial-starter"
cd ..
sed -i '/service.*imt.*dbus-imt-si-rs485tc/a service epever dbus-epever-tracer' /etc/venus/serial-starter.conf
sed -i '$aACTION=="add", ENV{ID_BUS}=="usb", ENV{ID_MODEL}=="USB_Serial", ENV{VE_SERVICE}="epever"' /etc/udev/rules.d/serial-starter.rules
echo "Install driver"
chmod +x /data/dbus-epever-tracer/driver/start-dbus-epever-tracer.sh
chmod +x /data/dbus-epever-tracer/driver/dbus-epever-tracer.py
chmod +x /data/dbus-epever-tracer/service/run
chmod +x /data/dbus-epever-tracer/service/log/run
ln -s /data/dbus-epever-tracer/driver /opt/victronenergy/dbus-epever-tracer
ln -s /data/dbus-epever-tracer/service /opt/victronenergy/service-templates/dbus-epever-tracer
echo "To finish, reboot the Venus OS device"
fi