Closed irmajavi closed 1 year ago
You need to determine where the inverter connection is in the Linux environment, try dmesg
just after plugging the inverter cable into the Linux device to see where it gets connected
For mppsolar issues add -I
to the command to get more info and post the results. The QPI or PI command is a good start to make sure you are using the correct protocol
Post the full output as it will help diagnose what is wrong (and if you are PI16 then it is probably some bugs as that protocol hasn't had much testing)
rock64@rock64:~$ dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
...snip...
[ 934.302562] usb 3-1: USB disconnect, device number 2
[ 934.303608] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 934.303705] ch341 3-1:1.0: device disconnected
[ 942.661469] usb 4-1: new full-speed USB device number 2 using xhci-hcd
[ 942.790494] usb 4-1: New USB device found, idVendor=1a86, idProduct=7523
[ 942.790527] usb 4-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 942.790550] usb 4-1: Product: USB Serial
[ 942.795399] ch341 4-1:1.0: ch341-uart converter detected
[ 942.797504] usb 4-1: ch341-uart converter now attached to ttyUSB0
[ 5760.934376] usb 4-1: USB disconnect, device number 2
[ 5760.935812] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 5760.935926] ch341 4-1:1.0: device disconnected
[ 6156.977979] usb 3-1: new full-speed USB device number 3 using ohci-platform
[ 6157.182375] usb 3-1: New USB device found, idVendor=1a86, idProduct=7523
[ 6157.182392] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 6157.182401] usb 3-1: Product: USB Serial
[ 6157.184843] ch341 3-1:1.0: ch341-uart converter detected
[ 6157.208817] usb 3-1: ch341-uart converter now attached to ttyUSB0
rock64@rock64:~$ mpp-solar -P PI16 -c QPI -p /dev/ttyUSB0 -I
2021-08-16 21:32:19,270:INFO:__init__:main@236: Solar Device Command Utility, version: 0.7.76, remove brackets in ved protocol
2021-08-16 21:32:19,271:INFO:__init__:main@340: Creating device "unnamed" (type: "mppsolar") on port "/dev/ttyUSB0 (porttype=None)" using protocol "PI16"
2021-08-16 21:32:19,277:INFO:device:set_port@160: Using serialio for communications
2021-08-16 21:32:19,347:INFO:__init__:main@395: Looping 1 commands
2021-08-16 21:32:19,347:INFO:__init__:main@406: Getting results from device: mppsolar device - name: unnamed, port: <mppsolar.io.serialio.SerialIO object at 0xf6430db0>, protocol: <mppsolar.protocols.pi16.pi16 object at 0xf6430d30> for command: QPI, tag: QPI, outputs: screen
2021-08-16 21:32:19,348:INFO:device:run_command@270: Running command QPI
2021-08-16 21:32:19,348:INFO:pi16:get_full_command@180: Using protocol b'PI16' with 6 commands
2021-08-16 21:32:19,349:INFO:device:run_command@296: full command b'QPI\r' for command QPI
2021-08-16 21:32:20,497:INFO:abstractprotocol:decode@175: response passed to decode: b''
2021-08-16 21:32:20,498:INFO:abstractprotocol:decode@215: Processing response of type SEQUENTIAL
2021-08-16 21:32:20,499:INFO:device:run_command@334: Decoded response {'raw_response': ['', ''], '_command': 'QPI', '_command_description': 'Device Protocol Version inquiry', 'Protocol Version': ['', '']}
2021-08-16 21:32:20,500:INFO:__init__:get_outputs@26: attempting to create output processor: screen
2021-08-16 21:32:20,509:INFO:screen:output@19: Using output processor: screen
Command: QPI - Device Protocol Version inquiry
------------------------------------------------------------
Parameter Value Unit
protocol_version
So it is connected on ttyUSB0
What inverter are you using?
its from srne
QPI doesnt work for PI16 - try PI
srne
What model? Do you know that it supports PI16 protocol?
rock64@rock64:~$ mpp-solar -P PI16 -c PI -p /dev/ttyUSB0 -I
2021-08-16 21:33:16,525:INFO:__init__:main@236: Solar Device Command Utility, version: 0.7.76, remove brackets in ved protocol
2021-08-16 21:33:16,525:INFO:__init__:main@340: Creating device "unnamed" (type: "mppsolar") on port "/dev/ttyUSB0 (porttype=None)" using protocol "PI16"
2021-08-16 21:33:16,531:INFO:device:set_port@160: Using serialio for communications
2021-08-16 21:33:16,601:INFO:__init__:main@395: Looping 1 commands
2021-08-16 21:33:16,602:INFO:__init__:main@406: Getting results from device: mppsolar device - name: unnamed, port: <mppsolar.io.serialio.SerialIO object at 0xf69d4db0>, protocol: <mppsolar.protocols.pi16.pi16 object at 0xf69d4d30> for command: PI, tag: PI, outputs: screen
2021-08-16 21:33:16,602:INFO:device:run_command@270: Running command PI
2021-08-16 21:33:16,603:INFO:pi16:get_full_command@180: Using protocol b'PI16' with 6 commands
2021-08-16 21:33:16,604:INFO:abstractprotocol:get_command_defn@57: No command_defn found for PI
2021-08-16 21:33:16,604:INFO:device:run_command@296: full command b'PI\r' for command PI
2021-08-16 21:33:16,605:INFO:abstractprotocol:get_command_defn@57: No command_defn found for PI
2021-08-16 21:33:17,753:INFO:abstractprotocol:decode@175: response passed to decode: b''
2021-08-16 21:33:17,754:INFO:abstractprotocol:get_command_defn@57: No command_defn found for PI
2021-08-16 21:33:17,755:INFO:device:run_command@334: Decoded response {'raw_response': ['', ''], '_command': 'PI', 'WARNING': ["No definition for command PI in protocol b'PI16'", ''], 'response': ['', '']}
2021-08-16 21:33:17,755:INFO:__init__:get_outputs@26: attempting to create output processor: screen
2021-08-16 21:33:17,764:INFO:screen:output@19: Using output processor: screen
Command: PI - No description found
------------------------------------------------------------
Parameter Value Unit
warning No definition for command PI in protocol b'PI16'
response
I tried all protocols but not response. Which one you suggest?
PI30 is the most common in use from mpp-solar activity
SRNE Model HF4835U80-145
rock64@rock64:~$ mpp-solar -P PI30 -c QPI -p /dev/ttyUSB0 -I 2021-08-16 21:40:20,039:INFO:init:main@236: Solar Device Command Utility, version: 0.7.76, remove brackets in ved protocol 2021-08-16 21:40:20,040:INFO:init:main@340: Creating device "unnamed" (type: "mppsolar") on port "/dev/ttyUSB0 (porttype=None)" using protocol "PI30" 2021-08-16 21:40:20,045:INFO:device:set_port@160: Using serialio for communications 2021-08-16 21:40:20,117:INFO:init:main@395: Looping 1 commands 2021-08-16 21:40:20,118:INFO:init:main@406: Getting results from device: mppsolar device - name: unnamed, port: <mppsolar.io.serialio.SerialIO object at 0xf6a89db0>, protocol: <mppsolar.protocols.pi30.pi30 object at 0xf6a89d30> for command: QPI, tag: QPI, outputs: screen 2021-08-16 21:40:20,118:INFO:device:run_command@270: Running command QPI 2021-08-16 21:40:20,119:INFO:abstractprotocol:get_full_command@31: Using protocol b'PI30' with 36 commands 2021-08-16 21:40:20,119:INFO:device:run_command@296: full command b'QPI\xbe\xac\r' for command QPI 2021-08-16 21:40:21,266:INFO:abstractprotocol:decode@175: response passed to decode: b'' 2021-08-16 21:40:21,267:INFO:abstractprotocol:decode@179: Response to short 2021-08-16 21:40:21,268:INFO:device:run_command@334: Decoded response {'ERROR': ['Response to short', '']} 2021-08-16 21:40:21,269:INFO:init:get_outputs@26: attempting to create output processor: screen 2021-08-16 21:40:21,277:INFO:screen:output@19: Using output processor: screen Parameter Value Unit error Response to short
doesnt look like it uses the protocols that are supported by mpp-solar so far
Oh really, I bought another inverter a few months ago and I use this program mpp-solar with it because is so cool and I thought it might work with this one too.
well it probably can work, we just need to find the protocol and implement it if it is not currently supported
It claims 'Supply of a variety of user-friendly communication modules, such as RS485(GPRS, WiFi, Bluetooth), CAN, USB etc., and suitable for computer, mobile phones, Internet monitoring as well as remote operations' Can you ask the supplier for the communication protocol definition?
Yes I can do that. If I get a response I will post it here.
you could try something like:
import serial
ser = serial.Serial('/dev/ttyUSB0', 19200, timeout=1)
print(ser)
ser.write(':010310010001EA\r\n')
print(repr(ser.read(1000))) # Read 1000 bytes, or wait for timeout
and see what response you get
which program should I use to write and execute the code?
just use an editor to put it into a file like test.py
and then run it
with python3 test.py
On Tue, 17 Aug 2021 at 14:13, irmajavi @.***> wrote:
which program should I use to write and execute the code?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/140#issuecomment-899940395, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNS6LF5UAPCWIA5YQ43T5HAS5ANCNFSM5CIX2TGQ .
rock64@rock64:~/Documents$ python3 test.py
Serial
I get a response from SRNE, they send me this file:
ok, well that helps the code doesnt have any modbus protocols at the moment and i dont have any modbus devices myself, so if you are interested in this in mpp-solar it will be a lot of testing on your part and will likely take a while. Are you up for that?
Yeah I can do that and not just me, other people can benefit from this.
I also have this HF4835U80-145 unit. Was communication with this device ever solved? So far I'm not having any luck with the USB port or my generic FTDI serial adapter in the RS485 port, but I have no documentation to go off.
I write my own python script and is working fine. It need improvement but it work for my needs. It is a script that send that data from the inverter to an mqtt server. This type of inverter use Modbus for communicate that is why mpp-solar is not working. If you have programming skills you can modified for your needs.
I write my own python script and is working fine. It need improvement but it work for my needs. It is a script that send that data from the inverter to an mqtt server. This type of inverter use Modbus for communicate that is why mpp-solar is not working. If you have programming skills you can modified for your needs.
Thank you that would be a very helpful start could please provide a link to your code?
Write me an email javier.matos@gmail.com and as soon as I can I will send it to you.
will see if @irmajavi is ok to share their code and if so and it can be added I will create an enhancement to track it
Hi I run this command:
rock64@rock64:~$ mpp-solar -P PI16 -c QPIGS -p /dev/ttyUSB0
rock64@rock64:~$ rock64@rock64:~$ mpp-solar -P PI16 -c QPIGS -p /dev/ttyUSB0
and when run this command:
rock64@rock64:~$ mpp-solar -p /dev/hidraw0 -c QPIGS
I tried every possible combination without success. My inverter is connect via usb cable. Any suggestions?