User Tools

Site Tools


ccgx:root_access

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ccgx:root_access [2019-06-22 20:46]
mvader [Venus OS: Root Access]
ccgx:root_access [2020-06-28 10:35] (current)
mvader
Line 10: Line 10:
  
 ==== Hooks to install/run own code at boot ==== ==== Hooks to install/run own code at boot ====
 +
 +Everything, except for information on /data, will be wiped after an update.
 +
 +Therefor, the trick to make changes & modifications survive an update, is to put files you need on /data, make them be (re-)installed automatically on startup. This section describes how to do that.
  
 If the files /data/rcS.local or /data/rc.local exists, they will be called early (rcS) and late (rc) during startup. These scripts will survive upgrades and can be used by customers to start their own custom software. Implementation details in [[https://github.com/victronenergy/meta-victronenergy/commit/2dbd16c560ff7cdf70b1d676c0616013169c7484|this commit]]. If the files /data/rcS.local or /data/rc.local exists, they will be called early (rcS) and late (rc) during startup. These scripts will survive upgrades and can be used by customers to start their own custom software. Implementation details in [[https://github.com/victronenergy/meta-victronenergy/commit/2dbd16c560ff7cdf70b1d676c0616013169c7484|this commit]].
Line 22: Line 26:
 https://github.com/victronenergy/venus/wiki/swupdate-project https://github.com/victronenergy/venus/wiki/swupdate-project
  
-==== Available disk space ==== +==== Partitions and available disk space ====
-See https://github.com/victronenergy/venus/wiki/machines.+
  
-And see ''/opt/victronenergy/swupdate/resize2fs.sh'', as explained [[https://github.com/victronenergy/meta-victronenergy/commit/9110beead383c22523512da992e2572c176febef|in this commit]]Source file for the script is [[https://github.com/victronenergy/meta-victronenergy/blob/master/meta-venus/recipes-support/swupdate-scripts/files/resize2fs.sh|here]].+On a GX Device, there are three partitions that matter: 
 + 
 +  * rootfs partition one 
 +  * rootfs partition two 
 +  * the data partition 
 + 
 +Only one of the two rootfs partitions will be in use. When doing a firmware update, it will be installed on the other, and the subsequent reboot will reboot the device onto that other partition. 
 + 
 +The data partition is not touched during a firmware update, except maybe some migration scripts that run at boot. 
 + 
 +When doing modifications, make sure both the data partition and the rootfs do not run out of space. We don't design or test for that situation. 
 + 
 +With regards to the size of the data partition, thats easy to check using the ''df'' utility. But not so for the rootfs: 
 + 
 +After logging into a GX device, and checking the free disk space on the rootfs(! thats not the data partition), you might get a bit disappointed at first. Don't worry too much, by design there will always be only 5% of free space. 
 + 
 +The reason behind is that a firmware update replaces the full filesystem on the rootfs (as an image). And its then not expanded to the full available space of the partition reserved for the rootfs. 
 + 
 +To see the full space, run ''/opt/victronenergy/swupdate/resize2fs.sh''. It will expand the filesystem to use all of the available space. 
 + 
 +For actual available diskspace on our GX Devicessee https://github.com/victronenergy/venus/wiki/machines. 
 + 
 +To see what resize2fs.sh is doing, without having to log into your Venus OS, see it also [[https://github.com/victronenergy/meta-victronenergy/blob/master/meta-venus/recipes-support/swupdate-scripts/files/resize2fs.sh|here]]
 + 
 +Note that a firmware update will replace all of the rootfs, as also explained above. Which implies that you'll need to run resize2fs.sh again after doing a firmware update.
  
 ==== 1. Set access level to Superuser ==== ==== 1. Set access level to Superuser ====
Line 71: Line 98:
 https://www.victronenergy.com/live/open_source:ccgx:commandline https://www.victronenergy.com/live/open_source:ccgx:commandline
  
-==== 6. Connecting via the console instead of over ssh ====+==== 6. Connecting on the serial console ==== 
 + 
 +=== Introduction === 
 + 
 +The serial console offers a straight connection from your computer. Not relying on TCP or anything else. 
 + 
 +Its an alternative to connecting to the commandline over ssh
 + 
 +Connecting to the serial console requires a USB interface, ie a USB to serial cable with proper pin-out. For example this one: https://www.adafruit.com/product/954. 
 + 
 +The serial consoles on all GX devices are configured to 115200 baud. 
 + 
 +=== Serial console on CCGX === 
 + 
 +All GX Devices have a dedicated serial console, except for the CCGX. Therefor its documented on a separate page: 
 + 
 +[[https://github.com/victronenergy/venus/wiki/ccgx-serial-console|CCGX Serial Console]]. 
 + 
 +=== Serial Console on Cerbo GX === 
 + 
 +The serial console is located on the CPU board, header JP201. GND is pin 1, RX and TX are pins 4 and 5. Here is a picture showing a [[https://www.adafruit.com/product/954|ADA Fruit Serial Console cable]] connected to it. 
 + 
 +Make sure not to connect the red wire.
  
-First, note that this is only relevant for the CCGX, as the Beagleboards have a uart dedicated to a console function+{{ :ccgx:cerbo_serial_console.jpg?nolink&600 |}}
  
-See menu item Settings -> Services -> Console on VE.Direct 1 +=== Serial Console on Venus GX ===
  
-Enable the Serial Console on VE.Direct Port 1. Serial console is a software developers feature. This will disable VE.Direct 1 functionality on this port+The serial console is located on the base-board, and can be accessed through the slot between that board and the Ethernet connector on the beaglebone-board.
  
-Settings are 115k2 / 8N1. Note that a normal VE.Direct to USB interface cable won't work, since you need to power the VE.Direct port on the CCGX from the outside. A small mod can be made to the interface cable. [[https://github.com/victronenergy/venus/wiki/ccgx-serial-console|More information about the serial console]].+White: TX of the Beaglebone - connect to RX on your cable 
 +Black: ground 
 +Green: RX of the Beaglebone - connect to TX on your cable
  
 +Make sure not to connect the red wire.
  
 +Here is a picture showing how, also using the adafruit serial console cable as referenced above:
  
-===== DISQUS ===== +{{ :ccgx:venus_gx_serial_console.png?nolink&600 |}}
-~~DISQUS~~+
  
ccgx/root_access.1561229191.txt.gz · Last modified: 2019-06-22 20:46 by mvader