jblance / mpp-solar

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

communication not working #41

Closed jec0408 closed 3 years ago

jec0408 commented 3 years ago

Hi

I´m having some problems with communicating with the inverter its connected Raspberry pi3+ direct usb inverter. I was hoping if you could help me..

usb 1-1.5: new low-speed USB device number 6 using dwc_otg
[  196.244185] usb 1-1.5: New USB device found, idVendor=0665, idProduct=5161, bcdDevice= 0.02
[  196.244196] usb 1-1.5: New USB device strings: Mfr=3, Product=1, SerialNumber=0
[  196.256988] hid-generic 0003:0665:5161.0002: hiddev96,hidraw0: USB HID v1.11 Device [HID 0665:5161] on usb-3f980000.usb-1.5/input0
pi@raspberrypi:~ $ lsusb
Bus 001 Device 006: ID 0665:5161 Cypress Semiconductor USB to Serial
Bus 001 Device 005: ID 058f:6387 Alcor Micro Corp. Flash Drive
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Check service status systemctl --user status mpp-solar

mpp-solar.service - MPP Solar Service
   Loaded: loaded (/etc/systemd/user/mpp-solar.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-11-23 12:17:33 CET; 1min 4s ago
 Main PID: 586 (python3)
   CGroup: /user.slice/user-1000.slice/user@1000.service/mpp-solar.service
           └─586 /usr/bin/python3 /usr/local/bin/mpp-solar-service -c /etc/mpp-solar/mpp-solar.conf

nov 23 12:17:23 raspberrypi systemd[511]: Starting MPP Solar Service...
nov 23 12:17:33 raspberrypi python3[586]: MPP-Solar-Service: Initializing ...
nov 23 12:17:33 raspberrypi python3[586]: MPP-Solar-Service: Config file: /etc/mpp-solar/mpp-solar.conf
nov 23 12:17:33 raspberrypi python3[586]: MPP-Solar-Service: Config setting - pause: 5
nov 23 12:17:33 raspberrypi python3[586]: MPP-Solar-Service: Config setting - mqtt_broker: localhost
nov 23 12:17:33 raspberrypi python3[586]: MPP-Solar-Service: Config setting - command sections found: 1
nov 23 12:17:33 raspberrypi python3[586]: MPP-Solar-Service: item {'mp': <mppsolar.mpputils.mppUtils object at 0x75c56770>, 'command': 'QPGS', 'format': '
nov 23 12:17:33 raspberrypi systemd[511]: Started MPP Solar Service.
nov 23 12:17:33 raspberrypi python3[586]: CRITICAL:MPP-Solar:Command not found
pi@raspberrypi:~ $ sudo mpp-solar -M LV5161 -d /dev/ttyUSB0 -c QPIGS
WARNING:MPP-Solar:Serial read error: [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'
error                           No byte_response 
pi@raspberrypi:~ $ 
pi@raspberrypi:~ $ mpp-solar -M LV5161 -d /dev/hidraw0 -c QPIGS
error                           Invalid byte_response 
response                        NAK             
pi@raspberrypi:~ $ 

when connecting other stuff to USB port it shows up as AMA0

pi@raspberrypi:~ $ sudo mpp-solar -M LV5161 -d /dev/ttyAMA0 -c QPIGS
WARNING:MPP-Solar:Serial read error: Write timeout
error                           No byte_response 

my set up

[SETUP]
# Number of seconds to pause between command execution loop
# 0 is no pause, greater than 60 will cause service restarts
pause=5
mqtt_broker=localhost

[Inverter_1_L1]
model=standard
port=/dev/mppsolar/direct/0
baud=2400
command=QPGS
tag=Inverter1
format=influx2
jblance commented 3 years ago

Yeah for testing

jec0408 commented 3 years ago

pi@raspberrypi:~/mpp-solar $ mpp-solar -C /etc/mpp-solar/mpp-solar.conf -I INFO:MPP-Solar:MPP Solar Command Utility, version: 0.7.8, Refactored version - not backwards compatible, add jkbms (02 and 04) support INFO:MPP-Solar:Using hidrawio for communications INFO:MPP-Solar:Command line using config file: /etc/mpp-solar/mpp-solar.conf INFO:MPP-Solar:Running command QPIGS INFO:MPP-Solar:Using protocol b'PI16' with 6 commands INFO:MPP-Solar:full command b'QPIGS\r' for command QPIGS INFO:MPP-Solar:response passed to decode: b'(230.9 100047 50.0 0000.0 000.0 00000 00.0 000.0 000 398.1 398.1 047.9 ---.- 043 00000 00000 ----- 018.0 ---.- ---.- 036.0 D---000200\x1a\xa0\r' INFO:MPP-Solar:Decoded response {'grid_voltage': [230.9, 'V'], 'output_power': [100047, 'W'], 'grid_frequency': [50.0, 'Hz'], 'output_current': [0.0, 'A'], 'ac_output_voltage_r': [0.0, 'V'], 'ac_output_power_r': [0, 'W'], 'ac_output_frequency': [0.0, 'Hz'], 'ac_output_current_r': [0.0, 'A'], 'output_load_percent': [0, '%'], 'pbus_voltage': [398.1, 'V'], 'sbus_voltage': [398.1, 'V'], 'positive_battery_voltage': [47.9, 'V'], 'negative_battery_voltage': [0.0, 'V'], 'battery_capacity': [43, '%'], 'pv1_input_power': [0, 'W'], 'pv2_input_power': [0, 'W'], 'pv3_input_power': [0, 'W'], 'pv1_input_voltage': [18.0, 'V'], 'pv2_input_voltage': [0.0, 'V'], 'pv3_input_voltage': [0.0, 'V'], 'max_temperature': [36.0, '°C'], 'status_todo': ['D---000200', ''], '_command': 'QPIGS', '_command_description': 'General status query'} INFO:MPP-Solar:attempting to create output processor: screen INFO:MPP-Solar:Using output processor: screen Command: QPIGS - General status query

Parameter Value Unit grid_voltage 230.9 V
output_power 100047 W
grid_frequency 50.0 Hz
output_current 0.0 A
ac_output_voltage_r 0.0 V
ac_output_power_r 0 W
ac_output_frequency 0.0 Hz
ac_output_current_r 0.0 A
output_load_percent 0 %
pbus_voltage 398.1 V
sbus_voltage 398.1 V
positive_battery_voltage 47.9 V
negative_battery_voltage 0.0 V
battery_capacity 43 %
pv1_input_power 0 W
pv2_input_power 0 W
pv3_input_power 0 W
pv1_input_voltage 18.0 V
pv2_input_voltage 0.0 V
pv3_input_voltage 0.0 V
max_temperature 36.0 °C
status_todo D---000200
pi@raspberrypi:~/mpp-solar $

jblance commented 3 years ago

Once we see this working will use outputs=influx2_mqtt

jblance commented 3 years ago

Looks good, try with above and check the mqtt broker to make sure you are getting the messages you expect

jec0408 commented 3 years ago

wow now I can se data coming in to database mppsolar. and also in grafana.... wow thanks... now i just need to make a set up for view this info. :)

Is there anything you want me to test? ore you want me to test in the future for devilment just say so :)

jblance commented 3 years ago

Great news Nothing else at the moment, let me know if you find anything wrong or if you have suggestions for improvements

On Sun, 20 Dec 2020, 10:44 am jec0408, notifications@github.com wrote:

wow now I can se data coming in to database mppsolar. and also in grafana.... wow thanks... now i just need to make a set up for view this info. :)

Is there anything you want me to test? ore you want me to test in the future for devilment just say so :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/41#issuecomment-748529515, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNTSXGZMJHAZOTNIP3DSVUNETANCNFSM4T7MM6HQ .