update venus rollout script
This commit is contained in:
parent
93c062ec90
commit
5747e11c3f
|
@ -28,6 +28,16 @@ async def run_rclocal(remote_host):
|
||||||
command = "chmod +x /data/rc.local && /data/rc.local"
|
command = "chmod +x /data/rc.local && /data/rc.local"
|
||||||
return await run_remote_command(remote_host, command)
|
return await run_remote_command(remote_host, command)
|
||||||
|
|
||||||
|
async def stop_battery_service(remote_host):
|
||||||
|
command = "/opt/victronenergy/serial-starter/stop-tty.sh ttyUSB0"
|
||||||
|
# command = "/opt/victronenergy/serial-starter/stop-tty.sh ttyUSB1"
|
||||||
|
return await run_remote_command(remote_host, command)
|
||||||
|
|
||||||
|
async def start_battery_service(remote_host):
|
||||||
|
command = "/opt/victronenergy/serial-starter/start-tty.sh ttyUSB0"
|
||||||
|
# command = "/opt/victronenergy/serial-starter/start-tty.sh ttyUSB1"
|
||||||
|
return await run_remote_command(remote_host, command)
|
||||||
|
|
||||||
async def upload_files(remote_host):
|
async def upload_files(remote_host):
|
||||||
file_location_mappings = {
|
file_location_mappings = {
|
||||||
"rc.local": "/data/",
|
"rc.local": "/data/",
|
||||||
|
@ -89,10 +99,15 @@ async def main(remote_host):
|
||||||
#### 3. import pika ####
|
#### 3. import pika ####
|
||||||
print("Import pika!")
|
print("Import pika!")
|
||||||
print(await import_pika(remote_host))
|
print(await import_pika(remote_host))
|
||||||
##### 4. run rc.local ######
|
##### 4. stop battery service ######
|
||||||
|
print("Stop battery service!")
|
||||||
|
print(await stop_battery_service(remote_host))
|
||||||
|
##### 5. run rc.local ######
|
||||||
print("Run rc.local to set password, timezone and cp battery folder!")
|
print("Run rc.local to set password, timezone and cp battery folder!")
|
||||||
print(await run_rclocal(remote_host))
|
print(await run_rclocal(remote_host))
|
||||||
#### restart battery service??????#####
|
##### 6. start battery service ######
|
||||||
|
print("Start battery service!")
|
||||||
|
print(await start_battery_service(remote_host))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
sys.exit("It's not Venus GX!")
|
sys.exit("It's not Venus GX!")
|
||||||
|
|
Loading…
Reference in New Issue