RPi GX VE.Direct port id change

xsilvergs

Forum Member
I have used an RPi instead of a GX device for some time now, a number of times I've wished I had a Cerbo but I was already 'someway down the road'. I upgraded from a Pi3 to a Pi4, when they were affordable, to improve response.

The only issue which for me which became a bigger nuisance once I started using Node-Red incorporated in the Venus-Large-Image is the USB id allocation on reboot. I believe that each time the Pi gets rebooted it detects the USB devices in a different order eg. a MPPT device gets allocated USB0 and the BMV gets allocated USB1 and the inverter gets allocated USB2. Next reboot the BMV gets allocated to USB0 and other devices get different USB id's.

It was suggested on the victron community I try the following approach, so this is what I've done and after a few reboots USB devices have connected correctly every time. I will continue to test this but perhaps other Pi users may be interested to try it:

SSH into Pi
then enter this command dmesg > /home/dmesgout
This created a text file with details of the connected devices amongst other things, which I copied to my PC using Filezilla
In this file are blocks of text which refers to the VE.Direct USB dongles plugged in (Reading the www will explain this in greater depth than I'm willing to go to).

[ 5.467394] usb 1-1.2.4: New USB device found, idVendor=0403, idProduct=6015, bcdDevice=10.00
[ 5.471637] Bluetooth: HCI UART protocol H4 registered
[ 5.493231] usb 1-1.2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5.506305] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 5.525272] usb 1-1.2.4: Product: VE Direct cable
[ 5.547366] Bluetooth: HCI UART protocol Broadcom registered
[ 5.553023] usb 1-1.2.4: Manufacturer: VictronEnergy BV
[ 5.580642] usb 1-1.2.4: SerialNumber: VE4xxxxx

Victron VE.Direct dongles have the same idVendor and idProduct but the SerialNumber changes (see first line and last line).

then enter the command nano /etc/udev/rules.d/10-usb-serial.rules
This creates a file to which you then enter one line for each USB dongle. My file contains the following:-

SUBSYSTEM=="usb", ATTRS{idProduct}=="01a7", ATTRS{idVendor}=="1546", SYMLINK+="gpsModule"
SUBSYSTEM=="usb", ATTRS{idProduct}=="6015", ATTRS{idVendor}=="0403", ATTRS{serial}=="VE4xxxxx", SYMLINK+="MPPTA"
SUBSYSTEM=="usb", ATTRS{idProduct}=="6015", ATTRS{idVendor}=="0403", ATTRS{serial}=="VE3xxxxx", SYMLINK+="BMV712"
SUBSYSTEM=="usb", ATTRS{idProduct}=="6015", ATTRS{idVendor}=="0403", ATTRS{serial}=="VE4xxxxx", SYMLINK+="INVERTER"
SUBSYSTEM=="usb", ATTRS{idProduct}=="6015", ATTRS{idVendor}=="0403", ATTRS{serial}=="VE3xxxxx", SYMLINK+="MPPTB"

Save and Exit the file and reboot the Pi.

What I think happens now is the dongle serial number is given the same id every boot. Am I right? Does it work every time? Any one else want to try it? If you know better please let me know. If I find problems I will update this post in the future.

UPDATE: 14/11/22
The above does not seem to work for Node-Red.
 
Last edited:

wildebus

Forum Member
Have you a Multiplus or other VE.Bus device connected (via a Mk3 Dongle)? If so, do you find that changes ID as well?
I changed from an RPi to a Venus GX (and then a Cerbo GX) quite a while ago but from memory I found the ID on USB devices used to change occasionally, but the Multiplus did so far more often. Not sure why that happened as there was only one VE.Bus device.
But then again, it was a VE.Bus to USB Dongle, so likely in the same group as the VE.Direct to USB Dongle?

I am trying to remember if I got these issues on the 'genuine' Victron GX units ... I kind of think I did, but not for a long time so maybe it was only with the RPi?

Have to say what you have ended up doing there really should be standard code in the firmware. Big oversight IMO

(a similarly annoying thing which is still current I think is when you download CSV files from VRM and the order of the columns in terms of which device groups come after each other seems very random. Every download means adjust the code if doing comparisions to previous downloads :( )
 

xsilvergs

Forum Member
Have you a Multiplus or other VE.Bus device connected (via a Mk3 Dongle)? If so, do you find that changes ID as well?
I changed from an RPi to a Venus GX (and then a Cerbo GX) quite a while ago but from memory I found the ID on USB devices used to change occasionally, but the Multiplus did so far more often. Not sure why that happened as there was only one VE.Bus device.
But then again, it was a VE.Bus to USB Dongle, so likely in the same group as the VE.Direct to USB Dongle?

I am trying to remember if I got these issues on the 'genuine' Victron GX units ... I kind of think I did, but not for a long time so maybe it was only with the RPi?

Have to say what you have ended up doing there really should be standard code in the firmware. Big oversight IMO

(a similarly annoying thing which is still current I think is when you download CSV files from VRM and the order of the columns in terms of which device groups come after each other seems very random. Every download means adjust the code if doing comparisions to previous downloads :( )

I don't have a Mk3 dongle device, my inverter is a Phoenix 500VA so regular VE.Direct dongle.

I hope this continues to function correctly, only time will tell, or someone with more knowledge can offer suggestions.

Linux handling of USB is always a mystery to me, it's one thing Windows does better, in my experience.

I've not tried downloading CSV files but will try and report back.
 

Users who viewed this discussion (Total:0)

Top