update aggregator service in Venus and Cerbo
This commit is contained in:
parent
602470abc5
commit
5c629ed6b2
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
exec 2>&1
|
||||
exec multilog t s25000 n4 /var/log/aggregator
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
echo "*** starting aggregator ***"
|
||||
exec 2>&1
|
||||
exec softlimit -d 100000000 -s 1000000 -a 100000000 /opt/victronenergy/dbus-fzsonick-48tl/aggregator.py
|
|
@ -259,7 +259,7 @@ class Aggregator:
|
|||
return 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Aggregator has started AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
|
||||
print("Aggregator has started")
|
||||
|
||||
def run_hourly_manager():
|
||||
Aggregator.hourly_data_aggregation_manager()
|
||||
|
|
|
@ -5,11 +5,6 @@
|
|||
app="/opt/victronenergy/dbus-fzsonick-48tl/dbus-fzsonick-48tl.py"
|
||||
args="$tty"
|
||||
|
||||
# Start aggregator.py in the background
|
||||
#/opt/victronenergy/dbus-fzsonick-48tl/aggregator.py &
|
||||
|
||||
# Start dbus-fzsonick-48tl.py using the start command
|
||||
start "$args"
|
||||
start $args
|
||||
|
||||
# Wait for all background processes to finish
|
||||
#wait
|
||||
|
|
|
@ -45,10 +45,19 @@ cp -r "$source_dir" "$destination_dir_upper"
|
|||
echo "Changing MPPT network mode to 0..."
|
||||
sed -i "s|('/Link/NetworkMode', [^)]*)|('/Link/NetworkMode', 0)|g" /opt/victronenergy/dbus-systemcalc-py/delegates/dvcc.py
|
||||
|
||||
# Set VPN
|
||||
echo "Running VPN service..."
|
||||
find /data/innovenergy/openvpn -type f -exec chmod 777 {} \;
|
||||
/data/innovenergy/openvpn/service/run
|
||||
#nohup /data/innovenergy/openvpn/service/run &
|
||||
# Set aggregator service symlink
|
||||
echo "Creating symbolic link to aggregator service..."
|
||||
aggregator_service_path="/data/aggregator"
|
||||
# aggregator_symlink_path="/opt/victronenergy/service"
|
||||
aggregator_symlink_path="/service"
|
||||
ln -s "$aggregator_service_path" "$aggregator_symlink_path"
|
||||
|
||||
# Set VPN service symlink
|
||||
echo "Creating symbolic link to VPN service..."
|
||||
vpn_service_path="/data/innovenergy/openvpn/service"
|
||||
# vpn_symlink_path="/opt/victronenergy/service/openvpn"
|
||||
vpn_symlink_path="/service/openvpn"
|
||||
ln -s "$vpn_service_path" "$vpn_symlink_path"
|
||||
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -97,6 +97,7 @@ async def upload_files(remote_host,which_file):
|
|||
file_location_mappings = {
|
||||
"rc.local": "/data/",
|
||||
"dbus-fzsonick-48tl": "/data/",
|
||||
"aggregator": "/data/",
|
||||
"service": "/data/innovenergy/openvpn/",
|
||||
"openvpn": "/data/innovenergy/openvpn/",
|
||||
"pika-0.13.1": "/data/innovenergy/"
|
||||
|
|
|
@ -6,6 +6,7 @@ root_password='salidomo'
|
|||
set -e
|
||||
|
||||
battery_file_path="./CerboReleaseFiles/dbus-fzsonick-48tl"
|
||||
cerbo_release_file_path="./CerboReleaseFiles"
|
||||
echo -e "\n============================ Deploy ============================\n"
|
||||
# Berger 10.2.2.36 and Polycom 10.2.4.96 are Cerbo with fork usb0
|
||||
# ip_addresses_usb0=("10.2.2.118" "10.2.4.155" "10.2.3.244" "10.2.4.127" "10.2.2.36" "10.2.4.96")
|
||||
|
@ -15,12 +16,14 @@ ip_addresses_usb1=("10.2.0.179" "10.2.1.241" )
|
|||
|
||||
for ip_address in "${ip_addresses_usb0[@]}"; do
|
||||
|
||||
ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./stop-tty.sh ttyUSB0"
|
||||
# ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./stop-tty.sh ttyUSB0"
|
||||
|
||||
scp "${battery_file_path}/start.sh" "root@"$ip_address":/opt/victronenergy/dbus-fzsonick-48tl/"
|
||||
scp "${battery_file_path}/aggregator.py" "root@"$ip_address":/data/dbus-fzsonick-48tl/"
|
||||
scp "${battery_file_path}/start.sh" "root@"$ip_address":/data/dbus-fzsonick-48tl/"
|
||||
scp "${cerbo_release_file_path}/rc.local" "root@"$ip_address":/data"
|
||||
scp -r "${cerbo_release_file_path}/aggregator" "root@"$ip_address":/data"
|
||||
|
||||
ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./start-tty.sh ttyUSB0"
|
||||
# ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./start-tty.sh ttyUSB0"
|
||||
|
||||
|
||||
echo "Deployed and ran commands on $ip_address"
|
||||
|
@ -28,12 +31,14 @@ done
|
|||
|
||||
for ip_address in "${ip_addresses_usb1[@]}"; do
|
||||
|
||||
ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./stop-tty.sh ttyUSB1"
|
||||
# ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./stop-tty.sh ttyUSB1"
|
||||
|
||||
scp "${battery_file_path}/start.sh" "root@"$ip_address":/opt/victronenergy/dbus-fzsonick-48tl/"
|
||||
scp "${battery_file_path}/start.sh" "root@"$ip_address":/data/dbus-fzsonick-48tl/"
|
||||
scp "${battery_file_path}/aggregator.py" "root@"$ip_address":/data/dbus-fzsonick-48tl/"
|
||||
# scp "${battery_file_path}/start.sh" "root@"$ip_address":/data/dbus-fzsonick-48tl/"
|
||||
# scp "${cerbo_release_file_path}/rc.local" "root@"$ip_address":/data"
|
||||
# scp -r "${cerbo_release_file_path}/aggregator" "root@"$ip_address":/data"
|
||||
|
||||
ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./start-tty.sh ttyUSB1"
|
||||
# ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./start-tty.sh ttyUSB1"
|
||||
|
||||
|
||||
echo "Deployed and ran commands on $ip_address"
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
exec 2>&1
|
||||
exec multilog t s25000 n4 /var/log/aggregator
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
echo "*** starting aggregator ***"
|
||||
exec 2>&1
|
||||
exec softlimit -d 100000000 -s 1000000 -a 100000000 /opt/victronenergy/dbus-fzsonick-48tl/aggregator.py
|
|
@ -18,12 +18,6 @@ CSV_DIR = "/data/csv_files/"
|
|||
HOURLY_DIR = "/data/csv_files/HourlyData"
|
||||
DAILY_DIR = "/data/csv_files/DailyData"
|
||||
|
||||
# S3 Credentials
|
||||
#S3BUCKET = "6-c0436b6a-d276-4cd8-9c44-1eae86cf5d0e"
|
||||
#S3KEY = "EXO2a6cd837ae9279271b1710af"
|
||||
#S3SECRET = "IAK2wc7mL0HWD9LHFeiv1nl5jvousOLLAHKCQwmwniI"
|
||||
|
||||
|
||||
print("start with the correct credentials")
|
||||
|
||||
S3BUCKET = cfg.S3BUCKET
|
||||
|
@ -270,8 +264,8 @@ class Aggregator:
|
|||
return 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("aggregator has started aAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
|
||||
#exit(0)
|
||||
print("aggregator has started")
|
||||
|
||||
def run_hourly_manager():
|
||||
Aggregator.hourly_data_aggregation_manager()
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/sh
|
||||
exec 2>&1
|
||||
|
||||
softlimit -d 100000000 -s 1000000 -a 100000000 /opt/innovenergy/dbus-fzsonick-48tl/start.sh
|
||||
exec softlimit -d 100000000 -s 1000000 -a 100000000 /opt/innovenergy/dbus-fzsonick-48tl/start.sh TTY
|
||||
|
||||
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
app="/opt/innovenergy/dbus-fzsonick-48tl/dbus-fzsonick-48tl.py"
|
||||
args="$tty"
|
||||
|
||||
# Start aggregator.py in the background
|
||||
#/opt/innovenergy/dbus-fzsonick-48tl/aggregator.py &
|
||||
|
||||
# Start dbus-fzsonick-48tl.py using the start command
|
||||
start "$args"
|
||||
|
||||
# Wait for all background processes to finish
|
||||
#wait
|
||||
start $args
|
||||
|
||||
|
|
|
@ -44,10 +44,10 @@ cp -r "$source_dir" "$destination_dir_upper"
|
|||
# Set toggle calibration charge button
|
||||
cp /data/PageChargingStrategy.qml /opt/victronenergy/gui/qml
|
||||
|
||||
# # Set VPN
|
||||
# echo "Running VPN service..."
|
||||
# find /opt/innovenergy/openvpn -type f -exec chmod 777 {} \;
|
||||
# /opt/innovenergy/openvpn/service/run
|
||||
#nohup /opt/innovenergy/openvpn/service/run &
|
||||
# Set aggregator service symlink
|
||||
echo "Creating symbolic link to aggregator service..."
|
||||
aggregator_service_path="/data/aggregator"
|
||||
aggregator_symlink_path="/service"
|
||||
ln -s "$aggregator_service_path" "$aggregator_symlink_path"
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -50,6 +50,7 @@ async def upload_files(remote_host):
|
|||
file_location_mappings = {
|
||||
"rc.local": "/data/",
|
||||
"dbus-fzsonick-48tl": "/data/",
|
||||
"aggregator": "/data/",
|
||||
"PageChargingStrategy.qml": "/data/",
|
||||
"pika-0.13.1": "/data/innovenergy/"
|
||||
}
|
||||
|
|
|
@ -19,15 +19,16 @@ ip_addresses_usb1=("10.2.1.35")
|
|||
|
||||
for ip_address in "${ip_addresses_usb0[@]}"; do
|
||||
|
||||
ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./stop-tty.sh ttyUSB0"
|
||||
# ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./stop-tty.sh ttyUSB0"
|
||||
|
||||
# scp "${battery_file_path}/start.sh" "root@"$ip_address":/opt/victronenergy/dbus-fzsonick-48tl/"
|
||||
# scp "${battery_file_path}/start.sh" "root@"$ip_address":/data/dbus-fzsonick-48tl/"
|
||||
scp "${venus_release_file_path}/rc.local" "root@"$ip_address":/data/"
|
||||
scp "${venus_release_file_path}/PageChargingStrategy.qml" "root@"$ip_address":/opt/victronenergy/gui/qml"
|
||||
scp "${venus_release_file_path}/PageChargingStrategy.qml" "root@"$ip_address":/data/"
|
||||
scp "${battery_file_path}/aggregator.py" "root@"$ip_address":/data/dbus-fzsonick-48tl/"
|
||||
scp "${battery_file_path}/start.sh" "root@"$ip_address":/data/dbus-fzsonick-48tl/"
|
||||
scp "${battery_file_path}/service/run" "root@"$ip_address":/data/dbus-fzsonick-48tl/service"
|
||||
scp "${venus_release_file_path}/rc.local" "root@"$ip_address":/data"
|
||||
scp -r "${venus_release_file_path}/aggregator" "root@"$ip_address":/data"
|
||||
|
||||
ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./start-tty.sh ttyUSB0"
|
||||
|
||||
# ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./start-tty.sh ttyUSB0"
|
||||
|
||||
|
||||
echo "Deployed and ran commands on $ip_address"
|
||||
|
@ -35,16 +36,16 @@ done
|
|||
|
||||
for ip_address in "${ip_addresses_usb1[@]}"; do
|
||||
|
||||
ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./stop-tty.sh ttyUSB1"
|
||||
# ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./stop-tty.sh ttyUSB1"
|
||||
|
||||
# scp "${battery_file_path}/start.sh" "root@"$ip_address":/opt/victronenergy/dbus-fzsonick-48tl/"
|
||||
# scp "${battery_file_path}/start.sh" "root@"$ip_address":/data/dbus-fzsonick-48tl/"
|
||||
scp "${venus_release_file_path}/rc.local" "root@"$ip_address":/data/"
|
||||
scp "${venus_release_file_path}/PageChargingStrategy.qml" "root@"$ip_address":/opt/victronenergy/gui/qml"
|
||||
scp "${venus_release_file_path}/PageChargingStrategy.qml" "root@"$ip_address":/data/"
|
||||
scp "${battery_file_path}/aggregator.py" "root@"$ip_address":/data/dbus-fzsonick-48tl/"
|
||||
scp "${battery_file_path}/start.sh" "root@"$ip_address":/data/dbus-fzsonick-48tl/"
|
||||
scp "${battery_file_path}/service/run" "root@"$ip_address":/data/dbus-fzsonick-48tl/service"
|
||||
scp "${venus_release_file_path}/rc.local" "root@"$ip_address":/data"
|
||||
scp -r "${venus_release_file_path}/aggregator" "root@"$ip_address":/data"
|
||||
|
||||
|
||||
ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./start-tty.sh ttyUSB1"
|
||||
# ssh "$username"@"$ip_address" "cd /opt/victronenergy/serial-starter && echo '$root_password' | ./start-tty.sh ttyUSB1"
|
||||
|
||||
|
||||
echo "Deployed and ran commands on $ip_address"
|
||||
|
|
Loading…
Reference in New Issue