SomeArmbianForumUser Posted January 7, 2017 Posted January 7, 2017 The orange pi zero has a USB OTG interface, which can be used to interact with it in the absence of networks and spare USB-UART converters. This is not enabled by default in the Armbian image. Here I describe how to modify the system image before first boot to enable this. First, mount the freshly written SD card on a linux computer, become root, and change directory to the mount point, that is, the root directory of the SD card. The following couple of steps were taken from https://oshlab.com/enable-g_serial-usb-otg-console-orange-pi-armbian/which describes how to enable this in a live system, i.e. after first boot. The steps are modified to work on the mounted SD card image. Basically, the first slash before etc is removed. echo "g_serial" >>etc/modules echo "ttyGS0" >>etc/securetty mkdir etc/systemd/system/serial-getty@ttyGS0.service.d Create new file etc/systemd/system/serial-getty@ttyGS0.service.d/10-switch-role.conf with contents [Service] ExecStartPre=-/bin/sh -c "echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role" The guide for the live system then calls systemctl enable which you cannot do here since the system to be modified is not running and you can also not chroot into it because of the ARM architecture. Instead, duplicate that command's effect by creating a symlink: ln -s /lib/systemd/system/serial-getty@.service etc/systemd/system/getty.target.wants/serial-getty@ttyGS0.serviceNote there is a slash before lib, but again no slash before etc. Now unmount the sd card, insert into the orangepizero, power it from a USB port of your computer, or, to be safe, put a powered USB hub between your computer and the orangepizero. Wait for the orangepizero to cycle through its first automatic reboot. You can recognize the reboot by the simultaneous flashing of the RJ45 LEDs. Now you can establish the serial connection with screen /dev/ttyACM0 115200 and login as root from there. May also work for other boards with USB OTG.
tkaiser Posted January 8, 2017 Posted January 8, 2017 This is not enabled by default in the Armbian image. This has been enabled some weeks ago: https://github.com/igorpecovnik/lib/commit/0ca301701388b6f942a8c66f144adadb96af1032 (though not present in current 'stable' OS images which are beta anyway. So by using the nightly builds you get this already)
reamond Posted January 18, 2017 Posted January 18, 2017 You mentioned that it should work with the nightly built images.... but I am on 5.24.170119 (OPI Zero) and I am not sure if the serial gadget / g_serial is properly installed... my installation is missing the "/sys/bus/platform/devices/sunxi_usb_udc/" folder. So any attempt to activate it fails.
zador.blood.stained Posted January 18, 2017 Posted January 18, 2017 @reamond These instructions are for the legacy kernel (3.4.x), and we have nightlies for the Zero only with the dev kernel (4.x)
Alexandru Paverman Posted March 29, 2018 Posted March 29, 2018 OPI Win Plus + Ubuntu Desktop 16.04.3 LTS, does not have enabled serial OTG. Trying to follow advice from this topic I got (in system log) as follows: ................... dev-ttyGS0.device: Job dev-ttyGS0.device/start timed out. Mar 29 13:19:32 localhost systemd[1]: Timed out waiting for device dev-ttyGS0.device. Mar 29 13:19:32 localhost systemd[1]: Dependency failed for Serial Getty on ttyGS0. Mar 29 13:19:32 localhost systemd[1]: serial-getty@ttyGS0.service: Job serial-getty@ttyGS0.service/start failed with result 'dependency$ Mar 29 13:19:32 localhost systemd[1]: dev-ttyGS0.device: Job dev-ttyGS0.device/start failed with result 'timeout'. ................... Please help! Otherwise all seem to work very well., for now.
bigheart Posted December 21, 2018 Posted December 21, 2018 Hi, i have a live system running (Armbian on Orange Pi PC2). i found the Serial OTG on the microUSB is not work. and i didn't modified the image in the SD as described above before first boot. so now i only need to create the symbolic link in /lib/systemd/system as shown above? i checked there is nothing in my /etc/modules and no ttyGS0 in my etc/securetty and no serial-getty@.service in /lib/systemd/system any help here? thanks! Joseph
Recommended Posts