jblance / mpp-solar

Python package to communicate to MPP Solar PIP-4048MS inverters (and similar)
MIT License
354 stars 149 forks source link

PI30MAX protocol - hidraw fix needed #150

Closed borisgit86 closed 1 year ago

borisgit86 commented 3 years ago

Hi, i try to use commands QEY, QEM, QED, QLY, QLM, QLD the inverter return NAK. QET and QLT works.

Do you check and help me?

frederickjh commented 1 year ago

@jblance I was able to reset the inverter this morning by powering it off by disconnecting all power sources. The LED bar is working correctly now, but unfortunately running the PLEDE1 command still returns the same output that I posted above.

frederickjh commented 1 year ago

Hi @jblance!

The OP wrote:

i try to use commands QEY, QEM, QED, QLY, QLM, QLD the inverter return NAK. QET and QLT works.

I just tested these commands on my MPPSolar PIP 8048MAX with the following results:

The following work and return results: QET, QEM, QLT, QLM

The following do not work. Debug messages below:

CLICK ME to see collapsed debug for the QEY command

```bash $ /usr/local/bin/mpp-solar -p /dev/mppsolarusb/direct/0 -P PI30MAX -b 2400 -c QEY2023 --debug 2023-02-02 23:09:02,961:INFO:__init__:main@218: Solar Device Command Utility, version: 0.14.7 2023-02-02 23:09:02,961:DEBUG:__init__:main@238: MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar', mqttc=, _isConnected=False) 2023-02-02 23:09:02,961:DEBUG:__init__:main@240: udp port 5555 2023-02-02 23:09:02,961:DEBUG:__init__:main@242: Using Postgres None 2023-02-02 23:09:02,961:DEBUG:__init__:main@245: Using Mongo None with mppsolar 2023-02-02 23:09:02,961:INFO:__init__:main@347: Creating device "unnamed" (type: "mppsolar") on port "/dev/mppsolarusb/direct/0 (porttype=None)" using protocol "PI30MAX" 2023-02-02 23:09:02,962:DEBUG:__init__:main@351: device_class 2023-02-02 23:09:02,962:DEBUG:device:__init__@33: __init__ args () 2023-02-02 23:09:02,962:DEBUG:device:__init__@34: __init__ kwargs {'name': 'unnamed', 'port': '/dev/mppsolarusb/direct/0', 'protocol': 'PI30MAX', 'baud': 2400, 'porttype': None, 'mqtt_broker': MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar', mqttc=, _isConnected=False), 'udp_port': '5555', 'mongo_url': None, 'mongo_db': 'mppsolar'} 2023-02-02 23:09:02,962:DEBUG:__init__:get_port_type@42: port matches mppsolar 2023-02-02 23:09:02,962:INFO:__init__:get_port@92: Using hidrawio for communications 2023-02-02 23:09:02,963:DEBUG:__init__:get_protocol@13: Protocol PI30MAX 2023-02-02 23:09:02,965:INFO:pi30max:__init__@967: Using protocol b'PI30MAX' with 61 commands 2023-02-02 23:09:02,965:DEBUG:device:__init__@38: __init__ name unnamed, port , protocol PI30 protocol handler for LV6048MAX and similar inverters 2023-02-02 23:09:02,965:DEBUG:__init__:main@399: Commands [(, 'QEY2023', 'QEY2023', 'screen', None, None)] 2023-02-02 23:09:02,965:INFO:__init__:main@404: Looping 1 commands 2023-02-02 23:09:02,966:INFO:__init__:main@414: Getting results from device: mppsolar device - name: unnamed, port: , protocol: PI30 protocol handler for LV6048MAX and similar inverters for command: QEY2023, tag: QEY2023, outputs: screen 2023-02-02 23:09:02,966:INFO:device:run_command@274: Running command QEY2023 2023-02-02 23:09:02,966:INFO:abstractprotocol:get_full_command@50: Using protocol b'PI30MAX' with 61 commands 2023-02-02 23:09:02,966:DEBUG:protocol_helpers:crcPI@313: Calculating CRC for b'QEY2023' 2023-02-02 23:09:02,966:DEBUG:protocol_helpers:crcPI@363: Generated CRC 0xa7 0x4a 0xa74a 2023-02-02 23:09:02,966:DEBUG:abstractprotocol:get_full_command@56: full command: b'QEY2023\xa7J\r' 2023-02-02 23:09:02,966:INFO:device:run_command@303: full command b'QEY2023\xa7J\r' for command QEY2023 2023-02-02 23:09:02,966:DEBUG:abstractprotocol:get_command_defn@60: Processing command 'QEY2023' 2023-02-02 23:09:02,966:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: F 2023-02-02 23:09:02,966:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: MCHGC 2023-02-02 23:09:02,966:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: MNCHGC 2023-02-02 23:09:02,967:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: MUCHGC 2023-02-02 23:09:02,967:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBCV 2023-02-02 23:09:02,967:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBDV 2023-02-02 23:09:02,967:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBFT 2023-02-02 23:09:02,967:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBT 2023-02-02 23:09:02,967:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PCP 2023-02-02 23:09:02,968:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PCVV 2023-02-02 23:09:02,968:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PE 2023-02-02 23:09:02,968:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PD 2023-02-02 23:09:02,968:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PGR 2023-02-02 23:09:02,968:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: POP 2023-02-02 23:09:02,968:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: POPLG 2023-02-02 23:09:02,968:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: POPM 2023-02-02 23:09:02,968:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PPCP 2023-02-02 23:09:02,969:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PPVOKC 2023-02-02 23:09:02,969:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PSDV 2023-02-02 23:09:02,969:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PSPB 2023-02-02 23:09:02,969:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBATCD 2023-02-02 23:09:02,969:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: DAT 2023-02-02 23:09:02,969:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBATMAXDISC 2023-02-02 23:09:02,969:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QPGS 2023-02-02 23:09:02,969:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QEY 2023-02-02 23:09:02,970:DEBUG:abstractprotocol:get_command_defn@70: Matched: QEY2023 to: QEY value: 2023 2023-02-02 23:09:03,028:DEBUG:hidrawio:send_and_receive@29: length of to_send: 10 2023-02-02 23:09:03,028:DEBUG:hidrawio:send_and_receive@40: 2 chunk send 2023-02-02 23:09:04,134:DEBUG:hidrawio:send_and_receive@69: usb response was: b'(NAKss\r' 2023-02-02 23:09:04,134:DEBUG:device:run_command@322: Send and Receive Response b'(NAKss\r' 2023-02-02 23:09:04,135:INFO:abstractprotocol:decode@196: response passed to decode: b'(NAKss\r' 2023-02-02 23:09:04,135:INFO:abstractprotocol:decode@200: NAK 2023-02-02 23:09:04,135:INFO:device:run_command@341: Decoded response {'ERROR': ['NAK', '']} 2023-02-02 23:09:04,135:DEBUG:__init__:main@418: results: {'ERROR': ['NAK', '']} 2023-02-02 23:09:04,135:INFO:__init__:get_output@38: attempting to create output processor: screen 2023-02-02 23:09:04,135:DEBUG:screen:__init__@16: processor.screen __init__ kwargs {} 2023-02-02 23:09:04,135:DEBUG:__init__:main@424: Using output filter: None 2023-02-02 23:09:04,136:INFO:screen:output@19: Using output processor: screen 2023-02-02 23:09:04,136:DEBUG:screen:output@20: kwargs {'data': {'ERROR': ['NAK', '']}, 'tag': 'QEY2023', 'name': 'unnamed', 'mqtt_broker': MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar', mqttc=, _isConnected=False), 'udp_port': '5555', 'postgres_url': None, 'mongo_url': None, 'mongo_db': 'mppsolar', 'filter': None, 'excl_filter': None, 'keep_case': False} Parameter Value Unit error NAK 2023-02-02 23:09:04,136:DEBUG:__init__:main@449: Not daemon, so not looping ```

CLICK ME to see collapsed debug for the QED command

```bash $ /usr/local/bin/mpp-solar -p /dev/mppsolarusb/direct/0 -P PI30MAX -b 2400 -c QED20230130 --debug 2023-02-02 23:12:59,691:INFO:__init__:main@218: Solar Device Command Utility, version: 0.14.7 2023-02-02 23:12:59,691:DEBUG:__init__:main@238: MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar', mqttc=, _isConnected=False) 2023-02-02 23:12:59,691:DEBUG:__init__:main@240: udp port 5555 2023-02-02 23:12:59,691:DEBUG:__init__:main@242: Using Postgres None 2023-02-02 23:12:59,691:DEBUG:__init__:main@245: Using Mongo None with mppsolar 2023-02-02 23:12:59,691:INFO:__init__:main@347: Creating device "unnamed" (type: "mppsolar") on port "/dev/mppsolarusb/direct/0 (porttype=None)" using protocol "PI30MAX" 2023-02-02 23:12:59,692:DEBUG:__init__:main@351: device_class 2023-02-02 23:12:59,693:DEBUG:device:__init__@33: __init__ args () 2023-02-02 23:12:59,693:DEBUG:device:__init__@34: __init__ kwargs {'name': 'unnamed', 'port': '/dev/mppsolarusb/direct/0', 'protocol': 'PI30MAX', 'baud': 2400, 'porttype': None, 'mqtt_broker': MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar', mqttc=, _isConnected=False), 'udp_port': '5555', 'mongo_url': None, 'mongo_db': 'mppsolar'} 2023-02-02 23:12:59,693:DEBUG:__init__:get_port_type@42: port matches mppsolar 2023-02-02 23:12:59,693:INFO:__init__:get_port@92: Using hidrawio for communications 2023-02-02 23:12:59,693:DEBUG:__init__:get_protocol@13: Protocol PI30MAX 2023-02-02 23:12:59,695:INFO:pi30max:__init__@967: Using protocol b'PI30MAX' with 61 commands 2023-02-02 23:12:59,695:DEBUG:device:__init__@38: __init__ name unnamed, port , protocol PI30 protocol handler for LV6048MAX and similar inverters 2023-02-02 23:12:59,695:DEBUG:__init__:main@399: Commands [(, 'QED20230130', 'QED20230130', 'screen', None, None)] 2023-02-02 23:12:59,695:INFO:__init__:main@404: Looping 1 commands 2023-02-02 23:12:59,695:INFO:__init__:main@414: Getting results from device: mppsolar device - name: unnamed, port: , protocol: PI30 protocol handler for LV6048MAX and similar inverters for command: QED20230130, tag: QED20230130, outputs: screen 2023-02-02 23:12:59,695:INFO:device:run_command@274: Running command QED20230130 2023-02-02 23:12:59,695:INFO:abstractprotocol:get_full_command@50: Using protocol b'PI30MAX' with 61 commands 2023-02-02 23:12:59,695:DEBUG:protocol_helpers:crcPI@313: Calculating CRC for b'QED20230130' 2023-02-02 23:12:59,695:DEBUG:protocol_helpers:crcPI@363: Generated CRC 0xd4 0x13 0xd413 2023-02-02 23:12:59,695:DEBUG:abstractprotocol:get_full_command@56: full command: b'QED20230130\xd4\x13\r' 2023-02-02 23:12:59,695:INFO:device:run_command@303: full command b'QED20230130\xd4\x13\r' for command QED20230130 2023-02-02 23:12:59,695:DEBUG:abstractprotocol:get_command_defn@60: Processing command 'QED20230130' 2023-02-02 23:12:59,695:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: F 2023-02-02 23:12:59,696:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: MCHGC 2023-02-02 23:12:59,696:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: MNCHGC 2023-02-02 23:12:59,696:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: MUCHGC 2023-02-02 23:12:59,696:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBCV 2023-02-02 23:12:59,696:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBDV 2023-02-02 23:12:59,696:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBFT 2023-02-02 23:12:59,696:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBT 2023-02-02 23:12:59,696:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PCP 2023-02-02 23:12:59,697:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PCVV 2023-02-02 23:12:59,697:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PE 2023-02-02 23:12:59,697:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PD 2023-02-02 23:12:59,697:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PGR 2023-02-02 23:12:59,697:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: POP 2023-02-02 23:12:59,697:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: POPLG 2023-02-02 23:12:59,697:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: POPM 2023-02-02 23:12:59,697:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PPCP 2023-02-02 23:12:59,697:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PPVOKC 2023-02-02 23:12:59,698:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PSDV 2023-02-02 23:12:59,698:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PSPB 2023-02-02 23:12:59,698:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBATCD 2023-02-02 23:12:59,698:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: DAT 2023-02-02 23:12:59,698:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBATMAXDISC 2023-02-02 23:12:59,698:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QPGS 2023-02-02 23:12:59,698:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QEY 2023-02-02 23:12:59,698:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QEM 2023-02-02 23:12:59,699:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QED 2023-02-02 23:12:59,699:DEBUG:abstractprotocol:get_command_defn@70: Matched: QED20230130 to: QED value: 20230130 2023-02-02 23:12:59,756:DEBUG:hidrawio:send_and_receive@29: length of to_send: 14 2023-02-02 23:12:59,756:DEBUG:hidrawio:send_and_receive@47: multiple chunk send 2023-02-02 23:12:59,756:DEBUG:hidrawio:send_and_receive@50: send: b'QED20230', to_send: b'130\xd4\x13\r' 2023-02-02 23:13:00,108:DEBUG:hidrawio:send_and_receive@47: multiple chunk send 2023-02-02 23:13:00,108:DEBUG:hidrawio:send_and_receive@50: send: b'130\xd4\x13\r', to_send: b'' 2023-02-02 23:13:00,862:DEBUG:hidrawio:send_and_receive@69: usb response was: b'(NAKss\r' 2023-02-02 23:13:00,863:DEBUG:device:run_command@322: Send and Receive Response b'(NAKss\r' 2023-02-02 23:13:00,863:INFO:abstractprotocol:decode@196: response passed to decode: b'(NAKss\r' 2023-02-02 23:13:00,863:INFO:abstractprotocol:decode@200: NAK 2023-02-02 23:13:00,863:INFO:device:run_command@341: Decoded response {'ERROR': ['NAK', '']} 2023-02-02 23:13:00,863:DEBUG:__init__:main@418: results: {'ERROR': ['NAK', '']} 2023-02-02 23:13:00,863:INFO:__init__:get_output@38: attempting to create output processor: screen 2023-02-02 23:13:00,863:DEBUG:screen:__init__@16: processor.screen __init__ kwargs {} 2023-02-02 23:13:00,864:DEBUG:__init__:main@424: Using output filter: None 2023-02-02 23:13:00,864:INFO:screen:output@19: Using output processor: screen 2023-02-02 23:13:00,864:DEBUG:screen:output@20: kwargs {'data': {'ERROR': ['NAK', '']}, 'tag': 'QED20230130', 'name': 'unnamed', 'mqtt_broker': MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar', mqttc=, _isConnected=False), 'udp_port': '5555', 'postgres_url': None, 'mongo_url': None, 'mongo_db': 'mppsolar', 'filter': None, 'excl_filter': None, 'keep_case': False} Parameter Value Unit error NAK 2023-02-02 23:13:00,864:DEBUG:__init__:main@449: Not daemon, so not looping ```

CLICK ME to see collapsed debug for the QLY command

```bash $ /usr/local/bin/mpp-solar -p /dev/mppsolarusb/direct/0 -P PI30MAX -b 2400 -c QLY2023 --debug 2023-02-02 23:15:03,853:INFO:__init__:main@218: Solar Device Command Utility, version: 0.14.7 2023-02-02 23:15:03,854:DEBUG:__init__:main@238: MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar', mqttc=, _isConnected=False) 2023-02-02 23:15:03,854:DEBUG:__init__:main@240: udp port 5555 2023-02-02 23:15:03,854:DEBUG:__init__:main@242: Using Postgres None 2023-02-02 23:15:03,854:DEBUG:__init__:main@245: Using Mongo None with mppsolar 2023-02-02 23:15:03,854:INFO:__init__:main@347: Creating device "unnamed" (type: "mppsolar") on port "/dev/mppsolarusb/direct/0 (porttype=None)" using protocol "PI30MAX" 2023-02-02 23:15:03,855:DEBUG:__init__:main@351: device_class 2023-02-02 23:15:03,855:DEBUG:device:__init__@33: __init__ args () 2023-02-02 23:15:03,855:DEBUG:device:__init__@34: __init__ kwargs {'name': 'unnamed', 'port': '/dev/mppsolarusb/direct/0', 'protocol': 'PI30MAX', 'baud': 2400, 'porttype': None, 'mqtt_broker': MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar', mqttc=, _isConnected=False), 'udp_port': '5555', 'mongo_url': None, 'mongo_db': 'mppsolar'} 2023-02-02 23:15:03,855:DEBUG:__init__:get_port_type@42: port matches mppsolar 2023-02-02 23:15:03,855:INFO:__init__:get_port@92: Using hidrawio for communications 2023-02-02 23:15:03,855:DEBUG:__init__:get_protocol@13: Protocol PI30MAX 2023-02-02 23:15:03,857:INFO:pi30max:__init__@967: Using protocol b'PI30MAX' with 61 commands 2023-02-02 23:15:03,857:DEBUG:device:__init__@38: __init__ name unnamed, port , protocol PI30 protocol handler for LV6048MAX and similar inverters 2023-02-02 23:15:03,857:DEBUG:__init__:main@399: Commands [(, 'QLY2023', 'QLY2023', 'screen', None, None)] 2023-02-02 23:15:03,857:INFO:__init__:main@404: Looping 1 commands 2023-02-02 23:15:03,857:INFO:__init__:main@414: Getting results from device: mppsolar device - name: unnamed, port: , protocol: PI30 protocol handler for LV6048MAX and similar inverters for command: QLY2023, tag: QLY2023, outputs: screen 2023-02-02 23:15:03,857:INFO:device:run_command@274: Running command QLY2023 2023-02-02 23:15:03,857:INFO:abstractprotocol:get_full_command@50: Using protocol b'PI30MAX' with 61 commands 2023-02-02 23:15:03,857:DEBUG:protocol_helpers:crcPI@313: Calculating CRC for b'QLY2023' 2023-02-02 23:15:03,857:DEBUG:protocol_helpers:crcPI@363: Generated CRC 0xef 0xa8 0xefa8 2023-02-02 23:15:03,857:DEBUG:abstractprotocol:get_full_command@56: full command: b'QLY2023\xef\xa8\r' 2023-02-02 23:15:03,857:INFO:device:run_command@303: full command b'QLY2023\xef\xa8\r' for command QLY2023 2023-02-02 23:15:03,857:DEBUG:abstractprotocol:get_command_defn@60: Processing command 'QLY2023' 2023-02-02 23:15:03,857:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: F 2023-02-02 23:15:03,857:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: MCHGC 2023-02-02 23:15:03,858:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: MNCHGC 2023-02-02 23:15:03,858:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: MUCHGC 2023-02-02 23:15:03,858:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBCV 2023-02-02 23:15:03,858:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBDV 2023-02-02 23:15:03,858:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBFT 2023-02-02 23:15:03,858:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBT 2023-02-02 23:15:03,858:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PCP 2023-02-02 23:15:03,858:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PCVV 2023-02-02 23:15:03,859:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PE 2023-02-02 23:15:03,859:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PD 2023-02-02 23:15:03,859:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PGR 2023-02-02 23:15:03,859:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: POP 2023-02-02 23:15:03,859:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: POPLG 2023-02-02 23:15:03,859:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: POPM 2023-02-02 23:15:03,859:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PPCP 2023-02-02 23:15:03,860:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PPVOKC 2023-02-02 23:15:03,860:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PSDV 2023-02-02 23:15:03,860:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PSPB 2023-02-02 23:15:03,860:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBATCD 2023-02-02 23:15:03,860:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: DAT 2023-02-02 23:15:03,861:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBATMAXDISC 2023-02-02 23:15:03,861:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QPGS 2023-02-02 23:15:03,861:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QEY 2023-02-02 23:15:03,861:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QEM 2023-02-02 23:15:03,861:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QED 2023-02-02 23:15:03,861:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QLY 2023-02-02 23:15:03,861:DEBUG:abstractprotocol:get_command_defn@70: Matched: QLY2023 to: QLY value: 2023 2023-02-02 23:15:03,920:DEBUG:hidrawio:send_and_receive@29: length of to_send: 10 2023-02-02 23:15:03,920:DEBUG:hidrawio:send_and_receive@40: 2 chunk send 2023-02-02 23:15:05,025:DEBUG:hidrawio:send_and_receive@69: usb response was: b'(NAKss\r' 2023-02-02 23:15:05,025:DEBUG:device:run_command@322: Send and Receive Response b'(NAKss\r' 2023-02-02 23:15:05,026:INFO:abstractprotocol:decode@196: response passed to decode: b'(NAKss\r' 2023-02-02 23:15:05,026:INFO:abstractprotocol:decode@200: NAK 2023-02-02 23:15:05,026:INFO:device:run_command@341: Decoded response {'ERROR': ['NAK', '']} 2023-02-02 23:15:05,026:DEBUG:__init__:main@418: results: {'ERROR': ['NAK', '']} 2023-02-02 23:15:05,026:INFO:__init__:get_output@38: attempting to create output processor: screen 2023-02-02 23:15:05,026:DEBUG:screen:__init__@16: processor.screen __init__ kwargs {} 2023-02-02 23:15:05,026:DEBUG:__init__:main@424: Using output filter: None 2023-02-02 23:15:05,027:INFO:screen:output@19: Using output processor: screen 2023-02-02 23:15:05,027:DEBUG:screen:output@20: kwargs {'data': {'ERROR': ['NAK', '']}, 'tag': 'QLY2023', 'name': 'unnamed', 'mqtt_broker': MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar', mqttc=, _isConnected=False), 'udp_port': '5555', 'postgres_url': None, 'mongo_url': None, 'mongo_db': 'mppsolar', 'filter': None, 'excl_filter': None, 'keep_case': False} Parameter Value Unit error NAK 2023-02-02 23:15:05,027:DEBUG:__init__:main@449: Not daemon, so not looping ```

CLICK ME to see collapsed debug for the QLD command

```bash $ /usr/local/bin/mpp-solar -p /dev/mppsolarusb/direct/0 -P PI30MAX -b 2400 -c QLD20230130 --debug 2023-02-02 23:19:32,025:INFO:__init__:main@218: Solar Device Command Utility, version: 0.14.7 2023-02-02 23:19:32,025:DEBUG:__init__:main@238: MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar', mqttc=, _isConnected=False) 2023-02-02 23:19:32,025:DEBUG:__init__:main@240: udp port 5555 2023-02-02 23:19:32,025:DEBUG:__init__:main@242: Using Postgres None 2023-02-02 23:19:32,025:DEBUG:__init__:main@245: Using Mongo None with mppsolar 2023-02-02 23:19:32,025:INFO:__init__:main@347: Creating device "unnamed" (type: "mppsolar") on port "/dev/mppsolarusb/direct/0 (porttype=None)" using protocol "PI30MAX" 2023-02-02 23:19:32,026:DEBUG:__init__:main@351: device_class 2023-02-02 23:19:32,026:DEBUG:device:__init__@33: __init__ args () 2023-02-02 23:19:32,026:DEBUG:device:__init__@34: __init__ kwargs {'name': 'unnamed', 'port': '/dev/mppsolarusb/direct/0', 'protocol': 'PI30MAX', 'baud': 2400, 'porttype': None, 'mqtt_broker': MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar', mqttc=, _isConnected=False), 'udp_port': '5555', 'mongo_url': None, 'mongo_db': 'mppsolar'} 2023-02-02 23:19:32,026:DEBUG:__init__:get_port_type@42: port matches mppsolar 2023-02-02 23:19:32,026:INFO:__init__:get_port@92: Using hidrawio for communications 2023-02-02 23:19:32,027:DEBUG:__init__:get_protocol@13: Protocol PI30MAX 2023-02-02 23:19:32,028:INFO:pi30max:__init__@967: Using protocol b'PI30MAX' with 61 commands 2023-02-02 23:19:32,028:DEBUG:device:__init__@38: __init__ name unnamed, port , protocol PI30 protocol handler for LV6048MAX and similar inverters 2023-02-02 23:19:32,028:DEBUG:__init__:main@399: Commands [(, 'QLD20230130', 'QLD20230130', 'screen', None, None)] 2023-02-02 23:19:32,028:INFO:__init__:main@404: Looping 1 commands 2023-02-02 23:19:32,028:INFO:__init__:main@414: Getting results from device: mppsolar device - name: unnamed, port: , protocol: PI30 protocol handler for LV6048MAX and similar inverters for command: QLD20230130, tag: QLD20230130, outputs: screen 2023-02-02 23:19:32,028:INFO:device:run_command@274: Running command QLD20230130 2023-02-02 23:19:32,028:INFO:abstractprotocol:get_full_command@50: Using protocol b'PI30MAX' with 61 commands 2023-02-02 23:19:32,029:DEBUG:protocol_helpers:crcPI@313: Calculating CRC for b'QLD20230130' 2023-02-02 23:19:32,029:DEBUG:protocol_helpers:crcPI@363: Generated CRC 0xf1 0x1d 0xf11d 2023-02-02 23:19:32,029:DEBUG:abstractprotocol:get_full_command@56: full command: b'QLD20230130\xf1\x1d\r' 2023-02-02 23:19:32,029:INFO:device:run_command@303: full command b'QLD20230130\xf1\x1d\r' for command QLD20230130 2023-02-02 23:19:32,029:DEBUG:abstractprotocol:get_command_defn@60: Processing command 'QLD20230130' 2023-02-02 23:19:32,029:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: F 2023-02-02 23:19:32,029:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: MCHGC 2023-02-02 23:19:32,029:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: MNCHGC 2023-02-02 23:19:32,029:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: MUCHGC 2023-02-02 23:19:32,029:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBCV 2023-02-02 23:19:32,029:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBDV 2023-02-02 23:19:32,029:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBFT 2023-02-02 23:19:32,029:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBT 2023-02-02 23:19:32,030:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PCP 2023-02-02 23:19:32,030:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PCVV 2023-02-02 23:19:32,030:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PE 2023-02-02 23:19:32,030:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PD 2023-02-02 23:19:32,030:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PGR 2023-02-02 23:19:32,030:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: POP 2023-02-02 23:19:32,030:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: POPLG 2023-02-02 23:19:32,030:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: POPM 2023-02-02 23:19:32,031:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PPCP 2023-02-02 23:19:32,031:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PPVOKC 2023-02-02 23:19:32,031:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PSDV 2023-02-02 23:19:32,031:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PSPB 2023-02-02 23:19:32,031:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBATCD 2023-02-02 23:19:32,031:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: DAT 2023-02-02 23:19:32,031:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: PBATMAXDISC 2023-02-02 23:19:32,031:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QPGS 2023-02-02 23:19:32,032:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QEY 2023-02-02 23:19:32,032:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QEM 2023-02-02 23:19:32,032:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QED 2023-02-02 23:19:32,032:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QLY 2023-02-02 23:19:32,032:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QLM 2023-02-02 23:19:32,032:DEBUG:abstractprotocol:get_command_defn@66: Regex commands _command: QLD 2023-02-02 23:19:32,032:DEBUG:abstractprotocol:get_command_defn@70: Matched: QLD20230130 to: QLD value: 20230130 2023-02-02 23:19:32,092:DEBUG:hidrawio:send_and_receive@29: length of to_send: 14 2023-02-02 23:19:32,092:DEBUG:hidrawio:send_and_receive@47: multiple chunk send 2023-02-02 23:19:32,092:DEBUG:hidrawio:send_and_receive@50: send: b'QLD20230', to_send: b'130\xf1\x1d\r' 2023-02-02 23:19:32,444:DEBUG:hidrawio:send_and_receive@47: multiple chunk send 2023-02-02 23:19:32,444:DEBUG:hidrawio:send_and_receive@50: send: b'130\xf1\x1d\r', to_send: b'' 2023-02-02 23:19:33,198:DEBUG:hidrawio:send_and_receive@69: usb response was: b'(NAKss\r' 2023-02-02 23:19:33,199:DEBUG:device:run_command@322: Send and Receive Response b'(NAKss\r' 2023-02-02 23:19:33,199:INFO:abstractprotocol:decode@196: response passed to decode: b'(NAKss\r' 2023-02-02 23:19:33,199:INFO:abstractprotocol:decode@200: NAK 2023-02-02 23:19:33,199:INFO:device:run_command@341: Decoded response {'ERROR': ['NAK', '']} 2023-02-02 23:19:33,199:DEBUG:__init__:main@418: results: {'ERROR': ['NAK', '']} 2023-02-02 23:19:33,199:INFO:__init__:get_output@38: attempting to create output processor: screen 2023-02-02 23:19:33,199:DEBUG:screen:__init__@16: processor.screen __init__ kwargs {} 2023-02-02 23:19:33,200:DEBUG:__init__:main@424: Using output filter: None 2023-02-02 23:19:33,200:INFO:screen:output@19: Using output processor: screen 2023-02-02 23:19:33,200:DEBUG:screen:output@20: kwargs {'data': {'ERROR': ['NAK', '']}, 'tag': 'QLD20230130', 'name': 'unnamed', 'mqtt_broker': MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar', mqttc=, _isConnected=False), 'udp_port': '5555', 'postgres_url': None, 'mongo_url': None, 'mongo_db': 'mppsolar', 'filter': None, 'excl_filter': None, 'keep_case': False} Parameter Value Unit error NAK 2023-02-02 23:19:33,200:DEBUG:__init__:main@449: Not daemon, so not looping ```

You had asked one other time what commands would be important to me to implement. I realized that the QED and QLD daily total would be very important to me as these could be queried at timed intervals to see the input or output during a period by subtracting the previous total. Thanks again for all your work on this project! Frederick

Saentist commented 1 year ago

@frederickjh what return your inverter with this command QPI#QMN#QGMN https://github.com/jblance/mpp-solar/wiki/Protocol-Recommendations

frederickjh commented 1 year ago

@Saentist

$ /usr/local/bin/mpp-solar -p /dev/mppsolarusb/direct/0 -P PI30MAX -b 2400 -c QPI#QMN#QGMN                                           
Processing DEFAULT type responses
Command: QPI - Protocol ID inquiry
------------------------------------------------------------
Parameter                       Value           Unit
protocol_id                     PI30                
Command: QMN - Model Name Inquiry
------------------------------------------------------------
Parameter                       Value           Unit
model_name                      MKS2-8000           
Command: QGMN - No description found
------------------------------------------------------------
Parameter                       Value           Unit
warning                         No definition for command QGMN in protocol b'PI30MAX'       
                                (044È®
$ /usr/local/bin/mpp-solar -p /dev/mppsolarusb/direct/0 -P PI30 -b 2400 -c QPI#QMN#QGMN 
Processing DEFAULT type responses
Command: QPI - Protocol ID inquiry
------------------------------------------------------------
Parameter                       Value           Unit
protocol_id                     PI30                
Command: QMN - No description found
------------------------------------------------------------
Parameter                       Value           Unit
  rning                         No definition for command QMN in protocol b'PI30'       
Command: QGMN - No description found2-8000²
------------------------------------------------------------
Parameter                       Value           Unit
warning                         No definition for command QGMN in protocol b'PI30'      
                                (044È®
Saentist commented 1 year ago

@frederickjh PI30-044:MKS2-8000 @jblance some docs about inverter protocol, xlsx files ;)

frederickjh commented 1 year ago

@frederickjh PI30-044:MKS2-8000

@Saentist not sure what I should do with that information. I already saw that information in the wiki you linked. I am guessing that it the original manufactures model number.

Saentist commented 1 year ago

@frederickjh Information is important because each device support different command set. Just simple firmware update can change supported commands aka can add or remove commands on exact same model.

tomiczech commented 1 year ago

I found this: https://powerforum.co.za/topic/16996-reading-pv2-input-for-kodak-og72-qpigs2-returning-nak/

I have MAX with SolPipLog and it is working over direct USB connection. https://github.com/njfaria/SolPipLog/issues/61 With mpp-solar i get NAK.

So there is problem with mpp-solar.

jblance commented 1 year ago

found and fixed issue with hidraw io for commands longer than 5 chars - in latest branch