What is it?
Note: some users reported that the RTC battery may restart or interfere with starting the BMC. We are investigating it at the moment.
BMC, or Baseboard Management Controller, is a specialized microcontroller that is built into the motherboard of a computer or server. It is responsible for monitoring the system's hardware and providing remote management capabilities, such as power control or temperature monitoring.
Our Turing Pi V2 board is equipped with an Allwinner T113-S3, which provides BMC functionality. This is essentially a mini-computer built into the motherboard. It is equipped with features you would expect from a PC such as a dual-core processor, RAM, and a hard drive, albeit in limited capacity. The best part is that it runs on Linux OS, yes, really!
- Baseboard Management Controller: Allwinner T113-S3
- ARM Cortex-A7 Dual-Core
- 128MB DDR3
- 1GB NAND Flash Memory (MX35LF1GE4AB)
- SD Card slot
And since BMC is integrated with most of the features of the board, it gives us and you an excellent platform for automatization, monitoring and management without need of diving in to very low level programming.
Open Source
BMC Firmware is an open source project. We are continuously working and improving our BMC project to give you a solid base for the best possible experience and flexibility when it comes to managing and controlling your system's hardware. With our open source approach, anyone can access the source code and make modifications to suit their specific needs. We believe that this level of transparency and collaboration will lead to a stronger and more robust BMC firmware for everyone to use.
👉 GitHub Repo: HERE
How to build and modify the BMC Firmware will be discussed on its own dedicated page in "Advance documentation"
How do I access it ?
When you apply power to the Turing Pi V2 board, BMC will start automatically and go through its boot process.
Serial Console
If you want to observe the process from the start, you will need a USB to TTL converter cable, which will allow you to connect to the BMC's serial console and view the system's boot process, kernel messages, and other debug information. This can be extremely useful for troubleshooting issues, and also for understanding how the BMC firmware works and how it interacts with the rest of the system. Additionally, the USB to TTL converter cable will allow you to access the BMC's command line interface (CLI) and make configuration changes, if necessary. The username and password are the same as for SSH access.
Observing the boot up process via Serial Console also helps to quickly identify assigned IP to BMC
- User: root
- Password: turing
Windows USB to TTL:
Here is a short tutorial on how to use a USB to TTL converter cable with Putty on Windows:
- Connect the USB to TTL converter cable to your computer's USB port and to the serial port on the BMC. The exact number of pins on your USB to TTL cable can be different, but the general idea is:
- GND -> GND
- TXD -> RXD
- RXD -> TXD
1. When plugged in, it should show as a COM port in Device Manager
2. Download and install Putty, a free and open-source terminal emulator, from the official website (putty.org).
3. Open Putty and select the Serial option under Connection Type.
4. In the Serial line field, enter the name of the serial port that the USB to TTL converter cable is connected to (e.g. "COM9")
5. In the Speed field, enter the baud rate of the serial connection: 115200
6. Click the Open button to open the connection to BMC's serial console.
7. You should now be able to view the system's boot process, kernel messages, and other debug information in the Putty terminal window. You might need to press the "BMC Reset" button to have it reboot and print all the messages again.
8. To access BMC's command line interface (CLI), you will need to enter the appropriate login credentials when prompted.
9. Once you are logged in, you can run Linux commands and make configuration changes as necessary.
Note: The exact setup and configuration steps may vary depending on the device and the specific USB to TTL converter cable you are using. We recommend checking the device's documentation for more information.
Linux USB to TTL:
- Connect the USB to TTL converter cable to your computer's USB port and to the serial port on the BMC.
- Open a terminal window and use the "dmesg" command to determine the name of the serial port that the USB to TTL converter cable is connected to. It should be something like "/dev/ttyUSB0" or "/dev/ttyACM0".
- Use the "screen" command to open a session on the serial port. For example: "screen /dev/ttyUSB0 115200" or "screen /dev/ttyACM0 115200"
- If prompted, press enter to agree to the device's baud rate, which is 115200.
- You should now be able to view the system's boot process, kernel messages, and other debug information in the terminal window.
- To access BMC's command line interface (CLI), you will need to enter the appropriate login credentials when prompted.
- Once you are logged in, you can run commands and make configuration changes as necessary.
Mac USB to TTL:
-
Connect the USB to TTL converter cable to your computer's USB port and to the serial port on the BMC.
-
Open the terminal window and use the "ls /dev/cu.*" command to determine the name of the serial port that the USB to TTL converter cable is connected to. It should be something like "/dev/cu.usbserial" or "/dev/cu.usbmodem"
-
Use the "screen" command to open a session on the serial port. For example: "screen /dev/cu.usbserial 115200" or "screen /dev/cu.usbmodem 115200"
-
If prompted, press enter to agree to the device's baud rate, which is 115200.
-
You should now be able to view the system's boot process, kernel messages, and other debug information in the terminal window.
-
To access BMC's command line interface (CLI), you will need to enter the appropriate login credentials when prompted.
-
Once you are logged in, you can run commands and make configuration changes as necessary.
Note: On MacOS, you may also use serial terminal software such as CoolTerm, Serial, or ZTerm.
SSH
BMC after booting up will start a standard SSH server on port 22. You can use any of your favorite SSH client to log in.
- User: root
- Password: turing
Note: If you have an older version of BMC Firmware, ssh access as root is not allowed and needs to be changed via Serial Console. You can either flash the new version of BMC Firmware or use the Serial Console to log in and change the settings with the following one-liner:
sed -i.bkp -E 's/^#?PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config && \
/etc/init.d/S50sshd restart
Determine BMC IP
Before you can SSH, interact with WWW interface or API provided by BMC, you need to determine its IP on your network. Currently, at the time of writing the BMC is getting random MAC address at every boot, which will result in a new IP assigned to BMC every reboot.
The easiest way to get the IP of BMC on Linux, Windows and Mac is to install nmap. For windows, you can get nmap binary, but we would recommend using the Windows Subsystem for Linux (WSL) (Tutorial on how to turn it on)
Linux/Mac/WSL Windows one line script
Unplug the Turing Pi V2 from the network first, run the following one line script and plug it back in when asked. You will need nmap and replace the 10.0.0.* with your network range.
One-liner:
range="10.0.0.*"; echo "Please wait, starting scan..."; \
nmap -PN -p 22,80 --open -oG - "$range" | grep -E '22/open.*80/open' | \
awk '{print $2}' | sort -V > initial_scan.txt; \
echo "Plug in BMC, waiting 30sec..."; sleep 30; \
nmap -PN -p 22,80 --open -oG - "$range" | \
grep -E '22/open.*80/open' | awk '{print $2}' | \
sort -V | diff initial_scan.txt -
Example:
vladoportos@DESKTOP-7BCS3LE:~$ range="10.0.0.*"; echo "Please wait, starting scan..." ; nmap -PN -p 22,80 --open -oG - "$range" | grep -E '22/open.*80/open' | awk '{print $2}' | sort -V > initial_scan.txt; echo "Plug in BMC, waiting 30sec..."; sleep 30; nmap -PN -p 22,80 --open -oG - "$range" | grep -E '22/open.*80/open' | awk '{print $2}' | sort -V | diff initial_scan.txt -
Please wait, starting scan...
Plug in BMC, waiting 30sec...
2a3
> 10.0.0.53
As you can see above, the detected IP was 10.0.0.53. The script scans in the IP range specified, and stores all IPs on the network that have ports 80 and 22 open. Then it will ask you to plug in the Turing Pi V2, wait 30 seconds and do the scan again. Finally, compare the results and print out the new IPs
You should be able to ssh or even visit port 80 with your web browser of choice.
Set Fixed IP
Once you are logged in, you might want to set up a fixed IP for your BMC.
In Buildroot Linux OS, you can set a fixed IP, netmask, and gateway by configuring the network settings in the root filesystem. Here are the general steps to set a fixed IP, netmask, and gateway:
Configure the network settings:
You can configure the network settings in the file /etc/network/interfaces
in the root filesystem. For example, to set a fixed IP of 192.168.1.100, netmask of 255.255.255.0, and gateway of 192.168.1.1 on the eth0 interface, you can add the following lines to the file using vi
as an editor.
Currently the original file looks like this:
# interface file auto-generated by buildroot
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
pre-up /etc/network/nfs_check
wait-delay 15
hostname $(hostname)
Edit it to look like this:
# interface file auto-generated by buildroot
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
hwaddress ether 12:34:56:78:9A:BC
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
pre-up /etc/network/nfs_check
wait-delay 15
hostname $(hostname)
Configure DNS settings:
You can configure the DNS settings in the file /etc/resolv.conf
in the root filesystem.
For example, setting the DNS server to 8.8.8.8
Currently the original file looks like this:
search localdomain # eth0
nameserver 1.1.1.1 # eth0
nameserver 1.0.0.1 # eth0
nameserver 4.4.4.4 # eth0
Change it to:
nameserver 8.8.8.8 # eth0
Restart the network:
After configuring the network settings, you will need to restart the network service. You can do this by running this command: /etc/init.d/S40network restart
Check if the IP is set correctly:
You can use commands like ip -a
, ifconfig
or route -n
to check the current IP configuration of the device, you should see that the IP, netmask, and gateway are set to the values you configured.
These settings will persist during the restart of BMC.
Set Fixed MAC
If you prefer to manage IP assignments from your router instead of setting a fixed IP address, you can still set a fixed MAC address for the network interface on BMC. To do this, you need to edit the /etc/network/interfaces
file in a similar way as you would for setting a fixed IP address.
Edit it to look like this:
# interface file auto-generated by buildroot
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hwaddress ether 12:34:56:78:9A:BC
pre-up /etc/network/nfs_check
wait-delay 15
hostname $(hostname)
This will assign a MAC address: 12:34:56:78:9A:BC to the interface. You can easily generate random MAC address for example with this one line script:
printf '%02x:%02x:%02x:%02x:%02x:%02x\n' $((0x02)) $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256))
But you need to make sure that the assigned MAC is not already used by any device on the network.
Set HW clock
At the time of writing, there is no ntp client installed in BMC. However, you can quickly set up the clock and HW clock with the following one-liner. Just replace the "Europe/Bratislava" for your location.
date -s @"$(curl -s "http://worldtimeapi.org/api/timezone/Europe/Bratislava" | \
sed -n 's/.*"unixtime":\([0-9]*\).*/\1/p')"
hwclock --systohc
Note: worldtimeapi.org tends to not respond every single time, so if you get error, try again few times.
BMC Linux OS
BMC SD Card
On the back of the Turing Pi V2 board is an SD card slot, this slot is connected to BMC and BMC will attempt to mount it up during its boot process. You can use it as storage for ISO images, custom scripts or programs.
The supported filesystem for SD cards is:
- NTFS (Make sure you eject the card from Windows, or the BMC Linux will complain and mount it read only )
- exFAT (recommended for Windows)
- FAT32 (not recommended)
SD card is automatically mounted to /mnt/sdcard
How to update BMC
You have two options.
The first one is OTA (Preffered).
OTA (Over-the-Air) firmware update is a method of updating the firmware or software of a device wirelessly, without the need for a physical connection to a computer. In our case, you can update the BMC over the HTTP management website.
You can enter the IP of the BMC into the browser of your choice, and you should be welcomed by the web interface. You can then switch to update, select update file and submit.
You will be able to find updates and releases on our GitHub repository, OTA files ends with .swu extension.
The second option is Flashing IMG file.
It could happen that you forgot your root password or you were experimenting with custom builds and it came to a situation where you can't use OTA update method.
Note that this part is temporary and we are working on our custom flash method.
With the help of Phoenix Suit you can connect micro usb port to your PC and flash .img to the BMC. This also requires installing unsigned UsbDrivers (located in UsbDriver folder).
- .IMG will be available on the release page on our GitHub.
ADB Shell
In addition to the usual method, there is another way to access your BMC (Baseboard Management Controller) in case you have forgotten your password and don't want to go through the hassle of reflashing the entire image. This alternative solution can save you time and effort.
What is ABD ?
ADB stands for Android Debug Bridge, which is a command-line tool used to communicate with Android devices, including smartphones and tablets, for development purposes. It enables developers to perform various tasks, such as installing and debugging apps, modifying device settings, and accessing device logs.
The components of ADB include:
- ADB client: a client that runs on the host machine, which can send commands to an ADB server.
- ADB server: a server that runs on the host machine, which can receive commands from an ADB client.
- ADB daemon: a background process running on an Android device, which can receive commands from an ADB server.
The ADB client and server communicate with each other through a socket connection. The ADB client sends commands to the ADB server, which then forwards the commands to the ADB daemon on the Android device. The ADB daemon processes the commands and returns the results back to the ADB server, which then returns the results to the ADB client.
Install ADB on your PC
You can follow excellent tutorial by Skanda Hazarika -> HERE for installing ADB on Windows, Linux or Mac.
Connect
When you switch to the directory with command line, and execute `adb devices`, ADB will start the server on your PC.
Then use the micro USB port dedicated to BMC and connect it to your PC.
Check for devices again and you should see a new device connected.
The serial number of the device in this example is 0402101560. If you want to run ADB commands on a specific device, you can specify the device serial number using the -s option, like this:
adb -s 0402101560 shell
You are now a root on the BMC you can enable ssh root login by editing /etc/ssh/sshd_config and restarting with /etc/init.d/S40network restart
To change a root password, you need to generate the hash first:
/ # mkpasswd --method=md5 --stdin
Password:
$1$AhimSt2i$B.SlOuTdRN5UnPvT09aVL/
Then you can replace the hash in /etc/shadow for root entry.
#root:$1$L.V2NdFU$0SGB00rL.3tQ1IEyt8BDJ/:1::::::
root:$1$AhimSt2i$B.SlOuTdRN5UnPvT09aVL/:1::::::
daemon:*:::::::
bin:*:::::::
sys:*:::::::
sync:*:::::::
mail:*:::::::
www-data:*:::::::
operator:*:::::::
nobody:*:::::::
sshd:*:::::::
Exit
To leave the shell, simply type:
exit
And to stop the ADB server:
adb kill-server
Resolving Issues with Partially Flashed or Corrupted BMC
Problem Description:
The Baseboard Management Controller (BMC) seems to be partially flashed or corrupted. The console isn't providing any output, and the Android Debug Bridge (ADB) does not detect the device.
Steps to Resolve:
-
Connect your BMC to Windows PC: Use the BMC's USB OTG, which is the USB connector next to the Serial console pins.
-
Short the MOSI and SCLK pins: Restart the board after shorting these pins. Refer to the image for guidance.
-
Check for a new device in Windows Device Manager: After the restart, a new device should appear in the Windows Device Manager.
-
Install the required driver: The new device might require the "AllwinnerUSBFlashDeviceDriver". This driver is in the attached zip file. Ignore any red warning about driver installation; this is a standard alert for internal drivers.
-
Reset and reflash using PhoenixSuit: Follow the guide for resetting and reflashing the device using PhoenixSuit
Updating from SD card
Sometimes PhoenixSuit can't update the BMC and manual update from SD card is needed.
- Connect to the BMC: Use the adb shell or UART as per the instructions provided in the documentation: https://help.turingpi.com/hc/en-us/articles/8686945524893-Baseboard-Management-Controller-BMC-
- Enable SSH root logins (Optional): This can be found under the same link provided above.
- Check for /mnt/sdcard: Use adb shell, UART, or SSH to check if /mnt/sdcard exists with the command
ls -l /mnt/sdcard
. If it doesn't, create it withmkdir -p /mnt/sdcard
. - Check the root partition in use: Use
df -h
to check if /mnt/sdcard is mounted and to note which root partition is in use - ubi0_5 or ubi0_6. - Mount the SD card: If the SD card is not mounted, mount it using
mount /dev/mmcblk0p1 /mnt/sdcard/
. The SD card should be formatted with either FAT32 or exFAT. - Transfer the swu file to the card: This can be achieved either using an external SD card reader or SSH root logins with scp as follows:
scp path\\to\\the\\swu\\file root@ip_of_the_bmc:/mnt/sdcard
. Alternatively, use adb to push the file if you're using adb. - Check the firmware filename: Use
ls -l /mnt/sdcard
to do this. - Create and execute a command: Use the firmware path and the partition information to create the command. If the partition in use is ubi05, flash ubi06 and vice versa. Here's an example command:
swupdate -i /mnt/sdcard/turing_pi2_ce-0.1.0.swu -e stable,upgrade_ubi6
- Reboot: Finally, reboot the system after the flashing process completes.
Download the turingpi_recovery-sdcard.zip from https://github.com/wenyi0421/turing-pi/releases V1 if needed.
Comments (9 comments)