6 Device Test Scripts

This chapter describes the different scripts (Bash scripts) develop to support testing of the different peripherals of the device.

6.1 General information to the scripts

The scripts do not evaluate the tests result itself. The test result must be evaluated on the controlling test system. But the test scripts initialize and controls the peripheral modules so that they run in its standard operation mode. By executing the scripts display status and device health data.

6.1.1 Test script location

The test scripts are located on the following path:
/home/root/production_test/

To run the test script, navigate to the "production_test" folder after logging in with the following instruction:
root@verdin-imx8mp-xxxxxxxx:~# cd production_test

Corresponding console output:
rar4000 console output

6.1.2 Test script help

Each test script has a brief usage description. To show the help text run the script with the argument “-h”.
Generic call:
root@verdin-imx8mp-xxxxxxxx: production_test # ./<script>.sh -h

e.g:
rar4000 generic call eg

6.2 Board Controller Script

Test Script:

  • bcon.sh

Description:
The scripts initializes the serial communication with the board controller (MSP430 MCU) and enables to send commands. The respond from the board controller is displayed in the terminal.

Usage:

  • Request the current voltage levels monitored by the MCU. The response from the MCU is preprocessed from the script and displayed in a readable format.
    instruction:
    ./bcon.sh [channel]
    channel:
    • V_BAT_RTC         coin cell backup battery voltage level
    • VCAP                     super cap voltage level
    • VDDSYS system main voltage level
  • Send any command to the board controller.
    instruction:
    ./bcon.sh -r [cmd]
    cmd:
    • The board controller command as hex code. But do not send the “0x” only the number. See the board controller command listing in chapter 5.3.
      e.g. Set LED3 green blinking (0b10100010 = 0xa2) :
      ./bcon.sh -r a2

Example:
rar4000 board controller script example

 

6.3 EERPOM Script

Test Script:

  • eeprom.sh

Description:
With that script the MAC addresses stored in the two EEPROM devices are retrieved and displayed in the terminal.

Usage:

  • Run the script and the stored MAC addresses are displayed
    ./eeprom.sh

Example:
rar4000 eerpom script example

 

6.4 Ethernet Ports Test Script

Test Script:

  • Etherent.sh

Description:
That script encapsulate different networking tools. It provides a simple access to display the current interface configuration and states and executes a bandwidth test on a specific interface.
For the bandwidth test an iperf server as counterpart has to be running on a host with an known IP address. The default IP will be 192.168.1.1, but a customer IP can be set.

Usage:

  • Display current ethernet port state. If an iperf server is reachable on 192.168.1.1 the result of the bandwidth test is displayed too.
    ./ethernet.sh [port]
    port:
    eth1                       Gigabit Ethernet, port 1

eth2                       100B/T Ethernet, port 2
eth3                       100B/T Ethernet, port 3
eth4                       100B/T Ethernet, port 4
eth_ext                 internal connection to auxiliary CPU (see imx6.sh for activation the module)

  • To connect an iperf server with a different IP use the argument “-i <IP>” before the port.
    e.g. ./ethernent.sh -i 192.168.178.100 eth1

Example:
rar4000 ethernet ports test script example

6.4.1 Using in Test

The scrip is meant to support the following function test cases:

  • DT-TC-F-12 Ethernet Port 1 Functionality
  • DT-TC-F-13 Ethernet Port 2 Functionality
  • DT-TC-F-14 Ethernet Port 3 Functionality
  • DT-TC-F-15 Ethernet Port 4 Functionality

6.4.2 Iperf server

Ethernet transmission test are performed by the use of the CLI bandwidth measurement tool iperf. Iperf can run on Linux, Windows and other operating systems. See https://iperf.fr/ for more information about the iperf framework.

To start an Iperf server use the following cli command on the connected host computer:
iperf3 -s
e.g:
rar4000 iperf server eg 1

The tool can be tests by starting a iperf client and run a test on the RAR4000 device. Use therefore the following cli command:
Iperf3 -c <Ip Address of the Server>
e.g.
rar4000 iperf server eg 2

6.5 GPS Script

Test Script:

  • gps.sh

Description:
That script initializes the GPS Module an displays module status and configuration data. If a position fix occurred the location data are displayed as well.

Usage:

  • That script has no functional parameters. The GPS data are displayed by:

./gps.sh

 

Example:
 rar4000 gps script eg 1

rar4000 gps script eg 2

 

6.6 Auxiliary CPU Module Script

Test Script:

  • Imx6.sh

Description:
By calling that script the imx6 extension board is enabled and communication through the serial and ethernet interface is established.

Usage:

  • That script has no functional parameters. By executing it the communication status is displayed on the terminal. When the script terminates the extension board remains powered up. To turn off the extension module power send the corresponding board controller command (see 6.2 Board Controller Script).

./imx6.sh

Example:
 rar4000 auxiliary cpu module script eg 1

rar4000 auxiliary cpu module script eg 2

 

6.7 Modem Script

Test Script:

  • modem.sh

Description:
That script initializes the modem module. If a SIM card is present a mobile connection is established. The current operation status of the modem is displayed.

Usage:

  • That script has no functional parameters. To enable the modem module and show the status in the terminal call:
    ./modem.sh

Example:
rar4000 modem script eg

 

6.8 SD Card Scripts

Test Script:

  • sdcard_write.sh
  • sdcard_read.sh

Description:
With those script a file write and read action on the SD card can be performed. A dummy file with a known MD5 hash is stored on the SD card. The corresponding dummy file can be read back and the MD5 hash is checked. For better control the SD card write and read action are separated in two scripts.

Usage:

  • To generate a dummy file and write that onto the SD card execute the following command. The script has no functional parameter. The return value on the terminal is the MD5 hash and file name of the stored file.
    ./sdcard_write.sh
  • To read back and do a file corruption check call the following command with the file name returned by the sdcard_write.sh script as argument.
    ./sdcard_read.sh <fileName>

Example:
rar4000 sd card scripts eg

 

6.9 Temperature Sensor Script

Test Script:

  • temp.sh

Description:
The script read the current temperature out of the temperature sensor on the I2C bus and displays the value formatted in milli-degrees Celsius on the terminal.

Usage:

  • That script has no functional parameters. To retrieve the current temperature call:
    ./temp.sh

 

Example:
rar4000 temperature sensor script eg

 

6.10 WLAN Module Script

Test Script:

  • wifi.sh

Description:
The script controls the WLAN module power supply and initialization. Depending on the arguments the WLAN module can be enabled or disabled or a WLAN connection can be established.

Usage:

  • To enable the WLAN module call the script without an argument.
    ./wifi.sh
  • To disable the WLAN module use the argument “-o”:
    ./wifi.sh -o
  • To establish a WLAN connection with an nearby access point use the “-c” argument. The GUI like interface from the tool “nmtui” is opening. Navigate to “Acticate a connection” and select an SSID in the section “Wi-Fi”. See the nmtui how to for further help.
    ./wifi.sh -c

Example:
rar4000 wlan module script eg