Welcome to RDK X3 Robot repository
6. Image installation and backup
6. Image installation and backup
6. Image installation and backup6.1. Burn SD card image6.2. Start the RDK-X36.3. Expand the SD card space6.4. Configure network connections6.4.1. Wireless networks6.4.2 Cable Network6.5. Back up SD card images6.5.1 Compressing Disk Space6.5.2 Viewing Disk Information6.5.3 Starting Disk Backup
Note: The TF matching with the RDK-X3 board car has been burned in the factory, and the TF card can be directly inserted into the robot for use. Generally, there is no need to follow this tutorial to burn the image system!!!
6.1. Burn SD card image
Preparation: win10 system computer, card reader, TF card (32G or larger is recommended), factory image compression package file (see data [factory image]).
Steps:
- Decompress the downloaded system compressed file and get the img image file;
- Insert the TF card into the card reader, and then insert the card reader into the USB port of the computer;
- Start the mirror burning software, here use the Rufus tool;
- Confirm the SD card device number, select the system image to be burned;

- Click "Start", continue to click "confirm", start to burn the mirror;

- The progress bar will show the current writing progress, after the completion of the writing, you can exit the software.
If this window appears, click "OK".


6.2. Start the RDK-X3
- Confirm that the robot kit has been correctly installed;
- Use the serial port module in the kit to connect the debugging serial port of the RDK-X3 at the robot end. The connection sequence is as follows:

- Connect the serial port module to the USB port on the PC, start the serial port software, connect the serial port device, set the baud rate 921600, and turn off the flow control;

If the serial port device cannot be found, download the serial port driver, decompress Serial port driver _CP210x_USB2UART_Driver.zip, double-click dpinst64.exe to install the system driver of the serial port module, and try again.
- Insert the SD card that burns the image, and start the robot power supply;
- In the serial port software, you can see the log information output during the startup process. After a while, the login prompt will appear:

- Enter the user name: 【root】, password: 【yahboom】, you can successfully start the RDK-X3 .

6.3. Expand the SD card space
For easy download, the free space in the factory image has been compressed, and you can obtain the full space of the SD card by expanding the capacity.
Start the RDK- X3 and log in through the serial port, enter
xxxxxxxxxxsudo growpart /dev/mmcblk2 1sudo resize2fs /dev/mmcblk2p1After the system is successfully run, restart the system to take effect. Run the following command to confirm the successful expansion of the system space. The SD card used here is 32GB:
xxxxxxxxxxdf -h
6.4. Configure network connections
6.4.1. Wireless networks
After logging in to Sunrise X3 via serial port, enter,
xxxxxxxxxxsudo nmcli device wifi rescan # 扫描wifi网络sudo nmcli device wifi list # 列出找到的wifi网络Enter the following command to connect to the specified wifi network,
xxxxxxxxxxsudo wifi_connect "SSID" "PASSWD" Wait until the terminal returns the message "successfully activated" to indicate that the WIFI connection is successful. Then you can use SSH to log in to the car remotely through the wireless network without being constrained by the serial port.
6.4.2 Cable Network
By default, the system image is not configured with a static IP address for the wired network. If you need to add, you can enter in the terminal,
xxxxxxxxxxsudo vim /etc/network/interfacesAssume that the static IP address is 192.168.1.20, change the file to:
xxxxxxxxxx# interfaces(5) file used by ifup(8) and ifdown(8)# Include files from /etc/network/interfaces.d:source-directory /etc/network/interfaces.dauto eth0iface eth0 inet static address 192.168.1.20 # 静态IP # Static IP netmask 255.255.255.0 gateway 192.168.1.1 metric 700 # 网络优先级配置 # Network priority configurationAfter the modification is complete, enter the command line,
xxxxxxxxxxsudo restart_networkThe configuration takes effect. Connect the network port of the RDK-X3 to the network port of the PC through a network cable to remotely log in to the PC through SSH.
6.5. Back up SD card images
6.5.1 Compressing Disk Space
Before backing up the image, run gparted to compress the disk space of the SD card and reduce the image size.
To install and start gparted on the virtual machine:
xxxxxxxxxxsudo apt-get install gparted #安装# Installsudo gparted #运行# RunInsert the SD card into the running computer and connect it to the virtual machine. In the open gparted software, select the SD card in the upper right corner:

Then right-click and select Unmount SD card:

Keep right-clicking and select the "Resize/Moves" option to reset the size of the SD card:

Drag the right side of the space partition bar to compress the space, where yellow is the occupied partition, white is the free partition, pay attention to keep a little white free partition, to avoid the mirror failure to start. :

After confirmation, click the Execute button in the software to start the compression operation.

Once the compression is complete, close the gparted software.
6.5.2 Viewing Disk Information
Open the terminal and run the fdisk command to check the current disk status:
xxxxxxxxxxsudo fdisk -u -l
In the figure, /dev/sdb is the disk number of the SD card. Run the following command to view the SD card partition information:
xxxxxxxxxxsudo fdisk -u -l /dev/sdb
6.5.3 Starting Disk Backup
Use dd command to back up SD card to img file, terminal type:
xxxxxxxxxxsudo dd bs=512 count=[fdisk命令中最大的end数+1] if=/dev/sdb of=yahboom_backup.imgAt this time, there is no message displayed on the terminal, but the backup has started and takes a long time. Please wait.
After the backup is complete, the terminal command is automatically displayed, and the img image backup file is displayed in the current path.
The generated img image file is large. If necessary, you can continue to use tools such as zip for compression and decompression.