6. Debian Application

6.1 Display

EM3568 supports HDMI/LVDS dual-display.

_images/LVDS%2BHDMI.jpg Debian_HDMI_Display

If want to make the touch screen available when run the HDMI and LVDS simultaneously, please bind the TP to LVDS as follow.

apt-get update
apt-get install xinput        //install xinput
xrandr                        //list monitors
_images/Debian_list_monitors.png
xinput                  //view the input device ID
_images/input_device_ID.png
xinput map-to-output [ID] [display name]               //bind TP
_images/bind_TP.png

If only HDMI display is required, user can turn off the LVDS.

echo off > /sys/class/drm/card0-LVDS-1/status

6.2 Audio I/O

_images/Audio_IO.jpg
cat /proc/asound/cards                     //view sound card
arecord -Dhw:0,0 -f cd record.wav          //record via headset
aplay -Dhw:0,0 record.wav                  //output via headset or speaker.(Priority: Headphones > Speaker)
aplay -Dhw:1,0 record.wav                  //output via HDMI

6.3 USB Host

_images/USB_Host.jpg

After insert the U-Disk, the device icon will be formed on the desktop.

Two ways to mount the device:

#1 double-click the device icon on the desktop.

_images/Debian_USB_icon.png

#2 double-click the Home icon to enter the main directory, then click Devices to mount.

_images/Debian_USB_icon_2.png _images/Debian_USB3.png

6.4 SD Card

The mounting method of SD card is similar to the U-disk.

Debian_test_SD

6.5 Ethernet

_images/Ethernet.jpg
ifconfig
_images/Debian_ifconfig.png
ping -I eth0 www.boardcon.com       //test eth0
ping -I eth1 www.boardcon.com       //test eth1
Debian_Test_Ethernet

6.6 ADB

Install the ADB driver to the PC before test, then connect PC and board with Micro USB cable.

_images/ADB.jpg

Open the cmd.exe on PC, then execute the command to enable ADB.

adb shell

6.7 4G&GPS

_images/4G_connect.jpg

Step 1, Insert 4G module to PCIe slot (4G model: EC20/EC25).

Step 2, Connect antenna and insert SIM card.

Step 3, Execute follow command to connect 4G network after power on.

pppd call quectel-ppp &         //realize ppp dialing
ifconfig                        //view network interface status
ping -I ppp0 www.boardcon.com   //ping URL/IP to check the connectivity of the detection network
Debian_Test_4G Debian_Test_4G
echo -e "AT+QGPS=1\r\n" > /dev/ttyUSB2      //test GPS
cat /dev/ttyUSB1
Debian_Test_GPS

6.8 SATA

_images/SATA_connect.jpg

EM3568 debian11 OS only supports etx4 format, please format the SATA device to ext4 before test.

ls /dev/                       //view the device name
mke2fs -t ext4 /dev/sda        //format SATA to ext4
_images/Debian_view_SATA_name.png

Mount SATA and test.

mkdir /mnt/sata              //create a Mount Point
mount /dev/sda /mnt/sata     //mount SATA
ls /mnt/sata                //view the contents of the sata
df -h                       //view the space size of the mounted disk
Debian_Test_Sata

6.9 Camera(OV13850)

_images/camera_connect.jpg

The EM3568 Debian11 OS is configured with two cameras (ov13850) by default. If you need to preview the cameras normally, please connect both cameras.

pidof rkaiq_3A_server         //check whether there are threads in rkaiq_3A_server

rkaiq_3A_server has started.

_images/rkaiq_3A_server.png

If there are no threads, execute the command to start rkaiq_3A_server.

/etc/init.d/rkaiq_3A.sh start

view the device channel.

grep "" /sys/class/video4linux/v*/name | grep mainpath
grep "" /sys/class/video4linux/v*/name | grep selfpath
_images/debian_camera_channel.png

Preview camera

gst-launch-1.0 v4l2src device=/dev/video8 ! video/x-raw,format=NV16,width=1280,height=800, framerate=30/1 ! kmssink
gst-launch-1.0 v4l2src device=/dev/video17 ! video/x-raw,format=NV16,width=1280,height=800, framerate=30/1 ! kmssink

Record video

gst-launch-1.0 v4l2src device=/dev/video8 num-buffers=100 ! video/x-raw,format=NV12,width=1920,height=1088,framerate=30/1 ! videoconvert ! mpph264enc ! h264parse ! mp4mux ! filesink location=/tmp/h264.mp4

Take photo

gst-launch-1.0 -v v4l2src device=/dev/video17 num-buffers=10 ! video/x-raw,format=NV12,width=1280,height=800 ! mppjpegenc ! multifilesink location=/tmp/test%05d.jpg

6.10 WiFi&Bluetooth

_images/WiFi%2BBT.jpg

Click the network icon in the top right corner of the UI interface, select the SSID from the list of available networks and enter the password.

_images/Debian_SSID.png _images/Debian_SSID_pw.png _images/Debian_SSID_connect.png
ifconfig       //view the network status
_images/Debian_wifi_status.png
ping -I wlxb66dc25a7822 www.boardcon.com     //ping URL to test wifi
_images/Debian_wifi_ping.png

Click the Buletooth icon in the top right corner of the UI interface, select Devices

_images/Debian_bt.png _images/Debian_bt2.png

The Bluetooth device name is hidden by default. Set the Bluetooth device name to be visible according to the following settings.

_images/Debian_bt3.png _images/Debian_bt4.png

Click Search and select the available device in the list to pair.

_images/Debian_bt5.png

6.11 SPI

Short circuit MISO_M1 and MOSI_M1 of SPI

_images/SPI.jpg
spidev0.0_test          //test SPI0
spidev2.0_test          //test SPI2
_images/Debian_SPI0.png _images/Debian_SPI2.png

6.12 UART

_images/UART.jpg

Short circuit RX and TX of UART, execute the command and input characters to test.

com /dev/ttyS4 115200 8 0 1      //test UART4.  **Ctrl+C** to exit the test.
com /dev/ttyS3 115200 8 0 1      //test UART3
com /dev/ttyS5 115200 8 0 1      //test UART5
_images/Debian_UART.png

6.13 RS485

Connect the RS485 ports of Board A and B with the test line.

RS485 connect _images/RS485.jpg
com /dev/ttyS0 115200 8 0 1
_images/Debian_RS485.png

6.14 CAN

Connect the CAN ports of board A and board B.

_images/CAN_icon.jpg _images/EM3568_CAN.jpg

execute the following commands on the serial terminal of board A and board B.

ip link set can0 down
ip link set can0 type can bitrate 1000000 dbitrate 3000000 fd on
ip link set can0 up

Set one development board as receiver.

candump can0                    // set to receiver

The other board send characters as transmitter.

cansend can0 123#DEADBEEF           // CAN0 send characters 0xDE 0xAD 0xBE 0xEF
_images/Debian_can_test.png

6.15 Keys

_images/EM3568_keys.jpg

Recovery: long press to enter loader mode.

Power: short press to sleep/wake up, long press to shutdown/startup.

Reset: restart the board.

6.16 RTC

The external lithium battery is used to ensure the RTC is still able to work after power off.

_images/EM3568_RTC.jpg
busybox date -s “2023-07-21 15:36:00”      //set system date
hwclock -w                                // set the hardware clock to current system time
hwclock
_images/Debian_RTC_set.png

6.17 video playback

6.17.1 Built-in playback

The script instruction directory is in /rockchip-test/video, just run it.

_images/Built-in_playback.png

6.17.2 Browser playback

Select the video file to be played, right-click the menu and select Open With Other Application…

_images/Browser_playback.png

Locate the Chromium Browser in the list and open it.

_images/Browser_playback_2.png _images/Browser_playback_3.png

You can click the speaker icon in the upper right corner of the desktop to select the audio output channel.

_images/Browser_playback_4.png

user can also start the browser with a command to play.

chromium /media/linaro/144460C44460AA66/video/4KP30/4K30P-BLACKPINK-DDU-DU_DDU-DU.mp4

6.17.3 gst-play-1.0 playback

If some video chromium browser can’t play normally, user can use gst-play-1.0 to play.

cat /sys/kernel/debug/dri/0/state | grep "plane\["    // Select the display for playback
export GST_MPP_VIDEODEC_DEFAULT_ARM_AFBC=1            // Be sure to open AFBC
GST_DEBUG=*mpp*:4 gst-play-1.0 --flags=3 --videosink="kmssink plane-id=129" /media/linaro/144460C44460AA66/video/H265_HEVC/I.O.I-Dream.Girl.2160p.UHDTV.H265.ts  --audiosink="alsasink device=hw:1,0"       // Select sound card 4, audio output via HDMI
_images/debian_gst_play_1.png _images/debian_gst_play_2.png _images/debian_gst_play_3.png