There are a lot of things I like about the Next Thing Co’s C.H.I.P. One is that the usb port works as a USB serial console. This is a little tutorial of how to setup the USB OTG g_serial console on all Allwinner H3 boards including the Orange Pi, Nano Pi, and Banana Pi variants of this chipset.
This may work with other OSs, but it is designed for Armbian. Armbian is amazing when it comes to these Allwinner H3 core boards. Nothing else even comes close.
All of these codes need to be run as root, so well enter super user mode.
1 |
sudo su |
First thing you need to do is add the g_serial to the modules. Run the following command.
1 |
echo "g_serial" >> /etc/modules |
We may or may not need to add a directory, the following code will do that for you if it doesn’t exist
1 |
mkdir -p /etc/systemd/system/serial-getty@ttyGS0.service.d |
now we need to create a file in that directory
1 |
nano /etc/systemd/system/serial-getty@ttyGS0.service.d/10-switch-role.conf |
In that file, add the following lines.
1 2 |
[Service] ExecStartPre=-/bin/sh -c "echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role" |
exit that by pressing Ctrl+x, the tap y, then press enter. Run the following commands.
1 2 |
systemctl --no-reload enable serial-getty@ttyGS0.service echo "ttyGS0" >> /etc/securetty |
That is it. Just give it a reboot.
1 |
reboot |
Now, if you are connected to a computer via USB through the OTG port, a serial port will appear which will allow you to access the console without having to have a usb/serial converter.
That’s all folks.