So we have identified the issue on our official image. It is due to amlogic-adbd
service is running on boot, occupying the OTG port.
Please check if your distro also has this service running by executing sudo systemctl status amlogic-adbd.service
. If the output shows Active: active (running)
you need to run sudo systemctl disable amlogic-adbd.service
then shutdown, unplug from host PC, and replug. Once you power cycle the device you can try the following script:
# Based on https://www.collabora.com/news-and-blog/blog/2019/02/18/modern-usb-gadget-on-linux-and-how-to-integrate-it-with-systemd-part-1/
sudo -i
modprobe libcomposite
mkdir /sys/kernel/config/usb_gadget/radxa/ # different distro could have a different configfs mounting point: /sys/kernel/config
cd /sys/kernel/config/usb_gadget/radxa/
echo 0x1d6b > ./idVendor
echo 0x104 > ./idProduct
mkdir -p ./strings/0x409
echo "Radxa" > ./strings/0x409/manufacturer
echo "ECM" > ./strings/0x409/product
mkdir -p ./configs/r.1
mkdir -p ./functions/ecm.usb0
ln -s ./functions/ecm.usb0/ ./configs/r.1/
echo ff400000.usb > ./UDC # ls /sys/class/udc to see available UDCs
This should allow your host PC to have a new interface as well.
You will then need to configure the network on both end. You can refer to your distro’s manual for how-to. You will most likely want to config static IP.
Please let me know the result. If everything is good we will also prepare some systemd
service to make this more permanent. Currently this script does not persist between boot.