Skip to content

Commit

Permalink
Bugfix (snaptec#1067)
Browse files Browse the repository at this point in the history
* formatting and cleanup

* bump version 1.9.102
  • Loading branch information
benderl authored Feb 16, 2021
1 parent bf1c08f commit cb6efd9
Show file tree
Hide file tree
Showing 26 changed files with 189 additions and 430 deletions.
96 changes: 48 additions & 48 deletions goecheck.sh
Original file line number Diff line number Diff line change
@@ -1,76 +1,76 @@
#!/bin/bash
goecheck(){
#######################################
#goe mobility check
if [[ $evsecon == "goe" ]]; then
output=$(curl --connect-timeout 1 -s http://$goeiplp1/status)
if [[ $? == "0" ]] ; then
state=$(echo $output | jq -r '.alw')
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatus"; then
lp1enabled=$(</var/www/html/openWB/ramdisk/lp1enabled)
if ((state == "0")) && (( lp1enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=alw=1 > /dev/null
fi
fi
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatus"; then
if ((state == "1")) ; then
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=alw=0 > /dev/null
fi
fi
oldcurrent=$(echo $output | jq -r '.amp')
current=$(</var/www/html/openWB/ramdisk/llsoll)
if (( oldcurrent != $current )) ; then
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=amp=$current > /dev/null
fi
fi
fi
if [[ $lastmanagement == "1" ]]; then
if [[ $evsecons1 == "goe" ]]; then
output=$(curl --connect-timeout 1 -s http://$goeiplp2/status)
#######################################
#goe mobility check
if [[ $evsecon == "goe" ]]; then
output=$(curl --connect-timeout 1 -s http://$goeiplp1/status)
if [[ $? == "0" ]] ; then
state=$(echo $output | jq -r '.alw')
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatuss1"; then
lp2enabled=$(</var/www/html/openWB/ramdisk/lp2enabled)

if ((state == "0")) && (( lp2enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=alw=1 > /dev/null
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatus"; then
lp1enabled=$(</var/www/html/openWB/ramdisk/lp1enabled)
if ((state == "0")) && (( lp1enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=alw=1 > /dev/null
fi
fi
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatuss1"; then
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatus"; then
if ((state == "1")) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=alw=0 > /dev/null
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=alw=0 > /dev/null
fi
fi
oldcurrent=$(echo $output | jq -r '.amp')
current=$(</var/www/html/openWB/ramdisk/llsolls1)
current=$(</var/www/html/openWB/ramdisk/llsoll)
if (( oldcurrent != $current )) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=amp=$current > /dev/null
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=amp=$current > /dev/null
fi
fi
fi
if [[ $lastmanagements2 == "1" ]]; then
if [[ $evsecons2 == "goe" ]]; then
output=$(curl --connect-timeout 1 -s http://$goeiplp3/status)
if [[ $lastmanagement == "1" ]]; then
if [[ $evsecons1 == "goe" ]]; then
output=$(curl --connect-timeout 1 -s http://$goeiplp2/status)
if [[ $? == "0" ]] ; then
state=$(echo $output | jq -r '.alw')
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatuss2"; then
lp3enabled=$(</var/www/html/openWB/ramdisk/lp3enabled)
if ((state == "0")) && (( lp3enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp3 -s http://$goeiplp3/mqtt?payload=alw=1 > /dev/null
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatuss1"; then
lp2enabled=$(</var/www/html/openWB/ramdisk/lp2enabled)

if ((state == "0")) && (( lp2enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=alw=1 > /dev/null
fi
fi
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatuss2"; then
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatuss1"; then
if ((state == "1")) ; then
curl --silent --connect-timeout $goetimeoutlp3 -s http://$goeiplp3/mqtt?payload=alw=0 > /dev/null
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=alw=0 > /dev/null
fi
fi
oldcurrent=$(echo $output | jq -r '.amp')
current=$(</var/www/html/openWB/ramdisk/llsolls2)
current=$(</var/www/html/openWB/ramdisk/llsolls1)
if (( oldcurrent != $current )) ; then
curl --silent --connect-timeout $goetimeoutlp3 -s http://$goeiplp3/mqtt?payload=amp=$current > /dev/null
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=amp=$current > /dev/null
fi
fi
fi
if [[ $lastmanagements2 == "1" ]]; then
if [[ $evsecons2 == "goe" ]]; then
output=$(curl --connect-timeout 1 -s http://$goeiplp3/status)
if [[ $? == "0" ]] ; then
state=$(echo $output | jq -r '.alw')
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatuss2"; then
lp3enabled=$(</var/www/html/openWB/ramdisk/lp3enabled)
if ((state == "0")) && (( lp3enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp3 -s http://$goeiplp3/mqtt?payload=alw=1 > /dev/null
fi
fi
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatuss2"; then
if ((state == "1")) ; then
curl --silent --connect-timeout $goetimeoutlp3 -s http://$goeiplp3/mqtt?payload=alw=0 > /dev/null
fi
fi
oldcurrent=$(echo $output | jq -r '.amp')
current=$(</var/www/html/openWB/ramdisk/llsolls2)
if (( oldcurrent != $current )) ; then
curl --silent --connect-timeout $goetimeoutlp3 -s http://$goeiplp3/mqtt?payload=amp=$current > /dev/null
fi
fi
fi
fi
fi
fi
}
2 changes: 1 addition & 1 deletion modules/llbuchse/main.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
echo 0 > /dev/null
#all handled in buchsecontrol.py
#all handled in buchse.py
4 changes: 2 additions & 2 deletions runs/buchseact.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
if action == "auf":
GPIO.output(11, GPIO.LOW)
GPIO.output(7, GPIO.HIGH)
print "7 low 11 high"
print( "7 low 11 high" )
time.sleep(3)
GPIO.output(7, GPIO.LOW)
if action == "zu":
GPIO.output(11, GPIO.HIGH)
GPIO.output(7, GPIO.HIGH)
print "11 high, 7 high"
print( "11 high, 7 high" )
time.sleep(3)
GPIO.output(7, GPIO.LOW)

178 changes: 0 additions & 178 deletions runs/buchsecontrol.py

This file was deleted.

5 changes: 2 additions & 3 deletions runs/cpuremote.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/usr/bin/python
from pymodbus.client.sync import ModbusTcpClient
import sys
import os
import time
from pymodbus.client.sync import ModbusTcpClient

seradd = str(sys.argv[1])
serid = int(4)

from pymodbus.client.sync import ModbusTcpClient
client = ModbusTcpClient(seradd, port=8899)
rq = client.write_register(0x0001, 256, unit=serid)
time.sleep(2)
rq = client.write_register(0x0001, 512, unit=serid)

6 changes: 4 additions & 2 deletions runs/evseipwriteall.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/python3
import sys
ipadd = str(sys.argv[2])
from pymodbus.client.sync import ModbusTcpClient
client = ModbusTcpClient(ipadd, port=8899)

lla = int(sys.argv[1])
ipadd = str(sys.argv[2])
evseid = int(sys.argv[3])
wreg = int(sys.argv[4])

client = ModbusTcpClient(ipadd, port=8899)
rq = client.write_registers(wreg, lla, unit=evseid)
6 changes: 4 additions & 2 deletions runs/evseipwritemodbus.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/python3
import sys
ipadd = str(sys.argv[2])
from pymodbus.client.sync import ModbusTcpClient
client = ModbusTcpClient(ipadd, port=8899)

lla = int(sys.argv[1])
ipadd = str(sys.argv[2])
evseid = int(sys.argv[3])

client = ModbusTcpClient(ipadd, port=8899)
rq = client.write_registers(1000, lla, unit=evseid)
4 changes: 3 additions & 1 deletion runs/evsemasterethframerwritemodbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import sys
from pymodbus.transaction import ModbusRtuFramer
from pymodbus.client.sync import ModbusTcpClient
client = ModbusTcpClient('192.168.193.18', port=8899, framer=ModbusRtuFramer)

lla = int(sys.argv[1])

client = ModbusTcpClient('192.168.193.18', port=8899, framer=ModbusRtuFramer)
rq = client.write_registers(1000, lla, unit=1)
5 changes: 3 additions & 2 deletions runs/evseslavewritemodbus.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/python3
import sys

from pymodbus.client.sync import ModbusTcpClient
client = ModbusTcpClient('192.168.193.16', port=8899)

lla = int(sys.argv[1])

client = ModbusTcpClient('192.168.193.16', port=8899)
rq = client.write_registers(1000, lla, unit=1)
Loading

0 comments on commit cb6efd9

Please sign in to comment.