BBB usb gadget questions

Hi There…

I’ve completed building an image for the BeagleBone Black using 5.4.182-bone-rt-r64 from Robert Nelson’s instructions
Debian: Getting Started with the BeagleBone Black

First off, thanks so much for these detailed instructions. I can’t imagine the amount of work that this level of support requires.

Some questions:

  1. Strangely, I could not connect using the usual USB method (connecting mini-USB to PC and then ssh to 192.168.7.2 or 192.168.6.2) or connecting the ethernet port to a router. I had to connect by USB / FTDI serial @115200. Once I did that, I was then able to reboot and subsequently see the BeagleBone on the router. Perhaps this is something foolish I did in the process, just mentioning it in case someone else has seen the same.

  2. Still cannot connect through USB (192.168.7.2 or 192.168.6.2), but can connect over the ethernet port.

  3. Can’t log in as root. I don’t know if this is important. My intention was to change the password as I thought that was the safest thing to do. I did change the password for the debian username.

  4. Did not see anything in /opt/scripts/tools. I know I’ve seen the git URL for this somewhere, but I seem to be going in circles trying to find this.

  5. Do not see anything in cat /etc/dogtag.

Once again, thanks so much for these instructions, and please excuse me if I’ve made foolish mistakes here.

Warm Regards,
Alan Thomason

Dmesg.txt (22.2 KB)

also, please find attached the build history…

history_20220322_simplified.txt (2.9 KB)

Hi @Sunbeam , the usb gadget interface is actually a little complex to setup, so in my minimal images it’s not setup…

This is package that sets it up in Bullseye:

sudo apt update ; sudo apt install bb-usb-gadgets

The Systemd, service file: repos/bb-usb-gadgets.bb-usb-gadgets.service at master · rcn-ee/repos · GitHub

the main start script: repos/bb-start-usb-gadgets at master · rcn-ee/repos · GitHub

The current default…

Regards,

1 Like

OK thanks. I’m fumbling around a bit. Where should the ,system file go? Thanks, Alan Thomason

Install it:

sudo apt update
sudo apt install install bb-usb-gadgets

Then enable it:

sudo systemctl enable bb-usb-gadgets.service

Regards,

1 Like

Hi Robert…

Thanks for that…unfortunately, I’m still not seeing comms on 192.168.7.2 or 198.168.6.2

debian@arm:~$ sudo systemctl status bb-usb-gadgets.service
[sudo] password for debian:
● bb-usb-gadgets.service - BeagleBoard.org USB gadgets
     Loaded: loaded (/lib/systemd/system/bb-usb-gadgets.service; enabled; vendor preset: enabled)
     Active: inactive (dead)
debian@arm:~$ hostname -I
192.168.1.24

I’ve tried this with both Ubuntu and Windows connected. Am I supposed to do something with network setup?

Thanks very much,

Alan

Hi Robert…thanks so much for all of this help, I think I’m on the way now (unless you see something below that is incorrect). So here is what I’ve done and can now see the Beaglebone on a Linux machine connected via USB.

  1. Install bb-usb-gadgets (from your instructions last time)

    sudo apt install bb-usb-gadgets
    sudo systemctl enable bb-usb-gadgets.service

  2. Install Robert Nelsons scripts (staring in /opt):
    sudo git clone GitHub - RobertCNelson/boot-scripts: Just a bunch of useful scripts placed under /opt/scripts/ scripts

  3. modify /etc/network/interfaces file, adding these lines to the end…

    Ethernet/RNDIS gadget (g_ether)

    Used by: /opt/scripts/boot/autoconfigure_usb0.sh

    iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.252
    network 192.168.7.0
    gateway 192.168.7.1

  4. Install dnsmasq

    sudo apt install dnsmasq

  5. Reboot

  6. Run

    /opt/scripts/boot/autoconfigure_usb0.sh

I need to make the last line happen automatically, but I can figure that out…thanks again. Alan

This is Bullseye right image right? As it provides a newer version of systemd that triggers everything (usb-gadget target)… Side note, it also relies on systemd-networkd to handle usb0 configuration and dhcp leasing…

Regards,

Hi Robert…

To answer your question about version…

debian@arm:/opt/scripts/tools$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

I’m not sure about the systemd question, it sounds like I need to do some more research…

Thanks,
Alan

Sorry @Sunbeam was traveling… THis is all you need to do in a fresh install…

sudo apt update
sudo apt install bb-usb-gadgets
sudo systemctl enable bb-usb-gadgets.service
sudo systemctl enable systemd-networkd.service
sudo reboot
debian@arm:~$ journalctl | grep bb-start-usb-gadgets
Mar 31 16:02:23 arm bb-start-usb-gadgets[240]: bb-usb-gadgets: bb-start-acm-ncm-rndis-old-gadget
Mar 31 16:02:23 arm bb-start-usb-gadgets[243]: usb_gadget: Looking for libcomposite
Mar 31 16:02:23 arm bb-start-usb-gadgets[243]: usb_gadget: Creating g_multi
Mar 31 16:02:25 arm bb-start-usb-gadgets[243]: usb_gadget: enable USB mass_storage beaglebone-getting-started-2022-01-12.img
Mar 31 16:02:26 arm bb-start-usb-gadgets[243]: usb_gadget: g_multi Created
Mar 31 16:04:12 arm bb-start-usb-gadgets[241]: bb-usb-gadgets: bb-start-acm-ncm-rndis-old-gadget
Mar 31 16:04:12 arm bb-start-usb-gadgets[243]: usb_gadget: Looking for libcomposite
Mar 31 16:04:12 arm bb-start-usb-gadgets[243]: usb_gadget: Creating g_multi
Mar 31 16:04:14 arm bb-start-usb-gadgets[243]: usb_gadget: enable USB mass_storage beaglebone-getting-started-2022-01-12.img
Mar 31 16:04:15 arm bb-start-usb-gadgets[243]: usb_gadget: g_multi Created
debian@arm:~$ sudo ifconfig -a usb0
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.7.2  netmask 255.255.255.0  broadcast 192.168.7.255
        inet6 fe80::7c51:78ff:fe0b:734b  prefixlen 64  scopeid 0x20<link>
        ether 7e:51:78:0b:73:4b  txqueuelen 1000  (Ethernet)
        RX packets 377  bytes 78581 (76.7 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 36  bytes 6483 (6.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 

Regards