Solved About USB-Ethernet in BeagleBone Black

Scenario: I have a 1 BeagleBone black and a laptop, the laptop runs FreeBSD-11.1

1] If I run the BBB with Linux Debian, when I plug the BBB usb to the laptop, in the laptop I see a nice ue interface that I can easily configure as a network adapter and comunicate with the BBB over usb. It works very well.

2] Problem. If I run the BBB with FreeBSD-11.1 it doest not make the Usb-Ethernet by default. I mean, in the laptop, that nice ue interface does not appear any more. Good, better this way, I prefert to enable services myself. But, how can I enable it ? Is it possible with BBB hardware and FreeBSD-11.1 ? I tried to read these man pages but I cant sort it out. [ cdce, if_rue, if_cue, if_kue, if_urndis ]

I suspect the BBB usb hardware is not supported, or I can't find the appropriate driver to load; but maybe i am wrong.
 
I treid kldload g_modem_driver on the BBB
but after that I am stuck. I don't see any device popping up in /dev,
and no messages. Nor I see the "ue" interfaces appearing on my laptop,
connected to the BBB via usb.

From the source I can't understand much, i can recognized the "sysctl toggles",
indeed sysctl -a | grep modem has something.

Probably, if it works, it must be programmed in C.

If somebody has knowledge on the subject and can provide an example
it would be appreciated.
 
Hi Phishfry !

At present, with FreeBSD-11.1 on both the BBB and the connected laptop.
By default, without any toggling at all, when I boot the BBB i see this in
my laptop "/var/log/messages"

Code:
Apr 18 12:16:12 fbs kernel: ugen1.3: <FreeBSD foundation USB Memory Stick> at usbus1
Apr 18 12:16:12 fbs kernel: umass0 on uhub1
Apr 18 12:16:12 fbs kernel: umass0: <USB Mass Storage Interface> on usbus1
Apr 18 12:16:12 fbs kernel: umass0:  SCSI over Bulk-Only; quirks = 0x0100
Apr 18 12:16:12 fbs kernel: umass0:3:0: Attached to scbus3
Apr 18 12:16:12 fbs kernel: da1 at umass-sim0 bus 0 scbus3 target 0 lun 0
Apr 18 12:16:12 fbs kernel: da1: <FreeBSD File-Stor Gadget 0101> Removable Direct Access SCSI-2 device
Apr 18 12:16:12 fbs kernel: da1: 40.000MB/s transfers
Apr 18 12:16:12 fbs kernel: da1: 4MB (8192 512 byte sectors)
Apr 18 12:16:12 fbs kernel: da1: quirks=0x2<NO_6_BYTE>

So, it seems OTG / Gadget is working out of the box, but exporting the BBB as a disk.

I would like to know if it is possible to have "Ethernet over Usb" instead of the disk.

I saw (quite fast) the usb_modeswitch man page, do you think that is the way ?
I have no idea, I can't understand well from the man itself.

I found also other (I guess) relevant man pages as: netgraph, socat, ubdp and ng_iface, but still, nothing pointing straight to the objective.
 
do you think that is the way ?
I was really just grasping at straws there.
usb_modeswitch is primarly used for USB cellular modems.

But it does do the task of switching USB endpoints(among other functions)

I really don't know. I do know that USB devices can have several 'endpoints'. Your ethernet is probably an endpoint as is mass storage.

When you dig deep with usbconfig dump device desc what does the value bnumconfig show?
Maybe devd could be used here?
 
When you dig deep with usbconfig dump device desc what does the value bnumconfig show?
Maybe devd could be used here?

Doh, my knowledge of USB is superficial, but I can give you some of the output I see.

Configuration.
-] My main system is FreeBSD-11.1 (running inside VMWare)
I connect to it, in order
1] a BB-Black running FreeBSD-11.1
2] a BB-Green running Debian

Code:
#> usbconfig list
....
ugen1.3: <FreeBSD foundation USB Memory Stick> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (50mA)
ugen1.4: <Seeed BeagleBoneGreen> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

Code:
#> dmesg 
.....
ugen1.3: <FreeBSD foundation USB Memory Stick> at usbus1
umass0 on uhub0
umass0: <USB Mass Storage Interface> on usbus1
umass0:  SCSI over Bulk-Only; quirks = 0x0100
umass0:3:0: Attached to scbus3
da1 at umass-sim0 bus 0 scbus3 target 0 lun 0
da1: <FreeBSD File-Stor Gadget 0101> Removable Direct Access SCSI-2 device
da1: 40.000MB/s transfers
da1: 4MB (8192 512 byte sectors)
da1: quirks=0x2<NO_6_BYTE>
ugen1.4: <Seeed BeagleBoneGreen> at usbus1
umass1 on uhub0
umass1: <Mass Storage> on usbus1
umass1:  SCSI over Bulk-Only; quirks = 0x0000
umass1:4:1: Attached to scbus4
da2 at umass-sim1 bus 1 scbus4 target 0 lun 0
da2: <Linux File-Stor Gadget 0404> Removable Direct Access SCSI-2 device
da2: 40.000MB/s transfers
da2: 18MB (36864 512 byte sectors)
da2: quirks=0x2<NO_6_BYTE>
urndis0 on uhub0
urndis0: <RNDIS Communications Control> on usbus1
ue0: <USB Ethernet> on urndis0
ue0: Ethernet address: c8:fd:19:c7:f1:06
cdce0 on uhub0
cdce0: <CDC Ethernet Control Model ECM> on usbus1
ue1: <USB Ethernet> on cdce0
ue1: Ethernet address: c8:fd:19:c7:f1:09
umodem0 on uhub0
umodem0: <CDC Abstract Control Model ACM> on usbus1
umodem0: data interface 5, has no CM over data, has no break

From the above output I guess that FreeBSD-11.1 is ready to accept cdc, urdnis [which i want] but
the Linux BB is offering these services, the FreeBSD BB not.

Reconsidering what aragats said before, if i remeber correctly, in Linux there was a module
g_ether, we don't have that in FreeBSD AFACsay.
 
I have some good news !

I just tested 26-April image on my BBGreen and I can see an "ue0" interface
popping up in my laptiop "dmesg", YEAH !

Only problem is, in that image serial is not working;)

Bye
 
Solved !
Luckily I found a relevant chapter in the FreeBSD Handbook, here .
God bless the documentation team !

The shortcut solution is simply to put in the BBB /boot/loader.conf
Code:
if_cdce_load="YES"
hw.usb.template=1

Supposing the BBB is powered via USB by a "main" computer running FreeBSD,
after rebooting the BBB and you will have two "ue" devices popping up, one in the BBB
and one in the "main". Those can be configured as usual ethernet devices with ifconfig.

I did the experiment with a "main" computer running FreeBSD 11.1.
and a BeagleBone Black running FreeBSD 11.1 and FreeBSD 12.0.
Ping working in all cases.

EXTRA. I abandoned BB-Green, that was crating confusion, I focus on BB-Black Rev C.
 
Back
Top