The tool software and firmware download address used:
https://41ws38-my.sharepoint.com/:f:/g/personal/ddf_41ws38_onmicrosoft_com/EhgM458YouBBshliWJhjcDcBAU-F5Mu6HTIU8PeKJHZnZA?e=ZnJZa6
Can't download, comment below the post.
Preparation
- Equipment/ hardware : CM311-1a YST TV box + power adapter + remote control, network cable, HDMI cable, USB male-to-male brush cable, personal computer PC, display screen (you can buy a video capture card instead of the display screen), USB keyboard, U Disc, wire brush tool (screwdriver + shorting tool).
- Tool software : USB Burning Tool V2.2.0, Happy TV Assistant V4.0, U disk image writing tool: balenaEtcher.
- Firmware : Android card brush or wire brush package, Armbian system image.
Card swiping method
The purchased CM311-1A is a native system, and it is flashed to a third-party Android operating system, which is more convenient to use. It is better to have ADB turned on by default for the Android system flashed in (not turned on, see Appendix 1), and it is better to get root by default (it is also possible without it).
1. Download card swiping package
The card brush package generally has three files as shown in the figure below.
2. Move the card brush package to the U disk
After downloading, there is no need to decompress the card flashing package, and it can be directly moved to the root directory of the USB flash drive (if there are several files in the card flashing package, all will be moved to the root directory of the USB flash drive).
3. Swipe into the card brush package
CM311-1A shut down, insert the U disk into the side close to the network port. Then turn it on, and keep pressing the left button on the remote control (up, down, left, and right buttons) at the same time. When the progress bar of installing the system update appears, turn it off immediately, and then turn it on quickly, so that the flashing package will continue to flash until the flashing is successful. After success, it will automatically boot into the TV Android system, and then you can unplug the U disk.
Be sure to look carefully, only the picture below has entered the card swiping mode, if you have not entered the card swiping mode, try a few more times. When you see the picture below for the first time, turn off the power switch immediately, and then quickly turn on the power switch. When you see the picture below for the second time, wait patiently for the progress bar to finish.
4. Enter the normal use of the system
After swiping the card, it will automatically enter the system. If you want to flash the Armbian system, please write down the IP address of the set-top box for booting from the U disk (optional, you can also use other methods in Appendix 1 to make the set-top box boot from the U disk).
Wire brush method
Generally, plug in the USB flash drive, plug in the power again, if it can be booted from the USB, just reinstall and try a few more times.
If the screen is black after connecting to the monitor, and it cannot be booted from the USB, it is necessary to short-circuit the box for initialization. First restore the box to the original Android system, and then re-flash into the Armbian system. First download the amlogic_usb_burning_tool system recovery tool and install it. Prepare a USB double-male data cable and a paper clip. Confirm the position of the shorting point (see Appendix 2) on the motherboard of the box, and download the Android TV firmware package corresponding to the box.
amlogic_usb_burning_tool system recovery tool download address: https://github.com/ophub/kernel/releases/tag/tools
Android TV firmware package download address: https://github.com/ophub/kernel/releases/tag/tools
1. USB Burning Tool
Open the flashing software USB Burning Tool.
File → Import Burning Package
[Select]: Erase flash
[Select]: Erase bootloader
Click the [Start] button.
When flashing the machine, the file name of the wire flashing package should not appear in Chinese, otherwise various errors will occur during the wire flashing process.
2. Plug in the power adapter + short circuit
The power adapter is plugged in, the box is connected to the power cord, and the power switch is not turned on (some boxes are not connected to the power cord)
. [USB double-male data cable] connect [Box] with [Computer].
Two choices and three connections, two choices are to erase flash and bootloader; three connections are to plug in the power cord, HDMI non-disassembly artifact, and USB double-male data cable.
3. Start brushing
Turn on the power switch.
When you see [progress bar starts to move], take away the paper clip and don’t short it;
when you see [progress bar 100%], the flashing is complete and the box has been restored to the Android TV system.
If the progress bar does not move, you can try plugging in the power. Generally, no power supply is needed to support power supply, and only the power supply of USB dual male head can meet the flashing requirements.
If one of the above steps fails, try again until it succeeds.
4. Enter the Android TV system
Click the [Stop] button to close the USB Burning Tool software,
and then unplug the [USB double male data cable] between the [Box] and [Computer].
Turn off the power switch, and turn on the power again to restart the box CM311-1A.
Run the Armbian system
1. Make an Armbian boot disk
1. Download the firmware corresponding to your box model
CM311-1A selects the firmware whose file name contains s905l3a. (Jammy is the codename for Ubuntu 22.04; bullseye is the codename for Debian 11)
Armbian system download address: https://github.com/ophub/amlogic-s9xxx-armbian
2. Use balenaEtcher to write Armbian to U disk
Unzip the downloaded compressed package, and then use balenaEtcher to write Armbian to the U disk.
balenaEtcher download link: https://www.balena.io/etcher
2. The set-top box runs the Armbian system
1. Insert the prepared boot disk into the USB interface of the set-top box
2. Modify the set-top box to boot from the U disk
Use Happy TV Assistant to remotely connect to the set-top box.
Click [Debug] → [Start from U disk/SD card]. (Guys, please refer to Appendix 1 to view other ways to set up booting from U disk.)
Happy Box Assistant download address: http://www.kaixindianshi.com/thread-2241-1-1.html
3. Enter the armbian system of the U disk
Then the display will suddenly appear blurry, and then enter the page of running the boot command, that is, successfully enter the armbian system of the U disk.
4. Flash the system to eMMC (optional)
eMMC can be generally understood as a hard disk, and the operating system is written into the hard disk of CM311-1A, covering the original system (in fact, this expression is incorrect). If you need the Android system of the set-top box, you can choose not to flash it in. (Dual system: the third-party system is flashed in the U disk, do not insert the U disk to start the set-top box system, plug in the U disk to start the U disk system, and will not be bricked.) The following is the tutorial for flashing into eMMC
! ! !
The third-party system directly writes to emmc, which can run without the USB disk, and there is a risk of bricking. After bricking, it needs to be restored with a wire brush. It is recommended to back up the current Android system.
After waiting for almost two minutes, check the IP of the set-top box on the router. Use SSH to remotely connect to the Linux system, with the default account root and password 1234. Then you need to change the password. After entering the password twice, disconnect directly.
Re-login to the Armbian system → enter the command:
armbian-install
Here you must first select the box model, here you must look carefully, choose the CM311A-YST version, because the serial number of the ARMBIAN firmware of different versions will be fine-tuned, in this version it is 305, which is the option of s905l3a. Then select the storage format of the system's main files, among which 1 is ext4 format, and 2 is btrfs format. Here I choose ext4 (common), and enter 1. Then wait patiently for the write to complete.
After completion, there will be a prompt text written successfully. At this time, you can turn off the power, unplug the U disk, and power on the box again.
The last step is very important! ! ! (2022.11.26 armbian will not have this situation.) After flashing the system to EMMC, the first time the box is powered off and the USB flash drive is restarted, a black screen will appear. Don’t worry, power off the box for the second time and insert the USB flash drive back. , Power on and operate the box to boot the system normally. After the system booting is completed (the indicator light of the box turns green), power off the box for the third time, unplug the U disk and plug it in again, the box can boot from EMMC and enter the armbian system normally.
5. Network settings (optional)
5.1 Use network cable
The network configuration files are in /etc/network/interfaces
the file . By default, the strategy of DHCP dynamically assigning IP (method 1) is adopted, and the network router connected to Armbian will automatically assign IP. If you want to change to a static IP, you can disable or delete the setting method 1, and enable the static IP setting in method 2.
Method 1 Reference: Dynamic IP Address Assignment by DHCP
source /etc/network/interfaces.d/*
auto eth0
iface eth0 inet dhcp
Method 2 Reference: Manually set a static IP address
source /etc/network/interfaces.d/*
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
5.2 Using wireless WIFI
You need to buy a wireless USB network card, compile and install the driver.
5.2.1 Connect to WIFI via nmcli
nmcli
Is a command-line tool for controlling NetworkManager; can also be used to display the status of network devices; create, edit, open/close and delete network connections. The Armbian system comes with it by default nmcli
, and the installation method will not be introduced here. After directly
connecting to WIFI, the system will record the saved AP. nmcli
The following is the specific connection method:
- Check the device status
Here, the type of wlp2s0 is wifi, which means our wireless network card is disconnected and has not connected to the WIFI hotspot.$ nmcli device status DEVICE TYPE STATE CONNECTION enp1s0 ethernet connected Wired connection 1 wlp2s0 wifi disconnected -- lo loopback unmanaged --
- check the radio
$ nmcli radio WIFI-HW WIFI WWAN-HW WWAN enabled enabled enabled enabled
- Check the nearby wireless network signal.
The fifth column indicates the signal condition. The better the signal, the higher the AP will be.$ nmcli dev wifi list SSID MODE CHAN RATE SIGNAL BARS SECURITY MYSSID Infra 11 54 Mbit/s 100 ▂▄▆█ WPA2 MYSSID Infra 132 54 Mbit/s 100 ▂▄▆█ WPA2 SOMEOTHERSSID Infra 52 54 Mbit/s 49 ▂▄__ WPA2 MYSSID Infra 149 54 Mbit/s 45 ▂▄__ WPA2 MYSSID Infra 11 54 Mbit/s 42 ▂▄__ WPA2 SOMEOTHERSSID Infra 1 54 Mbit/s 27 ▂___ WPA2
- Connect to AP hotspot
- If it is WIFI without password, execute the following connection command, SSID is what we call WIFI name.
$ nmcli device wifi connect <SSID|BSSID>
- Encrypted AP, use the following command.
After executing the command without reporting an error, Ping again to see if Baidu is reachable. If the Ping is successful, it means that the AP has been connected and the Internet can be used normally.$ nmcli device wifi connect <SSID|BSSID> password <password>
- If it is WIFI without password, execute the following connection command, SSID is what we call WIFI name.
5.2.2 Update WIFI system configuration, connect to WIFI
Update /etc/network/interfaces file
- Backup interface:
cd /etc/network && cp interfaces interfaces.bak
- Update interface:
Update /etc/wpa_supplicant/wpa_supplicant.conf# armbian-config created source /etc/network/interfaces.d/* # Local loopback auto lo iface lo inet loopback auto eth0 allow-hotplug eth0 iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
- Backup wpa configuration file:
cd /etc/wpa_supplicant/ && cp wpa_supplicant.conf wpa_supplicant.conf.bak
- Update wpa_supplicant.conf:
network={ ssid="网络 ID" psk="密码" }
- Restart the network, ping Baidu to see if it is connected, and it should be able to connect to the network normally.
5.2.3 Connect to WIFI by other methods
Armbian configuration tool: input in the terminal armbian-config
.
Network management TUI: Enter in the terminal nmtui
.
When using armbian-config, please connect to the wired network first, because armbian-config needs to obtain some data through the network in several places.
common problem
Include some problems and solutions for flashing into the armbian system.
1. How to restore the original Android TV system
Usually use armbian-ddbr backup to restore, or use Amlogic flashing tool to restore the original Android TV system.
Method 1: Use armbian-ddbr backup to restore
It is recommended to back up the original Android TV system that comes with the current box before installing the Armbian system in a new box, so that it can be used when the system needs to be restored. Please TF/SD/USB
start , enter armbian-ddbr
the command, and then follow the prompts to enter b
to the system. The storage path of the backup file is /ddbr/BACKUP-arm-64-emmc.img.gz
, please download and save it. When you need to restore the Android TV system, upload the previously backed up files to the same path of TF/SD/USB
the device , enter armbian-ddbr
the command, and then enter according to the prompts r
to restore the system.
Method 2: Use the Amlogic flashing tool to restore
See wire brush method. Note: Method 1 only supports the Armbian system
whose flashing system is O ( ophub ).
2. SSH connection can not be resolved
SSH can’t connect, port 22 is closed by default after writing to EMMC, the network card doesn’t work, it disconnects after a few seconds, SSH can’t log in after running for a while, etc.
amlogic-s9xxx-armbian/build-armbian/common-files/rootfs/etc/custom_service/start_service.sh
In /etc/custom_service/start_service.sh, modify the two lines 26 and 27 in reverse, some people delete two lines # can work normally, some people add # comments to normal. I was removing # as normal. This problem is because the sshd directory is not generated at startup, but the phenomenon is different for each box.
# [[ -d "/var/run/sshd" ]] || mkdir -p -m0755 /var/run/sshd
# [[ -f "/etc/init.d/ssh" ]] && /etc/init.d/ssh start 2>/dev/null
# 这个脚本的作用是在启动的最后一步,会自动重启下 ssh 服务,确保 ssh 服务起来。(不放心可以添加以下命令)
[[ -f "/etc/init.d/ssh" ]] && sleep 5 && /etc/init.d/ssh restart 2>/dev/null
appendix
Appendix 1. Set the box to boot from USB / TF / SD
Method 1: command version
- Insert the USB/TF/SD flashing the firmware into the box.
- Turn on the developer mode: Settings → About This Machine → Version Number, click the left mouse button 5 times quickly on the version number, and see the prompt displayed
开启开发者模式
by . - Enable USB debugging mode: System → Advanced Options → Developer Options (set
开启USB调试
to enable). EnableADB
debugging . - Install the ADB tool: download adb and unzip it,
adb.exe
copy the three filesAdbWinApi.dll
, , to the two folders under the directory, then open the command panel, use the command , if it is displayed, it means it can be used.AdbWinUsbApi.dll
c://windows/
system32
syswow64
cmd
adb --version
- Enter
cmd
command mode. Enteradb connect 192.168.1.102
the command (the ip in it is modified according to your box, you can check it in the router device connected to the box), and it will be displayed if the link is successfulconnected to 192.168.1.102:5555
. - Enter
adb shell reboot update
the command , the box will restart and boot from the USB/TF/SD you inserted, access the firmware's IP address from the browser, or SSH access to enter the firmware.
adb download address: https://github.com/ophub/kernel/releases/tag/tools or
adb download address: https://developer.android.google.cn/studio/releases/platform-tools?hl=zh- cn#downloads
Method 2: Root version
The swiped-in card brush package has ROOT. Install Reboot to LibreELEC 1.1 Apk into the system and open it to enter recovery mode. After the recovery mode, the system will automatically restart and enter the USB disk for booting.
Reboot to LibreELEC APK download link: https://apkdownloadforandroid.com/download/1000534/2
Method 3: Software version
Happy TV Assistant. See the section on running Armbian on a set-top box.
Appendix II. Short-circuit method
Disassemble and find 4R32 (just look around the edge of the motherboard), and use a conductor (such as: tweezers, pliers, paper clips, scissors, etc.) to connect these two points. You can also use a non-disassembly machine artifact and plug it into the HDMI interface.