Skip to content

Commit

Permalink
isss support
Browse files Browse the repository at this point in the history
  • Loading branch information
snaptec committed Aug 27, 2020
1 parent cf45b83 commit ccf4004
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 6 deletions.
22 changes: 21 additions & 1 deletion loadvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ if [[ $evsecon == "ipevse" ]]; then
echo 0 > /var/www/html/openWB/ramdisk/chargestat
fi
fi

if [[ $evsecon == "extopenwb" ]]; then
evseplugstatelp1=$(mosquitto_sub -C 1 -h $lp1ip -t openWB/lp/1/boolPlugStat)
ladestatuslp1=$(mosquitto_sub -C 1 -h $lp1ip -t openWB/lp/1/boolChargeStat)
echo $evseplugstatelp1 > /var/www/html/openWB/ramdisk/plugstat
echo $ladestatuslp1 > /var/www/html/openWB/ramdisk/chargestat
fi
if [[ $lastmanagement == "1" ]]; then
if [[ $evsecons1 == "modbusevse" ]]; then
evseplugstatelp2=$(sudo python runs/readmodbus.py $evsesources1 $evseids1 1002 1)
Expand Down Expand Up @@ -139,6 +144,12 @@ if [[ $lastmanagement == "1" ]]; then

fi
fi
if [[ $evsecons1 == "extopenwb" ]]; then
evseplugstatelp2=$(mosquitto_sub -C 1 -h $lp2ip -t openWB/lp/1/boolPlugStat)
ladestatuslp2=$(mosquitto_sub -C 1 -h $lp2ip -t openWB/lp/1/boolChargeStat)
echo $evseplugstatelp2 > /var/www/html/openWB/ramdisk/plugstats1
echo $ladestatuslp2 > /var/www/html/openWB/ramdisk/chargestats1
fi
if [[ $evsecons1 == "slaveeth" ]]; then
evseplugstatelp2=$(sudo python runs/readslave.py 1002 1)
ladestatuss1=$(</var/www/html/openWB/ramdisk/ladestatuss1)
Expand Down Expand Up @@ -192,6 +203,13 @@ if [[ $lastmanagements2 == "1" ]]; then
echo 0 > /var/www/html/openWB/ramdisk/chargestatlp3
fi
fi
if [[ $evsecons2 == "extopenwb" ]]; then
evseplugstatelp3=$(mosquitto_sub -C 1 -h $lp3ip -t openWB/lp/1/boolPlugStat)
ladestatuslp3=$(mosquitto_sub -C 1 -h $lp3ip -t openWB/lp/1/boolChargeStat)
echo $evseplugstatelp3 > /var/www/html/openWB/ramdisk/plugstats2
echo $ladestatuslp3 > /var/www/html/openWB/ramdisk/chargestats2
fi

if [[ $evsecons2 == "modbusevse" ]]; then
evseplugstatelp3=$(sudo python runs/readmodbus.py $evsesources2 $evseids2 1002 1)
ladestatuss2=$(</var/www/html/openWB/ramdisk/ladestatuss2)
Expand Down Expand Up @@ -360,6 +378,7 @@ else
echo 0 > /var/www/html/openWB/ramdisk/speichervorhanden
fi
llphaset=3

#Ladeleistung ermitteln
if [[ $ladeleistungmodul != "none" ]]; then
timeout 10 modules/$ladeleistungmodul/main.sh || true
Expand Down Expand Up @@ -409,6 +428,7 @@ else
llkwh=0
llkwhges=$llkwh
fi

#zweiter ladepunkt
if [[ $lastmanagement == "1" ]]; then
if [[ $socmodul1 != "none" ]]; then
Expand Down
4 changes: 3 additions & 1 deletion regel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ source leds.sh
source slavemode.sh
date=$(date)
re='^-?[0-9]+$'

if [[ $isss == "1" ]]; then
exit 0
fi
#doppelte Ausfuehrungsgeschwindigkeit
if [[ $dspeed == "1" ]]; then
if [ -e ramdisk/5sec ]; then
Expand Down
51 changes: 51 additions & 0 deletions runs/atreboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2616,6 +2616,49 @@ if ! grep -Fq "soc_vin=" /var/www/html/openWB/openwb.conf
then
echo "soc_vin=VIN" >> /var/www/html/openWB/openwb.conf
fi
if ! grep -Fq "isss=" /var/www/html/openWB/openwb.conf
then
echo "isss=0" >> /var/www/html/openWB/openwb.conf
fi
if ! grep -Fq "lp1ip=" /var/www/html/openWB/openwb.conf
then
echo "lp1ip=192.168.1.100" >> /var/www/html/openWB/openwb.conf
fi
if ! grep -Fq "lp2ip=" /var/www/html/openWB/openwb.conf
then
echo "lp2ip=192.168.1.100" >> /var/www/html/openWB/openwb.conf
fi

if ! grep -Fq "lp3ip=" /var/www/html/openWB/openwb.conf
then
echo "lp3ip=192.168.1.100" >> /var/www/html/openWB/openwb.conf
fi

if ! grep -Fq "lp4ip=" /var/www/html/openWB/openwb.conf
then
echo "lp4ip=192.168.1.100" >> /var/www/html/openWB/openwb.conf
fi

if ! grep -Fq "lp5ip=" /var/www/html/openWB/openwb.conf
then
echo "lp5ip=192.168.1.100" >> /var/www/html/openWB/openwb.conf
fi

if ! grep -Fq "lp6ip=" /var/www/html/openWB/openwb.conf
then
echo "lp6ip=192.168.1.100" >> /var/www/html/openWB/openwb.conf
fi

if ! grep -Fq "lp7ip=" /var/www/html/openWB/openwb.conf
then
echo "lp7ip=192.168.1.100" >> /var/www/html/openWB/openwb.conf
fi

if ! grep -Fq "lp8ip=" /var/www/html/openWB/openwb.conf
then
echo "lp8ip=192.168.1.100" >> /var/www/html/openWB/openwb.conf
fi

if ! grep -Fq "soclp1_vin=" /var/www/html/openWB/openwb.conf
then
echo "soclp1_vin=none" >> /var/www/html/openWB/openwb.conf
Expand Down Expand Up @@ -2751,6 +2794,14 @@ chmod 777 /var/www/html/openWB/ramdisk/mqttlastregelungaktiv
# sudo apt-get update
# sudo apt-get -qq install -y php-curl
# fi
if (( isss == 1 )); then
if ps ax |grep -v grep |grep "python3 /var/www/html/openWB/runs/isss.py" > /dev/null
then
echo "test" > /dev/null
else
python3 /var/www/html/openWB/runs/isss.py &
fi
fi
(sleep 10; echo 1 > /var/www/html/openWB/ramdisk/reloaddisplay) &
ip route get 1 | awk '{print $NF;exit}' > /var/www/html/openWB/ramdisk/ipaddress
curl -s https://raw.githubusercontent.com/snaptec/openWB/master/web/version > /var/www/html/openWB/ramdisk/vnightly
Expand Down
9 changes: 8 additions & 1 deletion runs/cron5min.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,11 @@ else
sudo ifconfig eth0:0 192.168.193.5 netmask 255.255.255.0 down

fi

if (( isss == 1 )); then
if ps ax |grep -v grep |grep "python3 /var/www/html/openWB/runs/isss.py" > /dev/null
then
echo "test" > /dev/null
else
python3 /var/www/html/openWB/runs/isss.py &
fi
fi
24 changes: 21 additions & 3 deletions runs/set-current.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,16 @@ function setChargingCurrentDAC () {
# INFO: needs new dac.py to accept current and use translation table
sudo python /var/www/html/openWB/runs/dac.py $current $dacregister
}

# function for setting the current - extopenwb
# Parameters:
# 1: current
# 2: lp1ip
function setChargingCurrentExtopenwb () {
current=$1
lp1ip=$2
# set desired charging current
mosquitto_pub -r -t openWB/set/isss/Current -h $lp1ip -m "$current"
}
# function for setting the current - modbusevse
# Parameters:
# 1: current
Expand Down Expand Up @@ -230,6 +239,9 @@ function setChargingCurrent () {
if [[ $evsecon == "http" ]]; then
setChargingCurrenthttp $current
fi
if [[ $evsecon == "extopenwb" ]]; then
setChargingCurrentExtopenwb $current $lp1ip
fi

if [[ $evsecon == "modbusevse" ]]; then
setChargingCurrentModbus $current $modbusevsesource $modbusevseid
Expand Down Expand Up @@ -408,7 +420,7 @@ if [[ $lastmanagement == "1" ]]; then
nrgkickpwlp1=$nrgkickpwlp2
evseip=$evseiplp2
ipevseid=$evseidlp2

lp1ip=$lp2ip
# dirty call (no parameters, all is set above...)
if (( lp2enabled == 0 )); then
oldcurrent=$current
Expand Down Expand Up @@ -438,7 +450,7 @@ if [[ $lastmanagements2 == "1" ]]; then
goetimeoutlp1=$goetimeoutlp3
evseip=$evseiplp3
ipevseid=$evseidlp3

lp1ip=$lp3ip
if (( lp3enabled == 0 )); then
oldcurrent=$current
current=0
Expand All @@ -458,6 +470,7 @@ if [[ $lastmanagementlp4 == "1" ]]; then
evsecon=$evseconlp4
evseip=$evseiplp4
ipevseid=$evseidlp4
lp1ip=$lp4ip
if (( lp4enabled == 0 )); then
oldcurrent=$current
current=0
Expand All @@ -477,6 +490,8 @@ if [[ $lastmanagementlp5 == "1" ]]; then
evsecon=$evseconlp5
evseip=$evseiplp5
ipevseid=$evseidlp5
lp1ip=$lp5ip

if (( lp5enabled == 0 )); then
oldcurrent=$current
current=0
Expand All @@ -496,6 +511,7 @@ if [[ $lastmanagementlp6 == "1" ]]; then
evsecon=$evseconlp6
evseip=$evseiplp6
ipevseid=$evseidlp6
lp1ip=$lp6ip
if (( lp6enabled == 0 )); then
oldcurrent=$current
current=0
Expand All @@ -515,6 +531,7 @@ if [[ $lastmanagementlp7 == "1" ]]; then
evsecon=$evseconlp7
evseip=$evseiplp7
ipevseid=$evseidlp7
lp1ip=$lp7ip
if (( lp7enabled == 0 )); then
oldcurrent=$current
current=0
Expand All @@ -534,6 +551,7 @@ if [[ $lastmanagementlp8 == "1" ]]; then
evsecon=$evseconlp8
evseip=$evseiplp8
ipevseid=$evseidlp8
lp1ip=$lp8ip
if (( lp8enabled == 0 )); then
oldcurrent=$current
current=0
Expand Down

0 comments on commit ccf4004

Please sign in to comment.