Skip to content

Common Commands

Here are guides on how and when to run some of the most-used commands.

Some of the file paths to commonly used files are found in the Viewing and Editing Files section.

These commands allow you to stop and start the app directly from the terminal without using the ignition.

NOTE: if the Buildroot command doesn’t work, make sure the file /usr/bin/startup-app.sh is configured correctly.

This will kill the currently running app. It will still be displayed onscreen, but it will be frozen and uninteractive.

  • Yocto, regular: systemctl stop startup-app@bam
  • Yocto, power pack: systemctl stop startup-app@powerpack
  • Buildroot, all: systemctl stop startup-app

This will start the app if it is stopped, or restart it if it is already running.

  • Yocto, regular: systemctl restart startup-app@bam
  • Yocto, power pack: systemctl restart startup-app@powerpack
  • Buildroot, all: systemctl restart startup-app

This will display some status info about the app process: how long it’s been running, the process ID, the last 10 lines of the journal, etc.

To see more journal output, add --lines=<num-lines> after status.

  • Yocto, regular: systemctl status startup-app@bam
  • Yocto, power pack: systemctl status startup-app@powerpack
  • Buildroot, all: systemctl status startup-app

You can also run the top command to see the status of all processes. On Yocto, the app will be normal.app.bam, and on Buildroot, it will be /opt/BambauerPump/bin/BambauerPump -plugin tslib.

This can be used to test the co-processor fail-safe (versions 2.1.0 and later). Run manually, then press Ctrl + C to kill. After a few seconds, the display should reset.

  • Yocto, regular: bash /usr/bin/startup-app.sh bam
  • Yocto, power pack: bash /usr/bin/startup-app.sh powerpack
  • Buildroot, all: bash /usr/bin/startup-app.sh

There are a few commands that can be used to work with the filesystems on the display.

Run the df command to see how much space is available in memory.

Memory is divided into partitions, so we need only to look at the partition that has app-specific files in it.

The Use% column represents how much space in that partition is being used, not the entire disk.

  • Buildroot: filesystem /dev/root, mounted on /
  • Yocto: filesystem /dev/mmcblk3p2, mounted on /rw_data
    • The root filesystem (/dev/root) contains only files needed by the OS

Run the lsblk command to check the mountpoints of all memory partitions.

This command shows similar output to df, but without the memory usage stats. It provides a better representation of partition mountpoints.

This is useful when checking the status of a USB drive: lsblk will show where the USB’s files are mounted/located at.

NOTE: this is only used with Yocto, where the root partition is read-only by default. See here for help getting a Buildroot display out of read-only mode.

Run mount -o remount,rw / to enable read-write access for the root filesystem. This is necessary for updating the app on Yocto.

You can use the hwclock command to set the system time on the display. Note that the steps required are slightly different from Buildroot to Yocto.

Yocto steps:

  1. Run mount -o remount,rw /.

  2. Run hwclock --set --date "M/D/YYYY hh:mm:ss" to set the hardware time. Use the current UTC time.

    • Example: if the current date is 8/21/24 3:19:07 PM EST, you will put “8/21/2024 20:19:07”
  3. Run hwclock --hctosys to update the system time to match.

Buildroot steps:

  1. Run hwclock --set --date "YYYY-MM-DD hh:mm:ss" to set the hardware time. Use the current UTC time.
    • Example: if the current date is 8/21/24 3:19:07 PM EST, you will put “2024-08-21 20:19:07”
  2. Run hwclock --hctosys to update the system time to match.

App updates can be done from a USB using only the command line.

If for some reason your USB drive is not mounted correctly, then you may have to mount it yourself.

  1. Check for the location of the USB partition by running ls /dev/sd*. Look for an sda1 or sdb1 entry.

  2. Then, run the following based on OS:

    Terminal window
    # Buildroot
    mount <usb-loc> /media/usb0
    # Yocto
    mount <usb-loc> /run/media/sda1

When a USB drive is plugged into the display, it is mounted to a particular location on the display’s filesystem.

  • Yocto: /run/media/sda1 and /run/media/sdb1
    • You can use lsblk to figure out what mountpoint is being used
  • Buildroot: /media/usb0

Run ls <path-to-usb>/updates/all to see what all packages are on the USB.

You can use the following commands to install a new version of an app once you have found the package’s location on the USB.

NOTE: this only works for apps that run on the display. Modules cannot be updated with these commands!!

  • Buildroot: run opkg install --force-downgrade --force-reinstall <path-to-package>
  • Yocto: run dpkg --install <path-to-package>
    • You will need to run mount -o remount,rw / if you have not done so already. See here for more info.

It is best to cycle power after updating the app to ensure everything is reset correctly.

If you want to skip this step, run the following:

Terminal window
# Tell the OS to reload the service that runs the app, since you installed a new app
systemctl daemon-reload
# Restart the app: Buildroot
systemctl restart startup-app
# Restart the app: Yocto
systemctl restart startup-app@bam

See here for more info on restarting the app.

Various network configurations and data can be accessed from the command line.

You can use the ip a command on both Yocto and Buildroot to get the IP address of a display.

Look for the entry eth0 in the output. One of the lines underneath it will start with inet. That is where you’ll find the IP address.

There are some simple commands for viewing and editing the contents of files and directories.

Here are the OS-specific locations of the files most used by the app, in case you need to view or edit them directly from the command line:

  • Debug file: telematics.log
    • Yocto location: /rw_data/opt/BambauerPump/bin/logs/
    • Buildroot location: /root/
  • App settings file: settings.ini
    • Yocto location: /rw_data/opt/BambauerPump/bin/
    • Buildroot location: /opt/
  • Spoke.Zone config files: spoke-zone-system.ini (required), spoke-zone-config.ini (optional)
    • Yocto location: /rw_data/etc/spoke-zone/
    • Buildroot location: /etc/spoke-zone/
  • To view the contents of a file, run cat <path-to-file>
  • To view the contents of a directory, run ls -a <path-to-directory>
    • Use ls -a without a path to view the contents of the current directory
  • To move to a different directory, run cd <path-to-directory>
  • To print the current directory, run pwd
  • To create a new empty file, run touch <path-to-file>
  • To create a new file with contents in it, run echo -e "<contents>" > <path-to-file>, where the contents contain \n characters for new lines
  • To remove a file, run rm -f <path-to-file>
  • To remove a directory, run rm -rf <path-to-directory>

Buildroot and Yocto have some differences in text editors, but they both include the vi editor, so we’ll explain how to use that one.

  1. Run vi <path-to-file> to open the text editor. It defaults to view-only.
  2. Press i to enable editing.
  3. Make all changes you need to.
  4. Press Esc to go back to view-only.
  5. Type :wq to save your changes, then press Enter to exit the editor.

If you want to search for a file by name, run find / -name "<file-name>".

This will search the entire filesystem for the file in question. It will output nothing if it can’t find the file you requested.

There are a few commands that can be used to view output from the app and/or OS when trying to debug issues.

All of these command will output a lot of text to the terminal. There are a couple commands that can be used to control this:

  • Pipe output into tail --lines=<num-lines> to see the last num-lines lines of output
  • Pipe output into head --lines=<num-lines> to see the first num-lines lines of output

Examples:

Terminal window
# First 25 lines of the dmesg
dmesg --time-format iso | head --lines=25
# Last 300 lines of the log file
cat <path-to-file>/telematics.log | tail --lines=300

The output from this command will contain kernel-related messages, mostly logged on startup by the kernel itself.

Run dmesg --time-format iso to see the output with human-readable timestamps.

This is part of the output sent up to Spoke.Zone during a log upload.

The journal is the central location for all messages logged by various parts of the system, including the app’s console output and other services.

Run journalctl --boot=0 to see all the output from the current run (since the last power cycle).

The app writes all of its debug messages to the telematics.log file (the file’s location changes from Buildroot to Yocto).

Simply run cat <path-to-file>/telematics.log to see the app’s output.