Error "index of range" #207
adamkorski
started this conversation in
General
Replies: 1 comment
-
the solution is to change the protocol to PI30MAX |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When reading EASUNPOWER VM-5500W I get an error. How to fix it?
pi@raspberrypi3:~ $ mpp-solar --getstatus -D
2022-04-01 20:48:44,332:INFO:init:main@236: Solar Device Command Utility, version: 0.7.76, remove brackets in ved protocol
2022-04-01 20:48:44,333:INFO:init:main@339: Creating device "unnamed" (type: "mppsolar") on port "/dev/ttyUSB0 (porttype=None)" using protocol "PI30"
2022-04-01 20:48:44,335:DEBUG:init:main@343: device_class <class 'mppsolar.devices.mppsolar.mppsolar'>
2022-04-01 20:48:44,336:DEBUG:device:init@31: init args ()
2022-04-01 20:48:44,336:DEBUG:device:init@32: init kwargs {'name': 'unnamed', 'port': '/dev/ttyUSB0', 'protocol': 'PI30', 'baud': 2400, 'porttype': None, 'mqtt_broker': 'localhost', 'mqtt_port': 1883, 'mqtt_user': None, 'mqtt_pass': None}
2022-04-01 20:48:44,336:DEBUG:device:get_port_type@86: port matches ttyusb
2022-04-01 20:48:44,336:INFO:device:set_port@160: Using serialio for communications
2022-04-01 20:48:44,347:DEBUG:device:set_protocol@96: Protocol PI30
2022-04-01 20:48:44,358:DEBUG:device:init@36: init name unnamed, port <mppsolar.io.serialio.SerialIO object at 0xb65e6ec8>, protocol <mppsolar.protocols.pi30.pi30 object at 0xb65e6e68>
2022-04-01 20:48:44,358:DEBUG:init:main@390: Commands [(<mppsolar.devices.mppsolar.mppsolar object at 0xb65e6e38>, 'get_status', 'get_status', 'screen', None, None)]
2022-04-01 20:48:44,358:INFO:init:main@395: Looping 1 commands
2022-04-01 20:48:44,358:INFO:init:main@405: Getting results from device: mppsolar device - name: unnamed, port: <mppsolar.io.serialio.SerialIO object at 0xb65e6ec8>, protocol: <mppsolar.protocols.pi30.pi30 object at 0xb65e6e68> for command: get_status, tag: get_status, outputs: screen
2022-04-01 20:48:44,359:INFO:device:run_command@270: Running command get_status
2022-04-01 20:48:44,359:INFO:device:run_command@270: Running command QPIGS
2022-04-01 20:48:44,359:INFO:abstractprotocol:get_full_command@31: Using protocol b'PI30' with 36 commands
2022-04-01 20:48:44,359:DEBUG:protocol_helpers:crcPI@299: Calculating CRC for b'QPIGS'
2022-04-01 20:48:44,359:DEBUG:protocol_helpers:crcPI@349: Generated CRC 0xb7 0xa9 0xb7a9
2022-04-01 20:48:44,359:DEBUG:abstractprotocol:get_full_command@38: full command: b'QPIGS\xb7\xa9\r'
2022-04-01 20:48:44,360:INFO:device:run_command@296: full command b'QPIGS\xb7\xa9\r' for command QPIGS
2022-04-01 20:48:44,360:DEBUG:abstractprotocol:get_command_defn@42: Processing command 'QPIGS'
2022-04-01 20:48:44,360:DEBUG:abstractprotocol:get_command_defn@44: Found command QPIGS in protocol b'PI30'
2022-04-01 20:48:44,360:DEBUG:serialio:send_and_receive@19: port /dev/ttyUSB0, baudrate 2400
2022-04-01 20:48:44,365:DEBUG:serialio:send_and_receive@22: Executing command via serialio...
2022-04-01 20:48:44,880:DEBUG:serialio:send_and_receive@30: serial response was: b'(236.3 49.9 236.3 49.9 0000 0000 000 396 49.60 006 045 0036 00.0 000.0 00.00 00000 00010101 00 00 00000 010\xa2\x94\r'
2022-04-01 20:48:44,883:DEBUG:device:run_command@315: Send and Receive Response b'(236.3 49.9 236.3 49.9 0000 0000 000 396 49.60 006 045 0036 00.0 000.0 00.00 00000 00010101 00 00 00000 010\xa2\x94\r'
2022-04-01 20:48:44,883:INFO:abstractprotocol:decode@175: response passed to decode: b'(236.3 49.9 236.3 49.9 0000 0000 000 396 49.60 006 045 0036 00.0 000.0 00.00 00000 00010101 00 00 00000 010\xa2\x94\r'
2022-04-01 20:48:44,883:DEBUG:protocol_helpers:crcPI@299: Calculating CRC for b'(236.3 49.9 236.3 49.9 0000 0000 000 396 49.60 006 045 0036 00.0 000.0 00.00 00000 00010101 00 00 00000 010'
2022-04-01 20:48:44,883:DEBUG:protocol_helpers:crcPI@349: Generated CRC 0xa2 0x94 0xa294
2022-04-01 20:48:44,883:DEBUG:pi30:check_response_valid@861: CRCs match
2022-04-01 20:48:44,883:DEBUG:abstractprotocol:get_command_defn@42: Processing command 'QPIGS'
2022-04-01 20:48:44,884:DEBUG:abstractprotocol:get_command_defn@44: Found command QPIGS in protocol b'PI30'
2022-04-01 20:48:44,884:INFO:abstractprotocol:decode@215: Processing response of type DEFAULT
2022-04-01 20:48:44,884:DEBUG:abstractprotocol:decode@219: trimmed and split responses: [b'236.3', b'49.9', b'236.3', b'49.9', b'0000', b'0000', b'000', b'396', b'49.60', b'006', b'045', b'0036', b'00.0', b'000.0', b'00.00', b'00000', b'00010101', b'00', b'00', b'00000', b'010']
2022-04-01 20:48:44,884:INFO:abstractprotocol:decode@226: Processing DEFAULT type responses
2022-04-01 20:48:44,884:INFO:device:run_command@334: Decoded response {'raw_response': ['(236.3 49.9 236.3 49.9 0000 0000 000 396 49.60 006 045 0036 00.0 000.0 00.00 00000 00010101 00 00 00000 010¢\x94\r', ''], '_command': 'QPIGS', '_command_description': 'General Status Parameters inquiry', 'AC Input Voltage': [236.3, 'V'], 'AC Input Frequency': [49.9, 'Hz'], 'AC Output Voltage': [236.3, 'V'], 'AC Output Frequency': [49.9, 'Hz'], 'AC Output Apparent Power': [0, 'VA'], 'AC Output Active Power': [0, 'W'], 'AC Output Load': [0, '%'], 'BUS Voltage': [396, 'V'], 'Battery Voltage': [49.6, 'V'], 'Battery Charging Current': [6, 'A'], 'Battery Capacity': [45, '%'], 'Inverter Heat Sink Temperature': [36, '°C'], 'PV Input Current for Battery': [0.0, 'A'], 'PV Input Voltage': [0.0, 'V'], 'Battery Voltage from SCC': [0.0, 'V'], 'Battery Discharge Current': [0, 'A'], 'Is SBU Priority Version Added': [0, 'bool'], 'Is Configuration Changed': [0, 'bool'], 'Is SCC Firmware Updated': [0, 'bool'], 'Is Load On': [1, 'bool'], 'Is Battery Voltage to Steady While Charging': [0, 'bool'], 'Is Charging On': [1, 'bool'], 'Is SCC Charging On': [0, 'bool'], 'Is AC Charging On': [1, 'bool'], 'RSV1': [0, 'A'], 'RSV2': [0, 'A'], 'PV Input Power': [0, 'W'], 'Is Charging to Float': [0, 'bool'], 'Is Switched On': [1, 'bool'], 'Is Reserved': [0, 'bool']}
2022-04-01 20:48:44,884:INFO:device:run_command@270: Running command Q1
2022-04-01 20:48:44,884:INFO:abstractprotocol:get_full_command@31: Using protocol b'PI30' with 36 commands
2022-04-01 20:48:44,884:DEBUG:protocol_helpers:crcPI@299: Calculating CRC for b'Q1'
2022-04-01 20:48:44,885:DEBUG:protocol_helpers:crcPI@349: Generated CRC 0x1b 0xfc 0x1bfc
2022-04-01 20:48:44,885:DEBUG:abstractprotocol:get_full_command@38: full command: b'Q1\x1b\xfc\r'
2022-04-01 20:48:44,885:INFO:device:run_command@296: full command b'Q1\x1b\xfc\r' for command Q1
2022-04-01 20:48:44,885:DEBUG:abstractprotocol:get_command_defn@42: Processing command 'Q1'
2022-04-01 20:48:44,885:DEBUG:abstractprotocol:get_command_defn@44: Found command Q1 in protocol b'PI30'
2022-04-01 20:48:44,885:DEBUG:serialio:send_and_receive@19: port /dev/ttyUSB0, baudrate 2400
2022-04-01 20:48:44,890:DEBUG:serialio:send_and_receive@22: Executing command via serialio...
2022-04-01 20:48:45,149:DEBUG:serialio:send_and_receive@30: serial response was: b'(00 00 10 000 036 026 034 00 00 000 0030 0000 11\xach\r'
2022-04-01 20:48:45,154:DEBUG:device:run_command@315: Send and Receive Response b'(00 00 10 000 036 026 034 00 00 000 0030 0000 11\xach\r'
2022-04-01 20:48:45,154:INFO:abstractprotocol:decode@175: response passed to decode: b'(00 00 10 000 036 026 034 00 00 000 0030 0000 11\xach\r'
2022-04-01 20:48:45,154:DEBUG:protocol_helpers:crcPI@299: Calculating CRC for b'(00 00 10 000 036 026 034 00 00 000 0030 0000 11'
2022-04-01 20:48:45,155:DEBUG:protocol_helpers:crcPI@349: Generated CRC 0xac 0x68 0xac68
2022-04-01 20:48:45,155:DEBUG:pi30:check_response_valid@861: CRCs match
2022-04-01 20:48:45,156:DEBUG:abstractprotocol:get_command_defn@42: Processing command 'Q1'
2022-04-01 20:48:45,156:DEBUG:abstractprotocol:get_command_defn@44: Found command Q1 in protocol b'PI30'
2022-04-01 20:48:45,156:INFO:abstractprotocol:decode@215: Processing response of type DEFAULT
2022-04-01 20:48:45,156:DEBUG:abstractprotocol:decode@219: trimmed and split responses: [b'00', b'00', b'10', b'000', b'036', b'026', b'034', b'00', b'00', b'000', b'0030', b'0000', b'11']
2022-04-01 20:48:45,157:INFO:abstractprotocol:decode@226: Processing DEFAULT type responses
Traceback (most recent call last):
File "/usr/local/bin/mpp-solar", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/mppsolar/init.py", line 408, in main
results = _device.run_command(command=_command)
File "/usr/local/lib/python3.9/dist-packages/mppsolar/devices/device.py", line 276, in run_command
return self.get_status()
File "/usr/local/lib/python3.9/dist-packages/mppsolar/devices/device.py", line 342, in get_status
data.update(self.run_command(command))
File "/usr/local/lib/python3.9/dist-packages/mppsolar/devices/device.py", line 333, in run_command
decoded_response = self._protocol.decode(raw_response, command)
File "/usr/local/lib/python3.9/dist-packages/mppsolar/protocols/abstractprotocol.py", line 267, in decode
msgs[key] = [resp_format[2][int(result)], ""]
IndexError: list index out of range
Beta Was this translation helpful? Give feedback.
All reactions