Immediately after trying to load the g_ether module, and trying to manipulate it using sysfs (according to (https://linux-sunxi.org/USB_Gadget/Ethernet#Configuring_the_gadget_under_configfs)), followed by an attempt to return to g_serial. Led to: usb0-vbus: disabling
olimex@a64-olinuxino:/etc/NetworkManager/system-connections$ sudo dmesg | grep usb
[ 0.073017] usbcore: registered new interface driver usbfs
[ 0.073067] usbcore: registered new interface driver hub
[ 0.073110] usbcore: registered new device driver usb
[ 0.846796] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 1.047234] usbcore: registered new interface driver usb-storage
[ 1.050998] usbcore: registered new interface driver usbhid
[ 1.051002] usbhid: USB HID core driver
[ 1.175271] usb0-vbus: supplied by regulator-dummy
[ 1.176448] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 1.312920] ehci-platform 1c1a000.usb: EHCI Host Controller
[ 1.312945] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[ 1.313060] ehci-platform 1c1a000.usb: irq 27, io mem 0x01c1a000
[ 1.330796] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[ 1.331032] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[ 1.331041] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.331048] usb usb1: Product: EHCI Host Controller
[ 1.331055] usb usb1: Manufacturer: Linux 5.10.60-olimex ehci_hcd
[ 1.331062] usb usb1: SerialNumber: 1c1a000.usb
[ 1.332783] ehci-platform 1c1b000.usb: EHCI Host Controller
[ 1.332808] ehci-platform 1c1b000.usb: new USB bus registered, assigned bus number 2
[ 1.332946] ehci-platform 1c1b000.usb: irq 29, io mem 0x01c1b000
[ 1.346799] ehci-platform 1c1b000.usb: USB 2.0 started, EHCI 1.00
[ 1.347012] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[ 1.347021] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.347029] usb usb2: Product: EHCI Host Controller
[ 1.347036] usb usb2: Manufacturer: Linux 5.10.60-olimex ehci_hcd
[ 1.347042] usb usb2: SerialNumber: 1c1b000.usb
[ 1.348638] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[ 1.348662] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 3
[ 1.348786] ohci-platform 1c1a400.usb: irq 28, io mem 0x01c1a400
[ 1.411009] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 5.10
[ 1.411021] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.411029] usb usb3: Product: Generic Platform OHCI controller
[ 1.411036] usb usb3: Manufacturer: Linux 5.10.60-olimex ohci_hcd
[ 1.411043] usb usb3: SerialNumber: 1c1a400.usb
[ 1.412740] ohci-platform 1c1b400.usb: Generic Platform OHCI controller
[ 1.412764] ohci-platform 1c1b400.usb: new USB bus registered, assigned bus number 4
[ 1.412899] ohci-platform 1c1b400.usb: irq 30, io mem 0x01c1b400
[ 1.475073] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 5.10
[ 1.475083] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.475091] usb usb4: Product: Generic Platform OHCI controller
[ 1.475097] usb usb4: Manufacturer: Linux 5.10.60-olimex ohci_hcd
[ 1.475104] usb usb4: SerialNumber: 1c1b400.usb
[ 1.476770] usb_phy_generic usb_phy_generic.3.auto: supply vcc not found, using dummy regulator
[ 1.575085] musb-hdrc musb-hdrc.4.auto: MUSB HDRC host driver
[ 1.575112] musb-hdrc musb-hdrc.4.auto: new USB bus registered, assigned bus number 5
[ 1.575325] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[ 1.575334] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.575341] usb usb5: Product: MUSB HDRC host driver
[ 1.575348] usb usb5: Manufacturer: Linux 5.10.60-olimex musb-hcd
[ 1.575355] usb usb5: SerialNumber: musb-hdrc.4.auto
[ 1.602806] usb 2-1: new high-speed USB device number 2 using ehci-platform
[ 1.742840] usb 2-1: device descriptor read/64, error -71
[ 1.994831] usb 2-1: device descriptor read/64, error -71
[ 2.234870] usb 2-1: new high-speed USB device number 3 using ehci-platform
[ 2.374849] usb 2-1: device descriptor read/64, error -71
[ 2.626811] usb 2-1: device descriptor read/64, error -71
[ 2.738843] usb usb2-port1: attempt power cycle
[ 2.942798] usb 2-1: new high-speed USB device number 4 using ehci-platform
[ 3.362793] usb 2-1: device not accepting address 4, error -71
[ 3.494797] usb 2-1: new high-speed USB device number 5 using ehci-platform
[ 3.914808] usb 2-1: device not accepting address 5, error -71
[ 3.920682] usb usb2-port1: unable to enumerate USB device
[ 4.314850] usb 4-1: new full-speed USB device number 2 using ohci-platform
[ 4.535851] usb 4-1: not running at top speed; connect to a high speed hub
[ 4.551850] usb 4-1: New USB device found, idVendor=058f, idProduct=6387, bcdDevice= 1.00
[ 4.551862] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.551870] usb 4-1: Product: Mass Storage
[ 4.551876] usb 4-1: Manufacturer: Generic
[ 4.551883] usb 4-1: SerialNumber: F9880E40
[ 4.554096] usb-storage 4-1:1.0: USB Mass Storage device detected
[ 4.554850] scsi host0: usb-storage 4-1:1.0
[ 4.559656] usbcore: registered new interface driver uas
[ 31.710892] usb0-vbus: disabling
Linux a64-olinuxino 5.10.60-olimex
Can you help to determine problem...
So
1) lets guest if is device tree
root@a64-olinuxino:/boot# cat uEnv.txt
#
# Auto-generated on: 2020-12-17 20:55:54.395035
# Generated UUID: ac9ed218-eca9-469d-a234-7ebcb5617e81
#
# Put u-boot environment variables here. Before boot, boot.scr will use these variables:
#
# boot_config - Explicitly specify the boot configuration
# fdtoverlays - List of overlay files
# load_legacy - Don't load FIT image,
# optargs - Optional arguments passed to the kernel
fdtoverlays=/usr/lib/olinuxino-overlays/sun50i-a64/spi0-spiflash.dtbo /usr/lib/olinuxino-overlays/sun50i-a64/sun50i-a64-i2c0.dtbo /usr/lib/olinuxino-overlays/sun50i-a64/sun50i-a64-uart2.dtbo
Lets add boot_config=config-9065
Then logs:
#journalctl -g usb
Jan 19 18:19:26 a64-olinuxino systemd[1]: Reached target Hardware activated USB gadget.
Jan 19 18:19:51 a64-olinuxino kernel: usb0-vbus: disabling
lets look closer to Jan 19 18:19:51
Jan 19 18:19:33 a64-olinuxino avahi-daemon[384]: Registering new address record for 192.168.88.243 on eth0.IPv4.
Jan 19 18:19:33 a64-olinuxino NetworkManager[387]: <info> [1674152373.9702] device (eth0): state change: ip-config -> ip-check (>
Jan 19 18:19:34 a64-olinuxino NetworkManager[387]: <info> [1674152374.0058] device (eth0): state change: ip-check -> secondaries>
Jan 19 18:19:34 a64-olinuxino NetworkManager[387]: <info> [1674152374.0073] device (eth0): state change: secondaries -> activate>
Jan 19 18:19:34 a64-olinuxino NetworkManager[387]: <info> [1674152374.0143] policy: set 'dhcpx-02' (eth0) as default for IPv4 ro>
Jan 19 18:19:34 a64-olinuxino NetworkManager[387]: <info> [1674152374.0162] dns-mgr: Writing DNS information to /sbin/resolvconf
Jan 19 18:19:34 a64-olinuxino dbus-daemon[385]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='db>
Jan 19 18:19:34 a64-olinuxino dbus-daemon[385]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.resolve1.se>
Jan 19 18:19:34 a64-olinuxino NetworkManager[387]: <info> [1674152374.2843] device (eth0): Activation: successful, device activa>
Jan 19 18:19:34 a64-olinuxino NetworkManager[387]: <info> [1674152374.2907] manager: startup complete
Jan 19 18:19:38 a64-olinuxino dhclient[445]: No DHCPOFFERS received.
Jan 19 18:19:38 a64-olinuxino sh[445]: No DHCPOFFERS received.
Jan 19 18:19:38 a64-olinuxino sh[445]: Trying recorded lease 192.168.0.1
Jan 19 18:19:38 a64-olinuxino dhclient[445]: Trying recorded lease 192.168.0.1
Jan 19 18:19:38 a64-olinuxino avahi-daemon[384]: Registering new address record for 192.168.0.1 on eth0.IPv4.
Jan 19 18:19:38 a64-olinuxino dhclient[445]: bound: renewal in 473331269 seconds.
Jan 19 18:19:38 a64-olinuxino sh[445]: bound: renewal in 473331269 seconds.
Jan 19 18:19:39 a64-olinuxino sh[639]: eth0=eth0
Jan 19 18:19:44 a64-olinuxino systemd[1]: NetworkManager-dispatcher.service: Succeeded.
Jan 19 18:19:51 a64-olinuxino kernel: usb0-vbus: disabling
Jan 19 18:19:58 a64-olinuxino systemd[1]: systemd-hostnamed.service: Succeeded.
Jan 19 18:21:22 a64-olinuxino kernel: usb 2-1.4: USB disconnect, device number 3
Jan 19 18:21:23 a64-olinuxino kernel: usb 2-1.4: new high-speed USB device number 4 using ehci-platform
Very Interesting! So that why eth0 is getting 192.168.0.1 with out my wish....
So lets add some '#' to dhclient config:
#lease {
# interface "eth0";
# fixed-address 192.168.0.1;
# option subnet-mask 255.255.255.0;
# renew 2 2040/1/12 00:00:01;
# rebind 2 2040/1/12 00:00:01;
# expire 2 2040/1/12 00:00:01;
#}
I am away to check NetworkManager config
To be continued...
Well, nm works great. And the IP substitution place was found, even though the problem is not related to the topic.
As I understand it (having 5v output on micro usb port), the driver is not loaded correctly.
Which driver is responsible for the micro usb port? And where are his configs?