Raspberry PI OS is the free operating system and recommended operating system for normal use on a raspberry. Thence we use the raspberry pi 4 B+ as a client of devices.
The user should control the raspberry pi via ssh or xsrdp by hostname and based on the raspberry pi to control and verify the DUT’s functions.
The Architecture:
Currently, we use the wireless interface of the raspberry pi to access the testing network domain. After executing the test they automatically upload the status to JIRA, also connecting the USB interface to the device.
The raspberry pi supports two UARTs (GPIO 14 & 15). when the device provides the serial console, we use it for debugging.
The Raspberry Pi installed programs list and server setup guide.
SSH
enable the SSH services.pi@raspberrypi-xs5g03:~ $ sudo raspi-config select "3. Interface Options" and choose "I2 SSH" to enable the SSH
VNC
enable the VNC serverpi@raspberrypi-xs5g03:~ $ sudo raspi-config select "3. Interface Options" and choose "I3 VNC" to enable the VNC
Xrdp
install the xrdp and add a new user for this service.root@Raspbian:~# apt-get install xrdp root@Raspbian:~# reboot root@Raspbian:~# useradd -m atd #-m參數為新增使用者建立家目錄 root@Raspbian:~# passwd atd #pw XSlinux123
tftp server / ftp server
Installing the tftpd server.sudo systemctl status tftpd-hpa
check the tftpd status
pi@raspberrypi-xs5g03:~ $ sudo service vsftpd status vsftpd.service - vsftpd FTP server Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2022-10-27 13:45:45 CST; 1min 22s ago Process: 2275 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited, status=0/SUCCESS) Main PID: 2276 (vsftpd) Tasks: 1 (limit: 4915) CPU: 16ms CGroup: /system.slice/vsftpd.service └─2276 /usr/sbin/vsftpd /etc/vsftpd.conf Oct 27 13:45:45 raspberrypi-xs5g03 systemd[1]: vsftpd.service: Succeeded. Oct 27 13:45:45 raspberrypi-xs5g03 systemd[1]: Stopped vsftpd FTP server. Oct 27 13:45:45 raspberrypi-xs5g03 systemd[1]: Starting vsftpd FTP server... Oct 27 13:45:45 raspberrypi-xs5g03 systemd[1]: Started vsftpd FTP server.
web server (for WebUI direct)
Installing Apache:pi@raspberrypi:~ $sudo apt-get update pi@raspberrypi:~ $sudo apt-get install apache2 -y
Configure the default web page:
pi@raspberrypi:~ $cd /var/www/html pi@raspberrypi:~ $ls -la
go languageInstalling the golangpi@raspberrypi:~ $ sudo apt-get install golang pi@raspberrypi:~ $ go version go version go1.15.15 linux/arm
adb
Installing the adb
pi@raspberrypi:~ $ sudo apt-get update
pi@raspberrypi:~ $ sudo apt-get install adb android-sdk-platform-tools-common
ppi@raspberrypi-xs5g03:~ $ adb --version
Android Debug Bridge version 1.0.41
Version 28.0.2-debian
Installed as /usr/lib/android-sdk/platform-tools/adb
Verify the adb function.
pi@raspberrypi:~ $ lsusb
Bus 002 Device 002: ID 0e8d:7129 MediaTek Inc. USB DATA CARD
pi@raspberrypi-xs5g03:~ $ adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
351488270000880 device
pi@raspberrypi:~ $ adb shell
8. Enable the UART port.
launch the raspi-config
pi@raspberrypi:~ $ sudo raspi-config
Turn on the serial port.
Install the termial “minicom”
pi@raspberrypi:~# apt-get update
pi@raspberrypi:~# apt-get install minicom
Launch the Serial console port:
pi@raspberrypi:~# sudo minicom -D /dev/ttyUSB4 -b 921600
For XS5G03/04:
Auto add XS5G03/04 modules on raspberry pi:
Add a udev rules file that contains the USB configuration.
pi@raspberrypi:~ $ sudo vim /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ATTR{idProduct}=="7127", MODE="0666", GROUP="plugdev", SYMLINK+="android%n", RUN+="/bin/sh -c 'echo "0e8d 7129" > /sys/bus/usb-serial/drivers/generic/new_id'"
Crate a USB serial configuration file
pi@raspberrypi:~ $ sudo vim /etc/modules-load.d/usbserial.conf
usbserial
Disable the Modem Manager to release /dev/ttyUSB4 (MD AT port)
systemctl disable ModemManager.service
systemctl stop ModemManager.service
Check the Modem Manager status.
systemctl list-dependencies multi-user.target | grep Modem
Reboot the raspberry.
Check the USB devices information.
pi@raspberrypi:~ $lsusb
Bus 002 Device 002: ID 0e8d:7129 MediaTek Inc. USB DATA CARD
View the network interfaces
pi@raspberrypi:~ $ifconfig
....
wwan0: flags=4291<UP,BROADCAST,RUNNING,NOARP,MULTICAST> mtu 1500
inet 169.254.26.41 netmask 255.255.0.0 broadcast 169.254.255.255
inet6 fe80::3abc:c06e:2352:d2b0 prefixlen 64 scopeid 0x20<link>
ether 26:c9:17:59:46:25 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2818 bytes 1021241 (997.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Launch the Serial console port:
pi@raspberrypi:~# sudo minicom -D /dev/ttyS0 -b 921600
Port /dev/ttyUSB4
Press CTRL-A Z for help on special keys
+ESIMS: 1,29
+ESIMS: 0,1
+ESIMS: 0,11
at
OK
Manual add XS5G03/04 modules on a raspberry pi:
pi@raspberrypi:~ $ ls /dev/tty*
pi@raspberrypi:~ $ sudo modprobe usbserial
pi@raspberrypi:~ $ sudo chmod u+w /sys/bus/usb-serial/drivers/generic/new_id
pi@raspberrypi:~ $ sudo echo "0e8d 7129" > /sys/bus/usb-serial/drivers/generic/new_id
pi@raspberrypi:~ $ ls /dev/ttyUSB*
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3 /dev/ttyUSB4 /dev/ttyUSB5 /dev/ttyUSB6 /dev/ttyUSB7
pi@raspberrypi:~ $ minicom -b 115200 -D /dev/ttyUSB3
Reference information:
Raspberry Pi setup part:
reference : https://www.raspberrypi.com/products/raspberry-pi-4-model-b/
https://www.circuitbasics.com/introduction-to-web-servers/
UART Part:
about the UART “lowering power consumption / 1.8V?” at the Raspberry PI.
Level-Shifting HAT For Raspberry Pi 1.8V, 3.3V, 5V https://www.tindie.com/products/cburgess129/level-shifting-hat-for-raspberry-pi-18v-33v-5v/#
Raspberry Pi 4 GPIO Pinout https://linuxhint.com/gpio-pinout-raspberry-pi/
沒有留言:
張貼留言