-2

I have a question regarding wired ssh configuration on beaglebone using Yocto. I have an image ready with:

packagegroup-core-ssh-openssh openssh-sftp-server (and bunch of others but i dont this they are relevant in this situation).

Everything boots fine, but when i do ifconfig there is no usb0:

eth0      Link encap:Ethernet  HWaddr 6C:C3:74:53:D4:7C  
      inet6 addr: fe80::6ec3:74ff:fe53:d47c/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:57 errors:0 dropped:0 overruns:0 frame:0
      TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:19722 (19.2 KiB)  TX bytes:1528 (1.4 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

However, when i do cat /etc/network/interfaces i can see that there is an usb0 with assigned addresses :

# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
iface usb0 inet static
        address 192.168.7.2
        netmask 255.255.255.0
        network 192.168.7.0
        gateway 192.168.7.1

But i am unable to connect to beaglebone via SSH. How can i make this work ?

EDIT1

I believe they are present:

chipidea  gadget  host  musb  phy  renesas_usbhs  storage

./chipidea:
ci_hdrc_pci.ko

./gadget:
function  legacy  libcomposite.ko

./gadget/function:
u_audio.ko   usb_f_acm.ko         usb_f_eem.ko  usb_f_mass_storage.ko  usb_f_obex.ko     usb_f_serial.ko  usb_f_uac1_legacy.ko
u_ether.ko   usb_f_ecm.ko         usb_f_fs.ko   usb_f_midi.ko          usb_f_printer.ko  usb_f_ss_lb.ko   usb_f_uac2.ko
u_serial.ko  usb_f_ecm_subset.ko  usb_f_hid.ko  usb_f_ncm.ko           usb_f_rndis.ko    usb_f_uac1.ko    usb_f_uvc.ko

./gadget/legacy:
g_ether.ko

./host:
ehci-omap.ko  ohci-exynos.ko  r8a66597-hcd.ko  xhci-tegra.ko

./musb:
am35x.ko  musb_am335x.ko  musb_dsps.ko  musb_hdrc.ko  omap2430.ko  sunxi.ko  tusb6010.ko  ux500.ko

./phy:
phy-am335x-control.ko  phy-am335x.ko  phy-generic.ko  phy-keystone.ko  phy-twl6030-usb.ko

./renesas_usbhs:
renesas_usbhs.ko

./storage:
uas.ko

I've loaded most of them and still nothing, loading some of them results in error.

EDIT2

(u_ether.ko loaded properly)

insmod g_ether.ko 
[  795.075491] g_ether: Unknown symbol usb_get_function_instance (err -2)
[  795.082200] g_ether: Unknown symbol usb_string_ids_tab (err -2)
[  795.088198] g_ether: Unknown symbol usb_get_function (err -2)
[  795.093976] g_ether: Unknown symbol usb_composite_unregister (err -2)
[  795.100483] g_ether: Unknown symbol usb_put_function (err -2)
[  795.106266] g_ether: Unknown symbol rndis_borrow_net (err -2)
[  795.112060] g_ether: Unknown symbol usb_add_function (err -2)
[  795.117849] g_ether: Unknown symbol usb_composite_probe (err -2)
[  795.123892] g_ether: Unknown symbol usb_composite_overwrite_options (err -2)
[  795.130996] g_ether: Unknown symbol usb_otg_descriptor_alloc (err -2)
[  795.137491] g_ether: Unknown symbol usb_put_function_instance (err -2)
[  795.144055] g_ether: Unknown symbol usb_otg_descriptor_init (err -2)
[  795.150458] g_ether: Unknown symbol usb_add_config (err -2)
insmod: ERROR: could not insert module g_ether.ko: Unknown symbol in module

EDIT3

Upon loading g_ether i get :

[  272.428045] using random self ethernet address
[  272.432534] using random host ethernet address
[  272.437994] usb0: HOST MAC 16:c1:57:5f:8c:2b
[  272.442386] usb0: MAC aa:7f:b5:c7:12:ad
[  272.446270] using random self ethernet address
[  272.450797] using random host ethernet address
[  272.455457] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[  272.462133] g_ether gadget: g_ether ready

Ifconfig -a :

eth0      Link encap:Ethernet  HWaddr 6C:C3:74:53:D4:7C  
          inet6 addr: fe80::6ec3:74ff:fe53:d47c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5882 (5.7 KiB)  TX bytes:1278 (1.2 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

sit0      Link encap:IPv6-in-IPv4  
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

usb0      Link encap:Ethernet  HWaddr AA:7F:B5:C7:12:AD  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
jkos
  • 45
  • 7

3 Answers3

1

usb0 means you want to use RNDIS driver or something like that. Have you configure your kernel to add this driver ?

You should double Ethernet Gadget configuration.

-- example --

CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y

If it's already done, give use

ifconfig -a

[EDIT]: You can take a look to the kernel conf here: https://github.com/jumpnow/meta-bbb/blob/zeus/recipes-kernel/linux/linux-stable-5.4/beaglebone/defconfig

Ninic0c0
  • 116
  • 5
1

Ok so if the usb0 is not here you should double check the driver load.

Could you check if drivers are compiled and present inside the rootfs :

/modules/<kernel_version>/kernel/drivers/usb
├── common
│   └── ulpi.ko
└── gadget
    ├── function
    │   ├── u_ether.ko
    │   ├── usb_f_mass_storage.ko
    │   └── usb_f_rndis.ko
    ├── legacy
    │   ├── g_acm_ms.ko
    │   ├── gadgetfs.ko
    │   ├── g_ether.ko
    │   └── g_mass_storage.ko
    └── libcomposite.ko

If drivers are present call insmod/modprobe to load them :)

Ninic0c0
  • 116
  • 5
0

I think you should double check your kernel configuration. After that try to load drivers in the good order :)

enter image description here

Ninic0c0
  • 116
  • 5
  • Ok there is some progress, now i can see usb0 when i do infconfig -a + on my linux PC a new device is detected, but without IP. I still cant ping beaglebone. – jkos Apr 01 '20 at 11:20
  • Ok i set the ip with this command: ip a add 192.168.7.2 dev usb0, but i am still unable to ping the device. – jkos Apr 01 '20 at 12:13
  • ok so now you have correclty load drivers ! Good job As always without log it's difficult to help you... Could you give us some plz – Ninic0c0 Apr 01 '20 at 13:07
  • Sorry for delay, as usb0 is present you have to configure it : $ ifconfig usb0 192.168.42.1 set you computer on the same range and try to ping :) – Ninic0c0 Apr 03 '20 at 07:55
  • Trying to ping my PC and get this ping: sendto: Network is unreachable, im not into networking :( what's the issue now? And btw how do i make all of these drivers, configurations etc to be loaded upon system boot ? – jkos Apr 03 '20 at 09:01