forked from greentangerine/ME3000
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery.py
More file actions
executable file
·44 lines (33 loc) · 928 Bytes
/
Copy pathquery.py
File metadata and controls
executable file
·44 lines (33 loc) · 928 Bytes
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
#!/usr/bin/env python3
import sys
sys.path.insert(0, '/home/pi/ME3000')
from me3000 import ME3000
from MyME3000 import *
roo = ME3000(SERIAL_PORT, SLAVE)
print("Get all holding registers ...")
status, response = roo.read_holding()
if status:
print(response)
#print("Get all input registers ...")
#status, response = roo.read_input()
#if status:
# print(response)
#print("Get inverter state ...")
#status, invstate, invstring = roo.get_inverter_state()
#if status:
# print("State = ", invstate, "[", invstring, "]")
#print("Get battery percentage ...")
#status, response = roo.get_battery_percentage()
#if status:
# print(response)
#print("Set standby ...")
#status, response = roo.set_standby()
#if status:
# retval = hex(response & 0x00FF)
# print(retval)
#print("Set auto ...")
#status, response = roo.set_auto()
#if status:
# retval = hex(response & 0x00FF)
# print(retval)
roo.disconnect()