Jump to content

VMIII USB port now flaky, after 1 year of rock-solid use


Ben Harper
 Share

Recommended Posts

I have a 3KW RCT VMIII, which I connect to a Raspberry Pi via USB cable to monitor it, using software that I wrote myself (https://github.com/bmharper/homepower).

This software monitors the inverter's reported load, and uses that information to flip a set of contactors in my house, to either let heavy loads run from grid, or from the inverter. This way I can have more than 3KW devices potentially connected to the inverter, but the "heavy" ones go back to grid, if the inverter is unable to power them. The "essential" circuits always remain connected to the inverter.

This setup has been working 100% for over a year, which is how long I've had it. The program queries the inverter every second, and has done so reliably for almost exactly one year.

Since about 2 weeks ago, the USB port has started coming and going. The symptom is that /dev/hidraw0 disappears for about an hour at a time, and then magically reappears again. Two weeks ago I thought it was the Raspberry Pi, so I switched it out to a new Pi4, and now the problem is occurring on the new Pi4, so it seems to be the inverter that's at fault.

Has anybody else had intermittent connectivity issues with the USB port on the VMIII?

Thanks,
Ben

 

Link to comment
Share on other sites

I stopped using USB in favour of the RS485 with serial to USB adapter. I also used to have drop outs for no apparent reason with USB. At the time I thought it might just be interference from all the AC wires running close to the USB cable. RS485 has been rock solid also for about a year now to my rPi4.

Link to comment
Share on other sites

Your inverter should have come with an RS485 to serial cable - then you just need to buy a serial to USB adapter. Something like this: 

https://www.takealot.com/mecer-usb-to-1-serial-9-pin-port/PLID35668474

There are cheaper options that might be worth a try but this is the unit I have.

Checked out your Github - nice work! I'm using Solpiplog and automating something very similar to you with home assistant but I can only poll every 5 seconds - which is sometimes too slow to turn off things before the inverter trips on overload.... 

Link to comment
Share on other sites

19 hours ago, JaseZA said:

Your inverter should have come with an RS485 to serial cable

Actually, the command port is RS-232, and the supplied cable is for the RS-232 port.

There is an RS-485 port, but that's for connecting to battery BMSs.

Link to comment
Share on other sites

OK.. so I have the RJ45 -> RS232 -> USB cables plugged in, and I can clearly talk to the thing, but every command I issue responds with "(NAK".

@Coulomb Have you ever seen this?

All the code I can find on the internet doesn't seem to differentiate between talking over USB or RS-232. I know I've got the CRC correct, because it was working perfectly over USB.

One other interesting thing.. after rebooting the inverter (ie all plugs out), the very first time I try to talk to it (asking it for QPIGS), it gives me "(PI30" response.
Thereafter, it responds exclusively with "(NAK".

🤔

Link to comment
Share on other sites

30 minutes ago, Ben Harper said:

OK.. so I have the RJ45 -> RS232 -> USB cables plugged in, and I can clearly talk to the thing, but every command I issue responds with "(NAK".

@Coulomb Have you ever seen this?

Yes, when the CRC is incorrect. But you say that's right below.

Quote

I know I've got the CRC correct, because it was working perfectly over USB.

One other interesting thing.. after rebooting the inverter (ie all plugs out), the very first time I try to talk to it (asking it for QPIGS), it gives me "(PI30" response.
Thereafter, it responds exclusively with "(NAK".

Well, (PI30 is the response for the QPI command (Query Protocol Id), and QPI is the first 3 letters of QPIGS. That command is one of the many that requires a correct CRC. So that suggests to me that something is wrong at your end. The CRC must have been calculated on only the first 3 characters of the command (at startup only). Perhaps connect to another PC at 2400 bps and check that the whole command is coming out, and that the checksum is indeed correct as you assume.

Some of the communications boards are a little flaky at 9600 bps (required for flash updating). But to fail at 2400 bps would be extraordinary.

Edit: I should add that comms via USB uses the same serial port on the DSP, so there is a lot of electronics and cable in common between the two ports. So if something has gone wrong with your comms board or control board or cable between these two that is affecting USB, it may well be affecting RS-232 as well. That doesn't explain your "(PI30" response though.

Edited by Coulomb
Link to comment
Share on other sites

For posterity, in case anybody on the internet finds this "(NAK"... here is the C/C++ code for setting up the terminal as regular file device:

https://github.com/bmharper/homepower/blob/master/server/inverter.cpp#L239

 

speed_t baud = B2400;

// Speed settings (in this case, 2400 8N1)
struct termios settings;
int            r = 0;
if ((r = tcgetattr(FD, &settings)) != 0) {
	fprintf(stderr, "tcgetattr failed with %d\n", r);
	Close();
	return false;
}

// baud rate
r = cfsetospeed(&settings, baud);
if ((r = cfsetospeed(&settings, baud)) != 0) {
	fprintf(stderr, "cfsetospeed failed with %d\n", r);
	Close();
	return false;
}
cfmakeraw(&settings);        // It's vital to set this to RAW mode (instead of LINE)
settings.c_cflag &= ~PARENB; // no parity
settings.c_cflag &= ~CSTOPB; // 1 stop bit
settings.c_cflag &= ~CSIZE;
settings.c_cflag |= CS8 | CLOCAL; // 8 bits
// settings.c_lflag = ICANON;         // canonical mode
settings.c_oflag &= ~OPOST; // remove post-processing

if ((r = tcsetattr(FD, TCSANOW, &settings)) != 0) {
	fprintf(stderr, "tcsetattr failed with %d\n", r);
	Close();
	return false;
}
tcflush(FD, TCOFLUSH);

 

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.

 Share

×
×
  • Create New...