question

phtr avatar image
phtr asked

Connect Raspberry Pi directly to MPPT over serial pins for Venus OS / Venus package

Hi there,


as I find 30€ quite a lot for the VE.Direct to USB cable and as the Raspberry Pi just has some Serial Pins at the GPIO interface, I wondered if someone has already connected e.g. a MPPT via the Pis GPIOs to the Venus software. Would be great to hear!


Best regards,

Philipp

MPPT ControllersVenus OSRaspberry PiVE.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.

4 Answers
jkario avatar image
jkario answered ·

MPPTs use 5V and the Pi GPIO pins are 3v3 so you cannot connect them directly. You would need a logic level converter in between. You could use one of those cheap eBay USB to Serial TTL cables and make your own cable by cutting the jumper cables and replacing them with a 4pin JST-PH connector. Be sure to only connect GND, TX and RX. You should never ever connect together the USB port 5V with the VE.Direct port 5V. Also, the cable is not isolated. I presume the official Victron cable has a SI8422 chip inside to provide isolation (just a guess). I would use the official cable. Given that it's going to take time to source the components and solder the connector and the end result is not as good as the original (no isolation) it's just not worth the effort. Choose your battles.

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.

phtr avatar image phtr commented ·

Hi @jkario, thanks for your answer!

I'm aware of the need of a logic level convert (two resistors should do it) and how to connect the MPPT to the Pi. Nevertheless, thanks for your explanations!

My question was more focused on whether the serial GPIO port of the Raspberry Pi can be used on the software side with VenusOS or whether only the official USB cable is supported.

If the original cable only uses a standard component, then the question would be whether VenusOS only listens on `/dev/ttyUSBx` or also on `/dev/ttySx`. Do you have any knowledge about it?


0 Likes 0 ·
Mike Dorsett avatar image Mike Dorsett phtr commented ·
the Pi's internal port appears as /dev/ttyS0. However, the ISOLATION is essential to avoid ground loops. Also, if there is voltage on the broadcom chip pins when the Pi powers up, it blows the chip rendering the input useless. This is why the isolation chip is required. simple diodes and resistors will work, provided the PI is powered before any connections are made.
0 Likes 0 ·
andyalford avatar image
andyalford answered ·

I had wondered the same thing, but I have decided that the galvanic isolation provided in the USB cable is worth the money.

A shame though, as the extra cabling will create quite a rats' nest.

(My boat was hit by lightning a few years ago, and the only Electronics which survived had isolated inputs.)

For anyone curious, VE.Direct wiring and protocol specification is published here

https://www.victronenergy.com/support-and-downloads/whitepapers

4 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.

neoneddy avatar image neoneddy commented ·

One way to reduce the rat's nest is a USB hub. I have everything connect near the chargers , BMV and Multi, then run a single cable to the Pi.

0 Likes 0 ·
ttbb avatar image ttbb neoneddy commented ·
0 Likes 0 ·
Show more comments
masterov avatar image
masterov answered ·

I was able to connect VE.Direct (MPPT 100/30) to RPi4 as follows:


vedirecttorpi4.jpg (299.4 KiB)
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.

Rob Duthie avatar image Rob Duthie commented ·

Hi Masterov

So you have the VE direct on the rapsi 4 running OK and showing a MPPT or any other VE Direct controller showing on the screen.?

As i have developed a interface for the raspi pi to except I/O, relays, can bus etc, Just can't get the VE direct or go, on a rapsi 3+. The USB VE direct all runs OK etc just not the serial port UART on the raspi.

Done all the level conversion as a test unit etc i can scope the the comms siganls going in and out just that Venus software dose not respond.

I know the raspi 4 has different UART port arrangement compared to the 3+ etc.

Victron Raspi Hat.pdf

Victron Raspi Stetson.pdf

Any thoughts, i have done all the config files to activate etc.

The only odd thing is after boot the rapsi hangs with the UART connected after disconnecting the RX port it boots OK, doesn't like being loaded up.

Also i have full script file for auto updates to be done automatically now , so need to manual install files etc.



0 Likes 0 ·
outsourcedguru avatar image outsourcedguru Rob Duthie commented ·

You guys might want to read this entire section of the Raspberry Pi documentation which refers to the UARTs, etc.

"There are two types of UART available on the Raspberry Pi - PL011 and mini UART. The PL011 is a capable, broadly 16550-compatible UART, while the mini UART has a reduced feature set. All UARTs on the Raspberry Pi are 3.3V only - damage will occur if they are connected to 5V systems. An adaptor can be used to connect to 5V systems. Alternatively, low-cost USB to 3.3V serial adaptors are available from various third parties."

Model           first PL011 (UART0)   mini UART
--------------- --------------------- ----------
Raspberry Pi 3  secondary (Bluetooth) primary

So, it's possible to reconfigure the defaults for the Raspberry Pi 3 to disable Bluetooth and then use the "good" UART as the primary for /dev/ttyS0. See also miniuart-bt to just put Bluetooth on the "cheap" UART. (These flags are usually set in cmdline.txt as I recall.)

You might review the enable_uart flag. Search that same page for "Disabling the Linux Serial Console". Basically, read that entire section.

0 Likes 0 ·
bashers avatar image
bashers answered ·

I've been down this road and will update as its the first google hit when i search for it.

  • The raspberry pi4 CAN do it if you remap the UART ports.
  • The rasberry pi3 CAN'T as the serial console is hard coded onto the serial port so unusable as a serial port
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.

Rob Duthie avatar image Rob Duthie commented ·
0 Likes 0 ·
outsourcedguru avatar image outsourcedguru commented ·
See my reply to Rob above. "Out of the box", the Raspi3 uses the cheap UART instead of the good one. It can be configured, of course.
0 Likes 0 ·