Jump to content

Infinisolar V 5KW USB Monitoring


Nadeem Ahmed

Recommended Posts

I am currently working on a python script to monitor my Infini V 5KW inverter through USB.  So far I have been successful in overcoming several issues however I am stuck at a point where when I attempt to set the 'Output Source Priority' to 'Solar-Battery-Utility' option, it refuses to accept command.  It uses P18 protocol.  On the other side if I try to set it to 'Solar-Utility-Battery' it works fine.  In short I am able to set it to SUB but it refuses my command to set it to SBU.  What could I be doing wrong?

Link to comment
Share on other sites

6 hours ago, Nadeem Ahmed said:

... when I attempt to set the 'Output Source Priority' to 'Solar-Battery-Utility' option, it refuses to accept command.  It uses P18 protocol.

Perhaps because the CRC for the "^S007POP1" command is 0x0D10, and you forgot to increment the 0D (carriage return) to 0E, one of the three special cases? Another special case is 0x0A (linefeed), and I believe that the other special case is still '(' (should be incremented to ')' ). That's even though the open parenthesis isn't special in protocol 18.

Link to comment
Share on other sites

On 2019/01/16 at 6:29 PM, Coulomb said:

Perhaps because the CRC for the "^S007POP1" command is 0x0D10, and you forgot to increment the 0D (carriage return) to 0E, one of the three special cases? Another special case is 0x0A (linefeed), and I believe that the other special case is still '(' (should be incremented to ')' ). That's even though the open parenthesis isn't special in protocol 18.

You are here.  I was not considering this.  Will try it.  

Link to comment
Share on other sites

On 2019/01/16 at 6:29 PM, Coulomb said:

Perhaps because the CRC for the "^S007POP1" command is 0x0D10, and you forgot to increment the 0D (carriage return) to 0E, one of the three special cases? Another special case is 0x0A (linefeed), and I believe that the other special case is still '(' (should be incremented to ')' ). That's even though the open parenthesis isn't special in protocol 18.

@Coulomb, one more question, will inverter be doing the same with CRC while sending its response back?  In other words, while validating the CRC I got with the message I should consider 0E actually means 0D, right?

 

Thank you for your help.

Link to comment
Share on other sites

10 minutes ago, Nadeem Ahmed said:

will inverter be doing the same with CRC while sending its response back?  In other words, while validating the CRC I got with the message I should consider 0E actually means 0D, right?

Yes, it will. But you can't tell if a 0E was because of a 0D, or the CRC calculated to 0E anyway. All you can use the CRCs for is to calculate the CRCs from what you received, and compare it with the received CRCs. If they match, it's almost certainly a good packet. If not, don't trust that data and either resend the command or wait for the next response to come through.

Link to comment
Share on other sites

  • 1 month later...

Hey gents.  This might be slightly off-topic, but is the infini's CRC same as normal axpert. using xmodem?

I have this piece of code in python for a hass.io plugin I'm adapting:  but keep getting nakk. I know I can just ignore the crc for the basic commands, but I have some future plans.

command + unhexlify(hex(xmodem_crc_func(command)).replace('0x','',1)) + '\x0d'

 

 

Link to comment
Share on other sites

3 hours ago, Tiaan Micasa said:

is the infini's CRC same as normal axpert. using xmodem?

I don't own an Infini, and haven't played with one for any length of time. However, I do collect firmwares, and I find that the exact same CRC function is present in the Infinis as in the Axperts.

Don't forget that in addition to the 0x1021 CRC-16 ("Xmodem") calculation on the command or response data, you have to check the upper and lower halves of the 16-bit result for three special values. If the upper or lower byte equals one of those special values, that value is replaced by the next highest byte value. The three special values are '(' (0x28), carriage return (0x0D), and line feed (0x0A). Each occurrence of these would be replaced by ')' (0x29), 0x0E, and 0x0B respectively. That way, a CRC can never contain those special values. This is despite the fact that in most Infinis, '(' is not a special value, but '^' is.

The CRC calculation on the command or response does not include the carriage return.

Link to comment
Share on other sites

  • 5 months later...

@Nadeem Ahmed 

Hi, I also own an Infinisolar V 5KW and i have been busting my brains in trying to figure out how to talk to it using an RS 232 port. I have reached to the point where i now know that it uses P18 protocol and i have a list of commands that work with it. My problem is that i have not been able to find a clue as on how to push these commands to the inverter. 

I used a prolific usb to serial converter cable coupled with the RS 232 to RJ 45 cable that came with the unit. Using this setup i am able to connect with the inverter using the solar power software which shows me that the hardware i am using is Ok but i have no clue as on how to send the command. i have used RealTerm, YAT and RS232 analyzer to send commands but i always get something like ^0.... kind of response which the same regardless of the command. 

i would be very very thankful if you can help me out in sending a command to inverter and getting a response back. All i need is step by step instructions to send just one command and i can take it from there. 

Thank you so much. i ll look forward to hearing from you.

Link to comment
Share on other sites

On 2019/08/12 at 5:15 AM, thehrao said:

All i need is step by step instructions to send just one command and i can take it from there. 

Are you sending CRCs with the commands?

If not, try this command with crcs: "Q7{:" without the quotes. i.e. capital-Q, digit-7, open-curly brace, colon [ edit: and of course, a "carriage return" or "enter" terminates all commands ]. "Q7" is an undocumented command; you should get a '(' followed by 30 sets of 4-digit numbers. You might be able to recognise your inverter's serial number in the first set of 3 numbers. I'm looking at the firmware for an "Infini V2 3 kW" machine (it might be 3 kVA). Hopefully it's close enough to yours to work.

Why the last two weird characters? They are the "XModem" CRCs for the command "Q7"; the CRC is 0x7B3A. 0x7B is the open curly brace character, and 0x3A is the colon character. I use this site to calculate the CRCs:

https://www.lammertbies.nl/comm/info/crc-calculation.html

If you can't get this to work, make sure that your communications program is connected to your Prolific USB to serial adapter, and it is running at 2400 bps (unusually slow, so it won't be the default for any comms program), no parity 8 bits (the last two are command and are usually the default setting).

I chose the Q7 command because it happens that both CRC characters don't have the sign bit set. That makes it easy to send that particular CRC. But you'll want to calculate the CRCs automatically somehow; there are many ways.

See this post of mine for using TeraTerm: http://forums.aeva.asn.au/viewtopic.php?title=pip4048ms-inverter&p=57733&t=4332#p57733 (but you have to calculate the CRCs separately), or this post for an applet that generates the hex values (command and CRC together) to send with RealTerm.

It seems that your inverter is one of the ones that handles some "ascii" commands (like QFAULT and Q7 but not QPIGS or QPGS) and some "secure" commands (such as the secure general status command, ^P007PGS0  [ edit: I had the length wrong, and forgot the machine number at the end. ]). The latter type of command are more likely what you need, and you may need to find another protocol manual with details about those commands. This probably explains why when you send an invalid command, you get a "secure NAK" (up-arrow, zero, carriage return).

Hopefully this will get you on the right path.

Edit: depending on the protocol (P17 or P18), the general status command might be ^P003GS", perhaps with no CRC.

Edited by Coulomb
"^P008PGS" → "^P007PGS0"
Link to comment
Share on other sites

On 2019/08/12 at 9:45 AM, Coulomb said:

Are you sending CRCs with the commands?

That's exactly what came to my mind as a first step to suggest.  Hopefully it will resolve the problem.

 

On 2019/08/12 at 9:45 AM, Coulomb said:

If not, try this command with crcs: "Q7{:" without the quotes. i.e. capital-Q, digit-7, open-curly brace, colon [ edit: and of course, a "carriage return" or "enter" terminates all commands ]. "Q7" is an undocumented command; you should get a '(' followed by 30 sets of 4-digit numbers. You might be able to recognise your inverter's serial number in the first set of 3 numbers. I'm looking at the firmware for an "Infini V2 3 kW" machine (it might be 3 kVA). Hopefully it's close enough to yours to work.

It seems that your inverter is one of the ones that handles some "ascii" commands (like QFAULT and Q7 but not QPIGS or QPGS) and some "secure" commands (such as the secure general status command, ^P008PGS (I'm not totally sure about the 008 command length)). The latter type of command are more likely what you need, and you may need to find another protocol manual with details about those commands. This probably explains why when you send an invalid command, you get a "secure NAK" (up-arrow, zero, carriage return).

@Coulomb, I am not aware of any undocumented commands.  What do these 30 sets of 4 digit numbers mean?  What information does it represent actually?  Where can I get further information on it?

Thanks.

Link to comment
Share on other sites

On 2019/08/13 at 8:10 PM, Nadeem Ahmed said:

Coulomb, I am not aware of any undocumented commands. 

Something like half the commands are undocumented. I considered documenting them at one point, but decided against it. Some are dangerous, some would help cloners avoid traps set by the firmware, and so on.

Quote

What do these 30 sets of 4 digit numbers mean? 

As I hinted, the first three numbers represent the serial number. Others are mostly settings or measurements sent over the CAN bus from one slave to/from the master.

There isn't a lot of useful information in these, or the information can be obtained via other, far more user friendly commands. I just used Q7 as an example, because its CRC happens to not have the eighth (sign) bit set; sending a character with the sign bit set is more tricky than sending regular characters. If you could get the Q7 command returning a response other than the secure NAK (Negative Acknowledge), then you'd at least know that you have the basics working, and can progress from there. You did ask for just one working command 😉

Oops! I just realised I've been talking about the P18 protocol as if it's the Axpert-like set of commands (like QPIGS, QPGS0, etc). Also, it looks like the protocol for the 3 kW and 5 kW models is different; my PGS example was all wrong.

I assume you have the appropriate protocol manual, but just in case I've uploaded it here: Infini V 5kW P17 protocol manual.

I note that it has no Axpert-like commands, so maybe there isn't such a thing as a Q7 command for your inverter after all. Did you get it to work?

Edit: the manual I uploaded responds to the protocol enquiry command with "^D00517", which presumably means protocol version 17 (otherwise known as P17 it would seem). I think you should concentrate on getting the "^P003PI" command to work first, so you know which manual to follow for all the other commands. I'll upload the manual with protocol 18/P18 (for the 5 kW models) next. [ Edit: it's here: Infini V 5kW P18 protocol manual ].

Edit 2: Looks like you should also try "^P003PI" (note the different length!). The protocol manuals both say to include the CRC characters and the carriage return, but not the "^Tnnn" part, so it looks like sometimes you need the CRC and sometimes not. What a mess!

Edit 3: I had the protocol manuals somewhat mixed up. I've uploaded them again, and will get the confusing ones deleted. Sorry about the confusion.

Edit 4: It seems two admins deleted 2 files, so the P17 manual was accidentally deleted. Restored now.

 

Edited by Coulomb
As noted.
Link to comment
Share on other sites

@Coulomb

Thank you so much for your prompt response. I tried the Q7{: command but it retruned the same ^0. i did some sniffing on the communication between inverter and PC using wireshark software the very first command that is acknowledged and responded by the inverter is ^P005PI command. The command is preceded by an '@' and followed by '@ q @'. The response to this command is "@;^D00518;@;". This makes me realize that ^P005PI is the right command however i dont know what the charachters preceding and following the command are.

I am enclosing the file saved from wireshark and would be really thankful if you can take a look at the file and advise me how to decode these commands and send them to the inverter to get a response. the first communication that gets a response from inverter in attached file is at no. 1598. 

Thank you so much for your time and help. 

 

 

1.0.pcapng

Link to comment
Share on other sites

@Coulomb

Your insight worked. I am now able to send the commands and receive a response using RealTerm. Thank you so much. I am so happy. 

I will try and detail here as much as i can as to what i did so others trying the same may get off easy. So if we are sending the command ^P005PI, we need to send it as <command><CRC><CR>. in hex format ^P005PI becomes 0x5E 0x50 0x30 0x30 0x35 0x50 0x49 and CRC for this command is 0x71 0x8B and the carriage return is 0x0D. Combine all of these together and the command becomes 0x5E 0x50 0x30 0x30 0x35 0x50 0x49 0x71 0x8B 0x0D.

After setting up the port in the RealTerm program, go to send tab of RealTerm and paste it in the drop down field next to send numbers button. press send numbers and you shall receive a response. dont click any of the check boxes labeled +CR or anyother. 

hopefully it will work as it worked for me.

i am attaching the protocol for Infinisolar V 5KW protocols for anyone who may need them. for command and CRC hex calculation, i used the applet pointed out in the following post by Coulomb.

On 2019/08/12 at 9:45 AM, Coulomb said:

ee this post of mine for using TeraTerm: http://forums.aeva.asn.au/viewtopic.php?title=pip4048ms-inverter&p=57733&t=4332#p57733 (but you have to calculate the CRCs separately), or this post for an applet that generates the hex values (command and CRC together) to send with RealTerm.

 

Once again,  thank you so much @Coulomb for your help.  my next step would be to figure out how to send this using an ESP8266 and upload the data to cloud where it can be accessed remotely. i will keep sharing my progress for those who may need it. 

Infini-Solar V protocol 20170926(PI18).pdf

Link to comment
Share on other sites

Arrgh! I screwed up with the file uploads, giving them the wrong description. In particular, there were 5 downloads of what I called the Infini 5kW protocol manual, but this was the P17 protocol from 2016. You might be needing the P18 protocol manual instead. You should be able to see the three manuals I uploaded today with corrected descriptions (and two that I uploaded yesterday with the wrong descriptions, till the admins delete them), here:

https://powerforum.co.za/files/category/1-files/

Edit: the P18 manual is the same one as @thehrao attached above. I think it will be easier to find in the files section (though I'll admit that the files section of this forum is a little hard to find, till you get used to it).

Edited by Coulomb
Link to comment
Share on other sites

  • 1 year later...

Hi everyone. I wrote a full-featured program for Linux for controlling this inverter over USB with full P18 protocol support, see https://github.com/gch1p/isv

It's written in C, it's fast, it supports various data output formats and I use it in my monitoring project on an Orange Pi One SBC connected to the inverter.

Edited by ch1p
Link to comment
Share on other sites

  • 2 weeks later...

Sorry for spamming this topic, but everyone here seems very knowledgable on the infinisolar V range.

In South Africa we are not allowed to feed power into the grid, but you still want to use the grid feed function of this inverter to power your own loads so that you are not limited to 5kw.

Is there a way to limit the feed to grid so that it only feeds enough for your own loads? On other inverters there is usually an external energy meter to tell the inverter to limit export power. Perhaps via USB commands?

Link to comment
Share on other sites

  • 2 years later...
 

Sorry for spamming this topic, but everyone here seems very knowledgable on the infinisolar V range.

In South Africa we are not allowed to feed power into the grid, but you still want to use the grid feed function of this inverter to power your own loads so that you are not limited to 5kw.

Is there a way to limit the feed to grid so that it only feeds enough for your own loads? On other inverters there is usually an external energy meter to tell the inverter to limit export power. Perhaps via USB commands?

i could not find any command to limit the grid feed power. I dont think it is possible on the infinisolar V range.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...