account : youyeetoo
password : youyeetoo
You can add scripts to execute at the end of ~/.bashrc .
You can add scripts to execute at the end of /etc/profile .
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
Note: It points out that the executable file is /etc/rc.local.
The default state
root@npi:/lib/systemd/system# systemctl status rc-local.service
rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; static; vendor preset:
Drop-In: /lib/systemd/system/rc-local.service.d
└─debian.conf
Active: inactive (dead)
Docs: man:systemd-rc-local-generator(8)
Note: Because there is no /etc/rc.local file, or this file has no permissions.
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
Note: If there is any script to start the startup, it can be inserted before exit 0.
(2) Give executable permission
chmod +x /etc/rc.local
Start the rc.local service
systemctl start rc.local
Query status after restart
systemctl status rc.local
Open the terminal on the Debian system of the development board. Click Start in the lower left corner of the main interface
-> System Tools
-> LX Terminal
There are two ways to set the language:
dpkg-reconfigure
.locale
file.sudo dpkg-reconfigure locales
sudo reboot
sudo vi /etc/default/locale
change the content inside to
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"
change the content inside to
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh"
sudo reboot
echo performance | tee $(find /sys/ -name *governor)
echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo performance > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq
cat /sys/devices/system/cpu/cpufreq/policy4/scaling_cur_freq
timedatectl
timedatectl list-timezones
sudo timedatectl set-timezone Asia/Shanghai
to be continued
to be continued
to be continued
date
date --set='2022-12-30 15:17:42'
hwclock --show
hwclock --systohc
cat /sys/devices/platform/ff3c0000.i2c/i2c-0/0-0020/rk808-rtc/rtc/rtc0/time
Put the desktop file of the program to be started into the ~/.config/autostart/ directory, for example:
mkdir ~/.config/autostart/
cp /usr/share/applications/kodi.desktop ~/.config/autostart/
Switch root user
su
View network card name
ip addr
# ens33 The name of my network card may be different in different versions
Reasons why ifconfig cannot be used:
Command-line tools such as ifconfig, route, arp, and netstat (collectively referred to as net-tools), manage and troubleshoot various network configurations. This type of tool originally originated from the BSD TCP/IP toolkit, which was designed to configure the networking functions of the old Linux kernel. Since 2001, its development in the Linux community has stagnated. Some Linux distributions such as Debian, Arch Linux, and CentOS/RHEL 7 have deprecated net-tools, and other distributions plan to deprecate net-tools and use iproute2 instead.
So if you want to use the ifconfig command again, you need to reinstall net-tools.
Edit the /etc/network/interfaces file and remove the comments when configuring
gedit /etc/network/interfaces
# Add the following content, pay attention to replace the following network card name with the corresponding name, auto means boot
auto ens33
# static is static, dhcp is dynamic
iface ens33 inet static
# The following can be changed according to actual needs
#ip
address 192.168.1.100
# Subnet Mask
netmask 255.255.255.0
# Gateway
gateway 192.168.1.2
Configure dns service
gedit /etc/resolv.conf
# Add the following content, which can be modified according to the actual situation
nameserver 192.168.1.2 #Set preferred dns
nameserver 114.114.114.114 #Set alternate dns
Restart Debian10
reboot
Enter the command on the Debian terminal:
sudo xset –dpms
sudo xset s off
xset dpms force off (Close screen now)
Note: After restarting the prototype, the above settings will become invalid.
Use hdmi-toggle to determine how many display devices there are. For example, HDMI-1 and DP-1 can be detected as follows:
xrandr to set the relationship between the two screens:
su linaro-c "DISPLAY=:0xrandr--outputHDMI-1--1 aboveDP-1"
Among them --above can be replaced by right-of, left-of, below, same-as, preferred, off and so on.
In this way, the function of dual-screen different display can be completed.
Rotate normal/left/right:
vi /etc/X11/xorg.conf.d/1 20-modesetting.conf
You can change normal to left/right/, and it will take effect after reboot.
/media/linaro/B4EA-8716
Remarks: Different U disks have different names, the actual name shall prevail.
Insert the U disk into the usb.
Enter the Debian system, open the terminal, click Start in the lower left corner of the main interface
-> System Tools
-> LX Terminal
.
sudo fdisk -l
dd if=/dev/zero of=/dev/sda1 bs=1M count=2000 oflag=direct,nonblock
dd if=/dev/sda1 of=/dev/null bs=1M count=2000 iflag=direct,nonblock
Insert the TF card into the slot next to MIPI DSI1.
reading and writing test
dd if=/dev/zero of=/dev/sda1 bs=1M count=2000 oflag=direct,nonblock
dd if=/dev/sda1 of=/dev/null bs=1M count=2000 iflag=direct,nonblock
Start in the lower left corner of the main interface
-> System Tools
-> LX Terminal
.sudo lspci
ls /dev/nvme0*
mkdir nvme
mount /dev/nvme0n1p1 /nvme/
cd /nvme/
df -h
dd if=/dev/zero of=/dev/sda1 bs=1M count=2000
oflag=direct,nonblock
dd if=/dev/sda1 of=/dev/null bs=1M count=2000
iflag=direct,nonblock
20pin-0.5mm
.Start in the lower left corner of the main interface
-> System Tools
-> LX Terminal
.dd if=/dev/zero of=/dev/sda1 bs=1M count=2000
oflag=direct,nonblock
dd if=/dev/sda1 of=/dev/null bs=1M count=2000
iflag=direct,nonblock
YY3568 provides dual network ports, both of which can be connected to the external network, and connect the network ports to the Gigabit network port of the router through a network cable.
Enter the Debian system, open the terminal, click Start in the lower left corner of the main interface
-> System Tools
-> LX Terminal
.
PICTURE
ifconfig eth0
ping -I eth0 -c 10 www.baidu.com
Connect to WiFi from the command line
nmcli r wifi on #Step 1: Turn on Wi-Fi
nmcli dev wifi #Step 2: Scan for nearby APs
nmcli dev wifi connect "DIR-803" password "839919060" #Step 3: Connect to the AP
nmcli r wifi off #Step 4: Turn off Wi-Fi
lsusb
Bus 001 Device 003: ID 2c7c:0125 Quectel Wirwless Solutions Co., Ltd. EC25 LTE modem
appears. The 4G module is recognized.sudo ifconfig
wwan0: flags=193<UP,RUNNING,NOARP> mtu 1500
nodes.ping www.google.com
to be continued
Use a serial port module, connect the tx of the serial port module to the rx of the board, connect the rx of the serial port module to the tx of the board, and then connect the GND of the serial port module to the GND of the board (GND must be connected
).
Connect the serial port module to the computer.
Open the serial port software on the computer. Set the baud rate to 9600
The computer sends the serial port data, and the development board receives the serial port data.
Start in the lower left corner of the main interface
-> System Tools
-> LX Terminal
.The development board must be in the receiving state
, and the computer will send the serial port data.Here take the serial port UART4 as an example, start the terminal, and input commands:cat /dev/ttyS4
echo "hello Uart4" > /dev/ttyS4
The i2c-tools tool is a dedicated i2c debugging tool, open source, which can obtain the mounted device and device address, and can also read and write I2C device registers.
Start in the lower left corner of the main interface
-> System Tools
-> LX Terminal
.sudo i2cdetect -l
sudo i2cdetect -F 5
sudo i2cdetect -a -y 5
UU appearing in the figure means that there is a device on the address and the device matches the driver.
Appears in the figure -- means that there is nothing wrong with the device on the address
A number appears in the figure, indicating that there is a device at the address but the device does not match the driver
sudo i2ctransfer -f -y 5 w2@0x5d 0x80 0x47 r3
sudo i2ctransfer -f -y 5 w3@0x5d 0x80 0x47 0x01
# After writing the data, enter the command again, read the information, and confirm that the writing is successful
sudo i2ctransfer -f -y 5 w2@0x5d 0x80 0x47 r3
canutils is a commonly used CAN communication test toolkit, which contains 5 independent programs:
anconfig、candump、canecho、cansend、cansequence。The functions of these programs are briefly described as follows:
canconfig:
The parameters used to configure the CAN bus interface are mainly baud rate and mode.
candump:
Receive data from the CAN bus interface and print it to the standard output in hexadecimal form, and can also output to the specified file.
canecho:
Resends all data received from the CAN bus interface to the CAN bus interface.
cansend:
Send the specified data to the specified CAN bus interface.
cansequence:
To the specified CAN bus interface to automatically repeat the incremental number, you can also specify the receiving mode and check the received incremental number.
ifconfig -a
# Close CAN
ip link set can0 down
# Set the 1M baud rate of the arbitration segment and the 3M baud rate of the data segment:
ip link set can0 type can bitrate 1000000 dbitrate 3000000 fd on
# Print can0 information:
ip -details link show can0
# Start CAN:
ip link set can0 up
# Send (standard frame, data frame, ID: 123, date: DEADBEEF)
cansend can0 123##1DEADBEEF
# Send (extended frame, data frame, ID: 00000123, date: DEADBEEF)
cansend can0 00000123##1DEADBEEF
candump can0
Start in the lower left corner of the main interface
-> System Tools
-> LX Terminal
.Take out the infrared remote control, remove the plastic baffle, and connect the battery in the remote control.
Press the number key on the remote control, and the terminal will print out the corresponding number.
to be continued
Connect the microphone module to the board first, pay attention to the microphone module is active and divided into positive and negative
, do not reverse it.
Enter the Debian system, open the terminal, click Start in the lower left corner of the main interface
-> System Tools
-> LX Terminal
.
arecord -c 2 -r 44100 -f S16_LE –1 d 10 /home/linaro/record.wav
arecord -c 2 -r 44100 -f S16_1 LE /home/linaro/record.wav
aplay /home/linaro/record.wav
Insert 3-segment headphones
directly into the headphone jack.
Note: It must be a 3-segment earphone
to be continued
Do not connect MIPI DSI0 or MIPI DSI1
.Start
in the lower left corner of the main interface -> Video
-> Eggplant
.Start
in the lower left corner of the main interface -> Video
-> Eggplant
.x11vnc is a VNC server. After installation, we can remotely log in to the Debian10 desktop through the network without relying on external display devices.
Install x11vnc
sudo apt-get install x11vnc
Set VNC login password
sudo x11vnc -storepasswd /etc/x11vnc.pwd
Set x11vnc to start automatically at boot
sudo vi /lib/systemd/system/x11vnc.service
# Add the following content
[Unit]
Description=Start x11vnc at startup.
Requires=display-manager.service
After=syslog.target network-online.target
Wants=syslog.target network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -display :0 -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pwd -rfbport 5900 -shared -capslock -nomodtweak
ExecStop=/usr/bin/x11vnc -R stop
Restart=on-failure
[Install]
WantedBy=multi-user.target
Set up the systemd service:
sudo systemctl daemon-reload
sudo systemctl enable x11vnc.service
sudo systemctl start x11vnc
Test Remote Desktop
Start the VNC client software on the computer, enter in the address bar: IP address: 5900 to connect, the effect is shown in the figure below, the IP address of the device in the figure is 192.168.1.123, use port 5900 to connect:
# 10.1-inch HDMI screen
sudo xinput map-to-output 7 HDMI-1
# 7-inch MIPI DSI screen
sudo xinput map-to-output 7 DSI-1