ccgx serial console - victronenergy/venus GitHub Wiki

The serial console (ttyO0) of the ccgx is available on the VE.Direct port 1 at the back of the device. It has a double function: it can be used to access the serial console, and can also be used to connect a VE.Direct product. This double function wasn't the best decision in hindsight. But it is what it is.

During a normal boot-up, only SPL/MLO writes one line of data to the serial console:

U-Boot SPL 2013.01.01 (Feb 18 2015 - 09:13:12)

The kernel boot messages are not available on the serial console by default, as it normally expects a VE.Direct device to be connected. (See "Enable kernel boot messages" below)

Once initialization is completed, there are two options:

  • (default) The port is used as a normal VE.Direct port. serialstarter.sh runs all VE.Direct applications against that port until one sticks: a (crude) plug-and-play implementation.
  • vegetty is started for that port, to be the serial console.

In case interested in the CCGX serial console, I assume you are also interested in its special button functions.

Enabling the serial console

You need to enable the Serial Console on VE.Direct Port 1 option on the CCGX menu. That function is hidden, to get it, first set the access level to Superuser, as described here.

The gui is the application that looks at the setting, and enables and starts vegetty as a daemon service when required.

Wiring & baud rate

VE.Direct Port 1 is an isolated port. To make it work, the isolated side needs to be powered externally with anything between 3 to 5V. Normally, when used as a VE.Direct port, it is powered by the connected VE.Direct device.

Therefore, a normal VE.Direct to USB interface cable won't work, since it doesn't supply power to that port. A small mod can be made to the interface cable - preferably by inserting an isolated DCDC converter in it. Careful around isolation though! You might fry your USB port in case you make a mistake here. And obviously all written here comes without any warranty - connecting to serial consoles and doing other modifications is outside normal Victron intended use.

When powered with 3V3, the RX and TX pins are 3V3 too. When powered with 5V, the RX and TX pins are 5V.

Baud rate is 115200.

Pin functions

pin 1 is the one on the left-hand side, when having the keying slot at the top like on this image):

image

PIN Function
pin 1 (at the left) V-
pin 2 RX or TX
pin 3 TX or RX
pin 4 V+

At Victron we modify our standard VE.Direct USB cables for that.

Enable kernel boot messages

Kernel boot messages can be printed though the serial console by adding console=ttyO0,115200 to the U-Boot miscargs environmental variable.

Steps:

  1. Enter U-Boot. See Buttons that modify the boot process
  2. setenv miscargs 'omapdss.def_disp=lcd omapfb.vram=0:2M@0x8fe00000 fbskip fbcon=vc:64 console=ttyO0,115200'
  3. run bootcmd