Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel3

In this chapter, common configuration and maintenance tasks are described.

Initial Device Configuration

...

Table of Contents
minLevel1
maxLevel3

In this chapter, common configuration and maintenance tasks are described.

Initial Device Configuration

...

Starting from the Dunfell release of Linux Yocto, SECO Northern Europe devices no longer support a dynamic change of device configuration (e.g. display or touch settings) via xml file with the xconfig script. Initial device configurations need to be made before OS installation and will be attached permanently to that installation. Further changes down the line require a new installation of the OS.

...

The process of booting into the Flash-N-Go System is described in the chapter [Deploying the Linux system to the target]. Within Flash-N-Go System, the xconfig script can be called to modify the device configuration.

Expand
titleWorking with xconfig

Calling xconfig to show available option:

Code Block
FLASH-N-GO:/# xconfig

List the installed configuration of the device:

Code Block
FLASH-N-GO:/# xconfig list

Delete the existing display config:

Code Block
FLASH-N-GO:/# xconfig delnode -y -p /variables/display

Import an xml configuration file, in this example a display config located in /mnt/mstick1/:

Code Block
FLASH-N-GO:/# xconfig import /mnt/mstick1/<my-display-config>.xml -y

More detail about Flash-N-Go infrastructure can be found here.

SECO Northern Europe system configuration

...

As with xconfig, sconfig also no longer support dynamic changes of configuration in the target OS. A new OS installation is required for the new setting to take effect.

Some parts of the system configuration are stored in an xml file stored on one of the boot partitions of the eMMC. This information is shared between the backup OS Flash-N-Go System and the main OS, but also persistent between normal OS installations.

The shared information is stored in an xml file called config.xml, found in /etc/shared. For this purpose, there is a link to the script at /usr/sbin/sconfig which can be called without the absolute path:

...

Call without parameter to show the list of current configurations on the system. Call with -h to show additional help.

If the script is called with a setting as parameter, the setting is read from the XML configuration and displayed on the console.

...

Code Block
root@santaro:~# sconfig gateway 192.168.1.10
root@santaro:~# sconfig gateway
192.168.1.10

The ’name’ set with sconfig is also used as hostname for the device. It defaults to GFMM<serial number>.

Network configuration

...

The Network Manager service is responsible for initializing all network interfaces at system startup and when an ethernet cable or a WLAN stick is plugged in.
The Network Manager stores its config files in the /etc/NetworkManager directory. Normally there is no need to change those files directly as there are some tools available to configure the network.

More information about Network Manager can be found here.

WLAN

...

While SANTOKA has a built-in WLAN module, all other SECO Northern Europe products support WLAN using WLAN USB dongles. A list of supported devices can be found in the BSP release notes. WLAN can be used as client or provide an own network as Access Point.

Network management is done through nmcli, which is a command-line client for the Network Manager and reporting network status. A detail explanation of nmcli usage can be found here and here.

Expand
titleEnable WLAN device

View status of all network devices:

Code Block
nmcli dev status

Check status of WLAN device:

Code Block
nmcli radio wifi

If disabled, enable with the command:

Code Block
nmcli radio wifi on

Configure as WLAN client

Expand
titleConnect to a network

Scan for nearby networks:

Code Block
nmcli dev wifi list

Note the name of networks listed under the column SSID, to connect a desired network:

Code Block
nmcli dev wifi connect <network-name> password <network-password>

Once successfully connected, test the connection with ping:

Code Block
ping north.seco.com

Network Manager will save the connection and auto-connect on reboot, so you don't have to worry about issuing the command every time the device is booted.

Expand
titleManaging connections

View all of the saved connection:

Code Block
nmcli con show

Disconnect from an active connection:

Code Block
nmcli con down <network-name>

Connect to another saved connection:

Code Block
nmcli con up <network-name>

Delete a network from the list:

Code Block
nmcli con delete <network-name>

Configure as WLAN Access Point

It is possible to configure the device to act as WLAN Access Point though this feature is not supported by all WLAN modules and WLAN drivers.

Expand
titleWLAN access point with sub net

To setup a WLAN Access point with own sub network including a DHCP service using the Network Manager use following commands:

Code Block
nmcli connection down wlan0-sconfig-autogenerated
nmcli con add type wifi ifname wlan0 con-name Hotspot autoconnect no ssid test
nmcli con modify Hotspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared wifi-sec.key-mgmt wpa-psk wifi-sec.psk "secret_passphrase"
nmcli con up Hotspot

This creates a “test” network with the password “secret_passphrase”. The connection to identify this setup in the Network Manager is called Hotspot. This kind of WLAN access point assigns each client an own IP Address in its own sub net, starting with 10.42.0.1 by default. Accesses to the internet over an ethernet connection are using NAT (network address translation). This way the clients are not visible from the ethernet.

To remove this connection use:

Code Block
nmcli con delete Hotspot

Compliance to Regulatory Domain

The WLAN modules perform wireless communication that is subject to different local regulations, depending on where the module is used. For example, in the USA the FCC does not allow communication to be performed on channels 12, 13, and 14, whereas in Japan communication is allowed on all channels 1 to 14.

CRDA Regulatory Domain Setting

Most of our systems allow the configuration of the regulatory domain via the standard CRDA support of the Linux kernel.

...

The world regdomain is a bit special. It receives configurations on channels that are not allowed everywhere in the world, which are enabled only if a router announces its network on such a channel.

Run an application at startup

...

The init system changed from System V to systemd. This means that all scripts in /etc/init.d are gone and replaced by systemd units. systemd uses so-called unit-files to configure services to start and stop. The tool systemctl is the main userspace tool to control these if needed.

Expand
titleConfiguring application startup

View list of installed services

Code Block
root@santaro:~# systemctl list-unit-files

Disable/enable a service from automatic startup

Code Block
root@santaro:~# systemctl disable <service-name>
root@santaro:~# systemctl enable <service-name>

Check the status of a service

Code Block
root@santaro:~# systemctl status <service-name>

Example: disable the demo from startup

Code Block
root@santaro:~# systemctl disable guf-show-demo

Web Browser

We provide the qt-kiosk-browser in the default image. It is intended to be used for HTML-based applications starting automatically during system boot, which won’t display the regular browser GUI, i.e. URL-bar, navigation buttons, etc.

...

Check the official documentation of qt-kiosk-browser for further reference.

Features:

  • The provided browser is a reduced single-page or ’kiosk’ mode browser. All pages are opened in Fullscreen mode and there are no UI elements available, neither navigation bar, context menu or status bar.

  • Closing these views is due to the web page’s implementation, as well as implementing forward- and backward functionality if needed.

  • Downloads and pdf views are currently not supported.

  • There is an onscreen keyboard available, that comes up when a text input is selected.

Configuration

The qt-kiosk-browser loads the qt-kiosk-browser git page by default. Customer can change the default URL by configuring the required URL in the qt-kiosk-browser by entering the following commands (replace <Your URL> with required URL):

Expand
titleConfigure URL in qt-kiosk-browser
Code Block
sed -i 's,http://github.com/OSSystems/qt-kiosk-browser,<Your URL>,g' /etc/qt-kiosk-browser.conf

Start the qt-kiosk-browser by entering the following command

Code Block
qt-kiosk-browser /etc/qt-kiosk-browser.conf --no-sandbox

Run the application at startup

The Yocto OS images provided by Seco starts a Qt-based demo application automatically after system boot. To enable Auto Start of the qt-kiosk-browser instead, execute the following commands on the console of the device.

Disable
Expand
titleDisable demo application and enable the qt-kiosk-browser

By default a demo will be launched at startup:

Image Added

To disable the demo from startup

Code Block
systemctl disable guf-show-demo

Create the service file for qt-kiosk-browser and add code in the file

Code Block
cat > /lib/systemd/system/qt-kiosk-browser.service

[Unit]
Description=qt-kiosk-browser

After=weston@root.service
Requires=weston@root.service
Conflicts=getty@tty1.service

[Service]
Type=simple

Environment=XDG_RUNTIME_DIR=/var/run/user/0
Environment=QT_QPA_FONTDIR=/usr/share/fonts/truetype
Environment=QT_QPA_PLATFORM=wayland

ExecStart=qt-kiosk-browser /etc/qt-kiosk-browser.conf --no-sandbox

TimeoutSec=60
Restart=on-failure

StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=qt-kiosk-browser

[Install]
WantedBy=multi-user.target

Enable the qt-kiosk-browser service and reboot the device

Code Block
systemctl enable qt-kiosk-browser

reboot

The browser will load automatically after reboot.

Watchdog

...

Generally a watchdog is a subsystem that monitors the system state in some way and executes a reset when a malfunction is detected. The watchdog service is built of a hardware watchdog device and a linux service.

The hardware watchdog device on SECO Northern Europe devices is capable to execute a hardware reset when not triggered in time. The device node for the hardware watchdog is /dev/watchdog.

The watchdog service is able to monitor different system parameters, like the system load, and can take different actions if any system parameter is out of a defined range. Those repair actions can be simple cleanup scripts or the execution of a reboot or shutdown.

...

Expand
titleConfigure watchdog

The file /etc/systemd/system.conf contains option to configure the watchdog logic.

Code Block
RuntimeWatchdogSec=0

Default value of 0 means watchdog is disabled, set to a value (e.g. 20s) to reboot the system after there is no keep-alive ping during the given interval.

Code Block
RebootWatchdogSec=10min
ShutdownWatchdogSec=10min
KExecWatchdogSec=0

Further configuration to watchdog timing at reboot, shutdown, and by kexec, respectively.

Expand
titleAdd watchdog logic to running service

To add the watchdog logic to a running service, simply add WatchdogSec=<interval> to the systemd unit file of that service.

Code Block
[Unit]
Description=My unit

[Service]
ExecStart=/usr/bin/myunit
WatchdogSec=30s
Restart=on-failure

Further documentation and additional configuration can be found here and here.

Power down mode

...

The system can enter a power down mode to reduce power consumption when the system is not in use. In this mode all PLLs are disabled, CPU voltages are lowered and several hardware components are powered down. The overall power consumption should be less than 500 mW in this mode but actually depends on the device and its hardware assembly option.

...

Expand
titleWakeup sources

RTC: The CPU internal RTC can be configured to wake up the system after a specified time. The following command wakes the system up at 20 seconds after the command has been executed:

Code Block
root@santaro:~# echo +20 > /sys/class/rtc/rtc1/wakealarm

RS232/RS485/MDB: All serial interfaces can be configured to wake up the system on incoming bytes. The following command wakes the system up as soon as a byte is received on the serial debug port:

Code Block
root@santaro:~# echo enabled > /sys/class/tty/ttymxc0/power/wakeup

The average time it takes to wake up from power down mode using the serial debug port has been measured 1326+-4ms (first byte on UART RX until last byte on UART TX).

Note

The first few incoming bytes after and including the wakeup byte might be truncated and not received by the UART driver.

Reboot, Halt and Poweroff

...

As you probably have noticed already, none of our SECO Northern Europe devices are equipped with any kind of power button. This means, they will start booting and running an OS as soon as an external power-supply is connected and turned-on and the only way to turn the device off is to disconnect the external power-supply.

...

The common Unix/Linux utilities to shutdown the system behave accordingly:

  • reboot: will stop all login-services, stop all running applications, flush all caches, unmount all filesystems and safely reboot the system.

  • halt: will stop all login-services, stop all running applications, flush all caches, unmount all filesystems and just "halt" the system, so that a user may safely disconnect the power-supply without risking any data-loss.

  • poweroff: according to Unix/Linux conventions for systems that cannot turn-off themselves, will do just the same as halt.

This means, as per Linux/Unix convention for systems that can’t turn-off themselves, none of these commands will turn-off device power; not even the display power. The halt and poweroff commands will only ensure that the system is put in a state, where no user-processes are running anymore and all data has been written back to storage media.

Kernel command line

...

The kernel command line can be used to change some kernel features.

Note

Be careful changing the command line, as it can easily break the booting process of your device. If booting fails after those changes, you will need to boot into Flash-N-Go System and correct the settings. In this case, please refer to the Flash-N-Go infrastructure manual.

Expand
titleOpen and edit the command line

To change the kernel command line, the boot partition needs to be mounted:

Code Block
mount /dev/mmcblk0p2 /mnt

Open the boot configurator file to edit:

Code Block
nano /mnt/boot.cfg

The boot configuration normally looks similar to this:

Code Block
# Only load linux image as it also contains the configured devicetree attached
load linuximage
exec "console=ttymxc0,115200 root=/dev/mmcblk0p3 rootflags=data=journal rootwait rootfstype=ext4 cma=128M loglevel=6 vt.global_cursor_default=0 vt.color=0xF7 fbcon=logo-pos:center,logo-count:1,rotate:0"

The last line is the kernel command line. Options can be added to the end.

Disabling boot logo

...

By default SECO Northern Europe devices come with the SECO logo as the boot logo at startup. If this is not desired by the customer, the logo can be disabled by adding the parameter “logo.nologo” to the Kernel command line as described above.

Edit the boot.cfg file as shown (adding logo.nologo to the last line):

# Only load linux image as it also contains the configured devicetree attached load linuximage exec "console=ttymxc0,115200 root=/dev/mmcblk0p3 rootflags=data=journal rootwait rootfstype=ext4 cma=128M loglevel=6 vt.global_cursor_default=0 vt.color=0xF7 fbcon=logo-pos:center,logo-count:1,rotate:0 logo.nologo"
Expand
titleDisabling bootlogo
Code Block
Disabling bootlogo

Edit the boot.cfg file as shown (adding logo.nologo to the last line):

Code Block
# Only load linux image as it also contains the configured devicetree attached
load linuximage
exec "console=ttymxc0,115200 root=/dev/mmcblk0p3 rootflags=data=journal rootwait rootfstype=ext4 cma=128M loglevel=6 vt.global_cursor_default=0 vt.color=0xF7 fbcon=logo-pos:center,logo-count:1,rotate:0 logo.nologo"

Changing time and date

...

By default the system time is automatically synced from an NTP Server and user should not need to do any change. However, it is possible to set a custom time for the system using the command timedatectl.

Expand
titleModifying system time with timedatectl

Calling timedatectl will report the current time

Code Block
root@localhost:~# timedatectl
               Local time: Wed 2022-11-02 16:25:24 CET
           Universal time: Wed 2022-11-02 15:25:24 UTC
                 RTC time: Wed 2022-11-02 15:25:24
                Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

To change the time of the device, first NTP Synchronisation must be disabled, then time can be set with the parameter set-time

Code Block
root@localhost:~# timedatectl set-ntp FALSE
root@localhost:~# timedatectl set-time "2022-11-11 08:09:00"
root@localhost:~# timedatectl
               Local time: Fri 2022-11-11 08:09:03 CET
           Universal time: Fri 2022-11-11 07:09:03 UTC
                 RTC time: Fri 2022-11-11 07:09:03
                Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

To use a different NTP server, the config file /etc/systimed/timesyncd.conf can be modified.

Integrating customized driver (module loading)

...

SECO Northern Europe devices can automatically load customized drivers (module) on boot with the help of systemd. The systemd-modules-load.service is responsible for external module loading on system startup. Users can customize this service to integrate their own driver to the system.

Expand
titleLoad a customized driver

First check if systemd-modules-load.service is activated:

Code Block
root@santaro:~# systemctl status systemd-modules-load.service

Create the config file in /etc/modules-load.d/:

Code Block
root@santaro:~# cd /etc/modules-load.d/
root@santaro:/etc/modules-load.d/# touch <module-name>.conf

Edit the file to only contain the module name:

Code Block
<module-name>

Next time the system reboots, the module will be automatically loaded.