question

mrhappy avatar image
mrhappy asked

Raspi VE.Direct to USB connection issue

So, my system uses a Raspberry Pi 3B+ to which is connected one MK3 and three PL2303 converters for VE.Direct connections to a BMV, a SmartShunt and a small phoenix inverter. Everything has been running smoothly for a few weeks. Today I started getting "not connected" in the console and failures to read modbus info from the small inverter. I checked the ve.direct cable, tried changing the converter, same issue, but when I connect the USB directly to a windows computer I get connected fine with VictronConnect.

While testing I saw other VE.Direct units failing to connect intermittently so I suspected the Raspi itself. The dmesg messages warned about low voltage detected, so I switched to another power supply. After booting up the disconnections continued but with other info in dmesg as following:

pl2303 ttyUSB3: usb_serial_generic_read_bulk_callback - urb stopped: -32

This is what continuously repeats as the ttyUSB3 keeps disconnecting for 10 seconds, then get connected for 10 seconds and on and on. Same message for the other ports when they disconnect. But now when I pulled out the ttyUSB3 converter from the Raspi, the rest of them seems to stay mostly connected, but dropping out maybe for a couple of seconds every two or three minutes, generating the same message in dmesg.

What is strange is that it worked fine for weeks, there are no hardware changes made between all working and this problem state. I did restart the system about a week before the problems started and that's just about it. I'm thinking about buying another Raspi just to see if it might be a hardware issue.

Anybody have any idea what can be the problem? I would really want to connect all devices at the same time to have my system working as designed...


Raspberry PiVE.Directconnection issue
2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mrhappy avatar image mrhappy commented ·
Meanwhile waiting for my new power supply, I have done some testing. Firstly I measured the voltage of the wall charger I am using now: 5.22 volts. Voltage at the Raspi GPIO pins: 5.05-5.08 varying, venus running, node-red running, two PL2303 converters and the MK3 connected.


I could not get my head around that it have been working flawlessly for weeks and suddenly not, the SmartShunt measuring PV current also started dropping out more and more so I researched the message I get in dmesg a bit more and found someone that had the same, but it disappeared when he moved the Raspi to another location. I simply moved it 40 cm's away and let it hang down from the shelf in which it has laid in since first connecting it. And suddenly things stay connected! I also connected the inverter that had severe problems before and it stays there.

This is just a few moments ago, but so far the fail messages now seem to come around once a minute instead of every second as before.

I will test more before I put an answer below. I suspect interference, both the raspi unit and the VE.Direct cables that run ~4m to the battery room.

0 Likes 0 ·
mrhappy avatar image mrhappy commented ·

This is turning into a blog haha.


I have kept monitoring the console and now it is only the smartshunt that disconnects for 5-6 seconds every other minute or so. I received the new official power supply, switched to it, moved the whole bundle of cables and the Raspi to the shelf below, connected, updated to latest large beta. It is the same, so definitely not a power supply issue, but still glad I got the official supply to mitigate potential future PSU problems.

I still got:

pl2303 ttyUSB1: usb_serial_generic_read_bulk_callback - urb stopped: -32

a few times every minute. ttyUSB1 is the smartshunt. I switched USB ports between the smartshunt and the small inverter, and after changing everything in node-red again, I checked dmesg, now I get:

pl2303 ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32

it is still the SmartShunt that disconnects now and then.

Next: I changed the two pl2303 converters to two others of a totally different brand (The same chipset thought, they both report "Prolific Technology"as vendor id). Now the small inverter disconnects with these messages:

pl2303 ttyUSB1: pl2303_get_line_request - failed: -32
pl2303 ttyUSB1: error sending break = -32

Gaaah, this weirds me out.

Current conclusion and planning for next step:

The only problematic devices is the ones with long cables from a pl2303 converter to VE.Direct. I use a shielded telephone cable and connect 3 of four 0,6mm2 solid copper leads around 4 meters long. Could it be that I simply have too long cables for the size leads and the different converters cope differently? I could change them out to 1,5mm cables or even 2,5 - i have both laying around. I might just try that out...

As I am merely fumbling around and don't really know what the heck I am doing here, is there anybody who knows more that have any clues for me? :)

0 Likes 0 ·
3 Answers
Mike Dorsett avatar image
Mike Dorsett answered ·

One possible problem of using generic pl2302 converters rather than the victron converter is that you may be lacking the dc isolation between the USB port and the VE direct port. This is critical - particularly for the smart shunt or BMV device. Anny difference in ground potential between the pi and each of the connected units will affect the data, possibly also leading to damage to the USB port interface. If you can't add isolation on the data lines, then you will need to add some very heavy ground / negative bonding between the various bits of gear. I tried a direct connection to a smart shunt on the test bench, and got a serious current error - with very little absolute current flowing.

3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mrhappy avatar image mrhappy commented ·

I had not considered a ground issue, so thank you for that input. Next step now was to change the minimal cables in the converters them selves and solder some bigger gauge wire to them, and after that the behaviour is different. No fault messages and working fine for 2-3 hours and then suddenly drops out and stays out. Then I read your answer, and now I have been connecting all the grounding connections of the gear to the PEN connection point of the rest of the installation, and, since I have two battery banks next to each other, I connected their negative busbars together (with small gauge wire and a 10A fuse, just for testing. Should it solve the problem I will replace it with 2x50mm2). Should I connect the battery banks negative to the PEN connection too do you think? I have spoken with several electricians about it and even one who work with huge battery banks in industrial applications, and even he thought it to be unnecessary to do so.


However, this will be the last testing stage, and if it does not work continuously I will happily order a bunch of victron VE.Direct to USB cables... to be continued...

0 Likes 0 ·
Mike Dorsett avatar image Mike Dorsett mrhappy commented ·
Whilst I would NOT connect the battery bank negatives to the PEN directly, I WOULD install a 200A Negative busbar (depending on the size of the system) With any Battery fusing in the POSITIVE side. It is good practice to have battery isolating breakers installed. Then make sure all other equipment negatives connect directly to this busbar with generous size cables.

If you are considering ultimately to install the VEdirect cables instead of the cheaper alternatives that are not isolated, this is actually one of the first things to do. Current spikes from the inverter switching can cause sufficient shift in ground potential to corrupt data, or in the worst case destroy the interface.

I have a complex system with 2 x 28V 150Ah battery packs, a BMS, two Multiplus compact inverters and two blue solar MPPT chargers. The BMS has 2 x VE direct connections (isolated) to the Blue solar chargers, a Mk2 (also isolated) to the 2 inverters, and an RS485 adapter to an EKM power meter (isolated in the power meter) and it all works fine - and has done for the last 2 years. I'm currently figuring out how to add a smart shunt into this, but have run out of USB ports....


0 Likes 0 ·
mrhappy avatar image mrhappy Mike Dorsett commented ·

My system contain two massive busbars for the batteries, the negative being connected to two shunts in series with a Multiplus 24/3000 and a small inverter connected between them, and all solar chargers connected to a smaller aluminium busbar on the far side of the other shunt. The positive battery busbar is connected to an ANL fuse break-out busbar which connect the positives of the solar chargers and the small inverter. The Multiplus has its own positive connection from the battery busbar with a big fuse and disconnect switch. The second battery bank is smaller 12V, being charged with excess PV and has a dedicated smaller Phoenix inverter connected which I control through the VE.Direct (this is the one dropping out the most.)

Anyhow,

I have to thank you for your help, after connecting all the solar chargers and the small inverters to PEN and connecting the negatives on the two battery banks, it has been running stably now for 10 hours, only dropping out when I charge or discharge heavily (>20A DC). Safe to say that the lack of galvanic isolation is the issue.

I'll get some proper cables :)

0 Likes 0 ·
mvader (Victron Energy) avatar image
mvader (Victron Energy) answered ·

hi, you’re not using galvanically isolated converters from usb to ve.direct.


exactly all above is the reason why from our side we offer no support on anyone not using the official cables. Trying to support anyone requires far too many back and forth and figuring what he/she did and how its wired and if its isolated and so forth.


(And yes I know they are far more expensive).


Regardless: I do hope you get it sorted soon! Have a good weekend

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mrhappy avatar image mrhappy commented ·
I fully understand the lack of support in these cases, now even more :) It's like chasing grounding problems in car electronics, all weird things can, and will happen..


I think the proper cables will be worth it, you have a good weekend too!

0 Likes 0 ·
Peter Buijs - NL avatar image
Peter Buijs - NL answered ·

Some time ago I had a bad USB power cable causing a lot of trouble. To investigate I include a few links which guided me to the final solution.

1632856923509.png

1632856951740.png

1632856975776.png



1632856923509.png (4.1 KiB)
1632856951740.png (1.6 KiB)
1632856975776.png (3.0 KiB)
3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mrhappy avatar image mrhappy commented ·
Thank you, I just ordered an official power supply. Will update here whether that solve the problem or not.
0 Likes 0 ·
Philip avatar image Philip mrhappy commented ·

I have the same issue. Did changing the cable to the official one solve the problem ?

0 Likes 0 ·
mrhappy avatar image mrhappy Philip commented ·
Oh, seems like I never updated as I wrote I would. I did change to the official power supply to the RasPi and think It got much better after that, but a month later I disconnected one of the PL2303 to USB adapters due to changes in the system, I didn't need it anymore. Using two of them + the MK3 works flawlessly since october last year now...


/MrHappy

0 Likes 0 ·

Related Resources

Additional resources still need to be added for this topic

Raspberry Pi running Victron’s Venus firmware - Blog Post

Venus OS Large image: Signal K and Node-RED - Install

raspberrypi install venus image


VE.Direct protocol FAQ

Additional resources still need to be added for this topic