question

Trevin Corkery avatar image
Trevin Corkery asked

Scanning for VE Direct devices

What is the best way to detect VE Direct devices?

Or do you mainly have to listen to every serial device at 19200 baud rate? I am currently creating an C++ application for Linux that will convert the all the VEDirect calls into one JSON device array.

VE.Direct
2 |3000

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

2 Answers
Trevin Corkery avatar image
Trevin Corkery answered ·

I've discovered with Linux you can use the udev c API to scan devices that are using the Victron USB cable.

I've posted my code here https://pastebin.com/KSCaFf2u
Example output:
/dev/ttyUSB0
/dev/ttyUSB1

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.

Dr. Werner Sachs avatar image Dr. Werner Sachs commented ·

Simple STATIC solution. Create a file in /etc/udev/rules.d e.g. "99_victron.rules" with the two lines (for e.g. my two devices/VE.Direkt kabel): (1)KERNEL=="ttyUSB[0-9]", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", ATTRS{serial}=="VE5FEM1C", MODE="0666" , GROUP="dialout", SYMLINK+="Victron.BMV" (2)KERNEL=="ttyUSB[0-9]", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", ATTRS{serial}=="VE6NMR62", MODE="0666" , GROUP="dialout", SYMLINK+="Victron.MPPT" Replace ATTRS{serial}=XXXXX with the serial number of the USB<->VE.Direct cable (can be checked e.g. with the program "usbview"). Then you have two new devices "/dev/Victrom.MPPT" and "/dev/Victron.BMV". Don't forget the permission for the devices.

0 Likes 0 ·
ks4z avatar image
ks4z answered ·

Maybe the serial-scanner can help you starting a service for each new serial port. So that you can then do whatever you like on it.

Ks4z


2 |3000

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

Related Resources