Switching a relay on an MPPT charge controller using Node-Red on RPi

Those are the device instances. They are something else.

For VE.Direct you use vregd.
And you need to find the serial port to which the MPPT is attached.
Read the whole thread carefully.
Example here: Switching a relay on an MPPT charge controller using Node-Red on RPi - #23 by Steve85737

Ahh… Thanks @alexpescaru It wasn’t clear to me, but now it is:

vreg is for VE.CAN (The -n option is required to specify the device on the bus)
vregd is for VE.Direct

For vreg, you can do a ‘vreg -c ?’ and get output like this:

The following gateways were found:
--------------------------------------------------------------
socketcan:can0       can0
--------------------------------------------------------------

But for vregd, doing a ‘vregd -c ?’ gives you this:

000.000 ERR.serial: could not open com-port
000.000 ERR.task: failed to open serial port!

How do I know to which /dev/ttyxxxx it is connected ?
When looking at dmesg | grep ttyU I don’t see anything. But looking at dmesg | grep ttyS I’ll see I have a ttyS0. Is the VE.Direct on a Cerbo connected to the Serial port ?

When you specify the ? on the -c switch is considered an error and the program is showing your available options.
Your approach is quite unusual… But solves the problem. :slight_smile:

How is your MPPT connected to the Cerbo? Directly on a VE.Direct port?
Usually, by default, the VE.Direct ports used on Cerbo are mapped to ttyS5, ttyS6 and ttyS7.

Thanks again for the help.

How is your MPPT connected to the Cerbo? Directly on a VE.Direct port?
Yes. Directly to a VE. Direct port.

On the other two VE.Direct ports, there is a Phoenix inverter and a Smart Shunt.

Because the installation is remote and I don’t remember exactly to which VE.Direct is is connected, I tried them all and to see the different error messages, I am trying from ttyS3 - ttyS8.

(note that 0x010B = [string32] Model name - ASCIIZ representation of the model name )

vregd -c /dev/ttyS3 -g 0x010B
000.000 ERR.serial: could not open com-port
000.000 ERR.task: failed to open serial port!

vregd -c /dev/ttyS4 -g 0x010B
# Error no response received!

vregd -c /dev/ttyS5 -g 0x010B
# Error no response received!

vregd -c /dev/ttyS6 -g 0x010B
# reg=0x010B: 0x50 0x68 0x6F 0x65 0x6E 0x69 0x78 0x20 0x49 0x6E 0x76 0x65 0x72 0x74 0x65 0x72 0x00
Which is “Phoenix Inverter”

vregd -c /dev/ttyS7 -g 0x010B
# Error no response received!

vregd -c /dev/ttyS8 -g 0x010B
000.000 ERR.serial: could not open com-port
000.000 ERR.task: failed to open serial port!

So we know that somewhere between ttyS4 and ttyS7 it is connected, which is indeed what you say: “VE.Direct ports are connected on ttyS5, ttyS6 and ttyS7”.

However, only the Phoenix Inverter gives a response, not the SmartShunt or the SmartSolar MPPT 100/20. Is that normal behavior?

Try different registers. Not all registers are mapped to each product.
Also read this: https://www.victronenergy.com/upload/documents/BlueSolar-HEX-protocol.pdf

1 Like

Thanks!

Even though I don’t have a BlueSolar but a SmartSolar MPPT 100/20 48V, the registers in the document you provide do work! In fact, I was using a wrong document.

For devices Document Link
VE.Direct with SmartSolar & BlueSolar: VE.Direct Protocol - BlueSolar and SmartSolar MPPT chargers - Rev18 https://www.victronenergy.com/upload/documents/BlueSolar-HEX-protocol.pdf
VE.Can & VE.Direct (non SmartSolar/BlueSolar but devices like Phoenix Inverter) use: VE.Can registers - VREGS - Victron Registers in NMEA 2000 – version 20 https://www.victronenergy.com/upload/documents/VE.Can-registers-public.pdf

   

I was able to turn the LOAD of my SmartSolar MPPT 100/20 48V to OFF using this:


 

Thank you very much! I hope the info we posted here would be an example for other people.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.