This document contains a collection of (maybe) useful hints and commands for developers to do various task inside the installed SECO North Yocto.
This is a growing document and not ment to reach any state of completeness like a manual, or similar.
[[TOC]]
aplay /usr/share/sounds/alsa/*
wget -P /tmp/ http://support.garz-fricke.com/projects/TestFiles/Audio/short_click_4_times.wav
aplay /tmp/short_click_4_times.wav
```
systemctl stop seco-show-demo
cat > /tmp/audio-playback.qml << 'EOF' import QtMultimedia 5.15 import QtQuick 2.15
Text { text: "Click Me!"; font.pointSize: 24; width: 150; height: 50;
Audio {
id: playMusic
source: "/usr/share/sounds/alsa/Front_Center.wav"
}
MouseArea {
id: playArea
anchors.fill: parent
onPressed: { playMusic.play() }
}
} EOF
qmlscene /tmp/audio-playback.qml ```
Test
Start speaker-test for HDMI card.
sh
speaker-test -c 2 -t wav -D sysdefault:CARD=DWHDMI
Test
Play test audio source with gst-launch for a few seconds for both sound devices.
sh
gst-launch-1.0 audiotestsrc ! audioconvert ! alsasink device=hw:0,0
gst-launch-1.0 audiotestsrc ! audioconvert ! alsasink device=hw:1,0
Expected results
Sound is played through the HDMI display if device=hw:0,0 is used. Sound is played through the speaker if device=hw:1,0 is used.
Bluetooth is currently only basically supported. Commands used for a basic hardware test:
Note: There are devices which do not have R11 populated on the BT Uart's CTS line. These do not support bluetooth. ```
rtkhciattach ttymxc3 rtkh5
hciconfig hci0 up
hcitool scan ``` This currently does not work with yocto kirkstone.
Test
Read device version
sh
/opt/ltp/testcases/bin/spi -m 0x1,0x09 -r 9 /dev/spidev2.0
/opt/ltp/testcases/bin/spi -m 0x1,0x09 -r 9 /dev/spidev2.0
Expected results
Second command return response (9 bytes): 84 09 00 41 00 02 00 ff ff
Test
Read the chip type and OS version
sh
/opt/ltp/testcases/bin/spi -m 0x02,0x10,0x01,0x00,0x0F,0x01C -r 12 /dev/spidev2.0
/opt/ltp/testcases/bin/spi -m 0x02,0x10,0x01,0x00,0x0F,0x01C -r 12 /dev/spidev2.0
Expected results
Second command return response (12 bytes): 00 30 44 41 41 05 20 40 28 05 00 a9
Test
sh
ifconfig can0 down
ip link set can0 up type can bitrate 1000000
ifconfig can0 up
ifconfig can0
sh
candump can0
sh
cangen can0 -n 10 -v
cansend can0 '5A1#11.22.33.44.55.66.77.88'
On the device under test stop stop candump.
On both boards check interface statistics.
sh
ifconfig can0
Repeat steps 2,3 and 4 in other direction (candump on the second board and cangen with cansend on the first board).
Expected results
Interface was successfully setup on both devices. Information received by candump on one board corresponds to the information sent by the other. TX and RX counters were increased by the amount of sent and received packets. Counters for errors, dropped, overruns, frame, carrier and collisions did not increase. ```
/opt/ltp/testcases/bin/can ```
Test
Shutdown device and disconnect the power supply unit.
Start grabserial
tool on host PC:
sh
grabserial --verbose --device="/dev/ttyUSB0" --baud=115200 --time --match="Configuring DDR3 pads.*"
Power up the board.
BLPATH=/sys/class/backlight/backlight/
MAXBRIGHTNESS=$(cat $BLPATH/maxbrightness)
ACTUALBRIGHTNESS=$(cat $BLPATH/actualbrightness)
echo "max brightness value: $MAXBRIGHTNESS"
echo "actual brightness value: $ACTUALBRIGHTNESS"
echo 0 > $BLPATH/brightness
sleep 2
echo $(($MAXBRIGHTNESS/2)) > $BLPATH/brightness
sleep 2
echo $MAXBRIGHTNESS > $BLPATH/brightness
sleep 2
echo $ACTUALBRIGHTNESS > $BLPATH/brightness
echo "done"
EOF
* Set output sections in /etc/xdg/weston/weston.ini as following.
[output]
name=LVDS-1
transform=normal
mode=preferred
[output] name=HDMI-A-1 transform=normal mode=preferred ```
Test
Run prepared backlight-test.sh.
sh
sh /tmp/backlight-test.sh
Expected results
During the test: - at first, LVDS display backlight will turn off; - after 2 seconds, it will turn on with half of maximum brightness level; - after 2 more seconds, brightness will be set to max brightness; - after 2 more seconds, brightness level will be set to pre-test value.
Test
Stop weston.
sh
systemctl stop weston.socket
Check if FB blanking works.
sh
echo 4 > /sys/class/graphics/fb0/blank
sleep 2
echo 0 > /sys/class/graphics/fb0/blank
Start weston again.
sh
systemctl start weston
Expected results
On "echo 4" command, both displays stop showing any image (e.g. there is no signal for HDMI). On "echo 0" command, both displays turn on.
Test
Set mode=off in /etc/xdg/weston/weston.ini for HDMI display. Set mode=preferred in /etc/xdg/weston/weston.ini for LVDS display. Restart weston and check weston-info.
sh
systemctl restart weston
weston-info
Expected results
Image is shown only on LVDS display. Weston-info shows only one working display - LVDS.
Test
Set mode=preferred in /etc/xdg/weston/weston.ini for HDMI display. Set mode=off in /etc/xdg/weston/weston.ini for LVDS display. Restart weston and check weston-info.
sh
systemctl restart weston
weston-info
Expected results
Image is shown only on HDMI display. Weston-info shows only one working display - HDMI.
Test
Set mode=preferred in /etc/xdg/weston/weston.ini for HDMI display. Set mode=preferred in /etc/xdg/weston/weston.ini for LVDS display. Restart weston and check weston-info.
sh
systemctl restart weston
weston-info
Expected results
Image is shown on both displays. Weston-info shows that both display are enabled.
Set different output rotation values. It is assumed that only one output is present in weston.ini. ```
systemctl stop seco-show-demo
sed -i 's/transform=.*$/transform=rotate-90/g' /etc/xdg/weston/weston.ini systemctl restart weston weston-image /usr/share/seco-show-demo/images/icon-hw-info.png
sed -i 's/transform=.*$/transform=rotate-270/g' /etc/xdg/weston/weston.ini systemctl restart weston weston-image /usr/share/seco-show-demo/images/icon-hw-info.png
sed -i 's/transform=.*$/transform=rotate-180/g' /etc/xdg/weston/weston.ini systemctl restart weston weston-image /usr/share/seco-show-demo/images/icon-hw-info.png
sed -i 's/transform=.*$/transform=normal/g' /etc/xdg/weston/weston.ini systemctl restart weston weston-image /usr/share/seco-show-demo/images/icon-hw-info.png ```
gfeeprom --show
Before you run the write command verify the content of eeprom-orig.txt
. Otherwise the original eeprom values may get lost.
```
output=$(gfeeprom --show | grep "0-0050/eeprom ->") eval e=($(echo $output | sed -e 's/[>|()]//g' )) echo "[BEGIN] Controller Index = 1 Device = ${e[1]} EEPROM Address = 0x${e[1]##eeprom} Major Version = ${e[12]} Minor Version = ${e[14]} Article Number = ${e[7]} Serial Number = ${e[10]} Component = ${e[4]} Comment = ${e[16]} Verify = 0x1 Force write = 0x1 [END]" > /tmp/eeprom-orig.txt comment="Write test $(date)" sed "s/Comment =./Comment = ${comment}/" /tmp/eeprom-orig.txt > /tmp/eeprom-test.txt
cat /tmp/eeprom-orig.txt
gfeeprom --program -sf /tmp/eeprom-test.txt gfeeprom --show
gfeeprom --program -sf /tmp/eeprom-orig.txt ```
Test Setup
iperf3 -s -p 5201
nslookup north.seco.com
Connect only the interface that is to be tested to the network. Run iperf client on the board to check upload speed:
sh
iperf3 -c <server_ip> -P4
Run iperf client on the board to check download speed:
sh
iperf3 -c <server_ip> -P4 -R
iperf3 -c <hostname/ip of echo server machine> -p 5201
Expected results
Upload/download speed is greater that 90 Mbit/sec.
Basic test of the iptables
functionality.
On the target, block all traffic:
iptables -A INPUT -j DROP
On the remote device: ``` export DEVICE={Test device IP address}
ping $DEVICE -c3 -W1 for i in {1..255}; do ( ( nc -w 1 -n $DEVICE $i < /dev/null > /dev/null && echo -en "\r" && echo -n "Port $i: " && nc -v $DEVICE $i < /dev/null; echo -en "\r") & ); done ```
Ping should fail and no open port should be reported.
On the target, block all traffic but open port 80 and 53 (for dns)
iptables -F
iptables -A INPUT -j DROP
iptables -I INPUT 1 -p udp --source-port 53 -j ACCEPT
iptables -I OUTPUT 1 -o eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -I INPUT 1 -i eth0 -p tcp -m state --state ESTABLISHED -j ACCEPT
Try to download a webside from the internet:
wget www.google.de
Write the current setup from the previous test to the config file:
iptables-save > /etc/iptables/iptables.rules
Verify the rules are applied after reboot.
Check if a HDMI DRM device was created.
ls /sys/class/drm/ | grep HDMI
Use Get connector name for HDMI: Change weston.ini accordingly: Reboot the device. Test Check light sensor reading with different illumination levels. Expected results The dimmer the illumination, the lower the light sensors reading will be. Test Expected results Communication between test application is established.
There are no errors during transfer.
Reply messages from slave are seen on master.
Slave reported "POLL count: 1" at the end. Test Clean dmesg buffer and reset modem: ```sh
dmesg -C MODEMRESET=$(gpiofind modemreset)
gpioset $MODEMRESET=1; sleep 1; gpioset $MODEMRESET=0 MODEMIGN=$(gpiofind modemignition)
gpioset $MODEMIGN=0; sleep 0.5; gpioset $MODEMIGN=1; sleep 1; gpioset $MODEM_IGN=0
``` Check kernel messages. Check loaded modules. Expected results USB/Network drivers successfully loaded after modem reset/ignition.
There are no errors in dmesg.
The following drivers are loaded as modules:
"qcserial", "qmiwwan", "cdcwdm", "option", "usb_wwan", "usbserial". Test Run AT command to query vendor name. Run AT command to query model number. Retrieve info from SIM card: Expected results AT commands shows: Change the variables ```
echo +5 > /sys/class/rtc/rtc1/wakealarm && echo standby > /sys/power/state ``` ```
echo enabled > /sys/class/tty/ttymxc0/power/wakeup && echo standby > /sys/power/state ``` ```
echo +5 > /sys/class/rtc/rtc1/wakealarm && echo mem > /sys/power/state ``` ```
echo enabled > /sys/class/tty/ttymxc0/power/wakeup && echo mem > /sys/power/state ``` Test Expected results The device should wake up after 5 seconds. Test Expected results Device has to wake up after keypress on the serial console. Test Expected results The device should wake up after 5 seconds. Test Expected results Device has to wake up after keypress on the serial console. Test Power up the device.
Execute: Disable the power supply for only ~1 second.
The device will be powered by the battery for the short power-outage.
Wait for the reset and the system reboot. Expected results The system should execute as reboot and be back online after < 1min. Test Power up the device.
Disable the power supply. The device will then be powered by the battery.
Execute: Wait for device power-down (will be shown on the debug-console).
Wait 10 seconds and re-power the power supply.
Wait for power-up
Execute: Expected results After the shutdown command the console should show: The device should power up normally.\
The reboot should work as expected. This test ensures that certificates are installed on the system and openssl and python have access them.
```
echo -e "import urllib.request\nprint(urllib.request.urlopen('https://www.google.com'))\n" | python3 ``` This test ensures that python 2 and python 3 on the system are complete enough to allow installation of additional packages via pip.
```
pip3 install virtualenv ``` ``` systemctl stop seco-show-demo qt5-opengles2-test ``` ``` systemctl stop seco-show-demo sed -i 's/"URL":.*$/"URL": "https:\/\/north.seco.com\/suchen?",/' /etc/qt-kiosk-browser.conf
qt-kiosk-browser /etc/qt-kiosk-browser.conf --no-sandbox ``` Start a console on the second RS232 interface if present.
Connect two SECO-NE devices using an RS485 full duplex cable.
``` /opt/ltp/testcases/bin/rs485echo -n -e -s 115200 -b 64 /opt/ltp/testcases/bin/rs485echo -n -s 115200 -b 64
``` Connect two SECO-NE devices using an RS485 half duplex cable.
``` /opt/ltp/testcases/bin/rs485echo -e -s 115200 -b 64 /opt/ltp/testcases/bin/rs485echo -s 115200 -b 64
``` Disconnect all network interfaces.
``` date 0102000000
hwclock --systohc date hwclock ``` At the moment sconfig values can not be modified. Plug in a SD-Card with at least one partition in fat32 format.
```
mount /dev/mmcblk1p1 /mnt/ mount | grep mmcblk1p1 echo "Test data" > /mnt/testfile cat /mnt/testfile
``` The SFTP server is running by default. Connect to the device's SFTP server using the The SSH server is running by default. Connect to the device's SSH server using the For on-board sensors like LM75:
``` systemctl stop seco-show-demo fingerpaint
``` ``` systemctl stop seco-show-demo sed -i 's/transform=.*$/transform=rotate-90/g' /etc/xdg/weston/weston.ini
systemctl restart weston
fingerpaint
``` Plug in a USB-Stick with at least one partition in fat32 format.
```
mount /dev/sda1 /mnt/ mount | grep sda1 echo "Test data" > /mnt/testfile cat /mnt/testfile
``` Start a console on the USB OTG port.
``` systemctl stop seco-show-demo curl http://support.garz-fricke.com/projects/TestFiles/Videos/cc-BigBuckBunny-Trailer-800x448-mpeg2-stereo.mpg > /tmp/video
gst-play-1.0 /tmp/video
``` ``` systemctl stop seco-show-demo curl http://support.garz-fricke.com/projects/TestFiles/Videos/cc-BigBuckBunny-Trailer-800x448-mpeg4-stereo.mp4 > /tmp/video
gst-play-1.0 /tmp/video
``` ``` systemctl stop seco-show-demo curl http://support.garz-fricke.com/projects/TestFiles/Videos/cc-BigBuckBunny-Trailer-800x448-h264-stereo.mp4 > /tmp/video
gst-play-1.0 /tmp/video
``` ``` systemctl stop seco-show-demo qmlscene /opt/ltp/scripts/video_playback.qml
```modetest -c
and modetest -p
to find out which connector and crtc values (\
systemctl stop weston
modetest -M imx-drm -s 66@47:1280x800
Weston on HDMI
root@localhost:~# ls /sys/class/drm/ | grep HDMI
card1-HDMI-A-1
[output]
name=HDMI-A-1
...
Light sensor (SantVend)
Test Setup
Light sensor test
sh
cat /sys/bus/iio/devices/iio\:device0/in_illuminance_input
MDB (SantVend)
Test Setup
MDB test
sh
mdbtest_slave ttymxc3
sh
mdbtest_master ttymxc2
Modem
Test Setup
Start Quectel EC21 LTE modem
sh
dmesg
sh
lsmod
AT commands test
sh
echo -ne "AT+CGMI\r\n" | microcom -t 100 -s 115200 /dev/ttymxc4 | sed -n "2p"
sh
echo -ne "AT+CGMM\r\n" | microcom -t 100 -s 115200 /dev/ttymxc4 | sed -n "2p"
sh
echo -ne "AT+CFUN=1\r\n" | microcom -t 100 -s 115200 /dev/ttymxc4 | sed -n "2p"
echo -ne "AT+CPIN?\r\n" | microcom -t 100 -s 115200 /dev/ttymxc4 | sed -n "2p"
echo -ne "AT+CSQ\\r\n" | microcom -t 100 -s 115200 /dev/ttymxc4 | sed -n "2p"
echo -ne "AT+COPS?\r\n" | microcom -t 100 -s 115200 /dev/ttymxc4 | sed -n "2p"
echo -ne "AT+CNUM\r\n" | microcom -t 100 -s 115200 /dev/ttymxc4 | sed -n "2p"
echo -ne "AT+QECCNUM=0,1\r\n" | microcom -t 100 -s 115200 /dev/ttymxc4
NFS
NFS client
NFSSERVER
and SERVERDIR
to match your configuration.
NFSSERVER=<hostname>
SERVERDIR=/home/
mkdir -p /tmp/mnt/nfs
mount -t nfs $NFSSERVER:$SERVERDIR /tmp/mnt/nfs
ls /tmp/mnt/nfs
umount /tmp/mnt/nfs
Power management
Standby mode wakeup from CPU internal RTC
The device should wake up after 5 seconds
Standby mode wakeup from from serial interface
Device has to wake up after keypress on the serial console
Deep sleep mode wakeup from CPU internal RTC
The device should wake up after 5 seconds
Deep sleep mode wakeup from from serial interface
Device has to wake up after keypress on the serial console
Power management: low power modes (SantVend)
Test Setup
echo 8 > /proc/sys/kernel/printk
.
Standby mode wakeup from CPU internal RTC
sh
echo +30 > /sys/class/rtc/rtc1/wakealarm && echo standby > /sys/power/state
Standby mode wakeup from from serial interface
sh
echo enabled > /sys/class/tty/ttymxc0/power/wakeup && echo standby > /sys/power/state
Deep sleep mode wakeup from CPU internal RTC
sh
echo +30 > /sys/class/rtc/rtc1/wakealarm && echo mem > /sys/power/state
Deep sleep mode wakeup from from serial interface
sh
echo enabled > /sys/class/tty/ttymxc0/power/wakeup && echo mem > /sys/power/state
Power management: poweroff
Test Setup
Reset on short powerfail test
sh
shutdown -hP 0
PMIC Off-Mode test
sh
shutdown -hP 0
sh
reboot
[ xx.xxxxxx] reboot: Power down
Python3
Python3 web certificates
Expectet output something like
pip3 functionality
Expected output something like: Successfully installed distlib-0.3.6 filelock-3.8.0 platformdirs-2.5.4 virtualenv-20.17.0
Qt5
OpenGl ES
Preperation
When you touch the display, a rectancle should show up under the finger
Qt Kiosk Browser & Qt Virtual Keyboard
Preperation
You can verfiy the virtual keyboard functionality by clicking the search field and entering text
RS232
RS232 #2
setsid getty -L 115200 ttymxc1 vt100
RS485
RS485 Full Duplex
Start echo Server on device #1
Send messages from device #2
RS485 Half Duplex
Start echo Server on device #1
Send messages from device #2
RTC
RTC write
Set date (02.01.2000) as system time and write it to RTC
Read system time
Read RTC
The result should look like: Sat Jan 2 00:00:00 2000 0.000000 seconds
sconfig
sconfig read
sconfig
sconfig set value
SD-Card
SD-Card read and write
Verify mount
Write
Read
SFTP
SFTP connection
sftp
command.
sftp root@<device-ip>
SSH
SSH connection
ssh
command.
ssh root@<device-ip>
Temperature Sensors
Temperature read
cat /sys/class/hwmon/hwmon0/temp1_input
SOC temperature/s:
cat /sys/class/thermal/thermal_zone*/temp
Touch
fingerpaint
Preperation
fingerpaint rotated by 90 deg
Preperation
USB
USB Host read and write
Verify mount
Write
Read
Serial console on USB OTG port (SANTARO, SANTOKA, SANTINO, SANTINO-LT)
modprobe g_serial
setsid getty -L 115200 ttyGS0 vt100
Video playback
MPEG2 playback
Preparation
MPEG4 ASP playback
Preperation
MPEG4 AVC playback
Preperation
VP9 playback from qml
Preperation
Watchdog
Watchdog test
/opt/ltp/testcases/bin/watchdog-test
WiFi
Scan wireless networks (nmcli)
nmcli dev wifi list
Connect to wireles network (nmcli)
nmcli dev wifi connect <ssid> password "<password>"