USB over ethernet not working after switch to Ubuntu

3264 views
Skip to first unread message

Ed

unread,
Aug 6, 2010, 10:43:37 PM8/6/10
to Beagle Board
Hi,

I'm switching to Ubuntu from Angstrom because I had some problems with
alsa, so I would like to try Ubuntu because I heard good things about
it. Under Angstrom, I could log into the beagleboard over ethernet via
usb, I believe using the g_ether module. I set this up according to
the beagleboard instructions for beginners. The only annoying thing
about this was that with each reboot of the beagleboard, the USB over
ethernet connection would show up as a new device in OS X on my
MacBook Pro. Probably this was happening because the hardware
addresses were initialized randomly every time. But it was still
usable--I just had to set everything up again in OS X every time I
rebooted the beagleboard.

NOW that I am using Ubuntu, the g_ether module seems to load
everytime, and here is the evidence:
ubuntu@beagleboard:~$ dmesg | grep ether
[ 969.867492] g_ether gadget: using random self ethernet address
[ 969.873443] g_ether gadget: using random host ethernet address
[ 969.888031] g_ether gadget: Ethernet Gadget, version: Memorial Day
2008
[ 969.894744] g_ether gadget: g_ether ready
[ 971.332458] g_ether gadget: high speed config #1: CDC Ethernet
(EEM)
But something is still not initialized properly, for instance
ubuntu@beagleboard:~$ cat /sys/module/g_ether/parameters/dev_addr
<NULL>
which implies to me that dev_addr is not being set upon booting
Ubuntu.

Can you suggest some way to get this working? Until OS X detects the
USB over ethernet device, I cannot use the link, pinging fails, etc.
Should I try using cdc_ether instead of g_ether? (It's included in the
release, but it seems that I shouldn't try to load cdc_ether if
g_ether is already loaded in the kernel.)

Thanks so much. I am really looking forward to getting this working.
We are planning to use it for teaching purposes.
Ed


Here is some more info on my setup:
ubuntu@beagleboard:~$ sudo /sbin/ifup usb0
[sudo] password for ubuntu:
SIOCADDRT: Network is unreachable
Failed to bring up usb0.


ubuntu@beagleboard:~$ cat /etc/network/interfaces
aauto lo
iface lo inet loopback

auto usb0
iface usb0 inet static
#pre-up modprobe g_ether
address 192.168.0.202
netmask 255.255.255.0
dev_addr 00:01:02:03:04:05
host_addr 06:07:08:09:0a:0b
network 192.168.0.1
gateway 192.168.1.1
#post-down rmmod g_ether

It seems to be ignoring the specifications for dev_addr and host_addr.
I just guessed that I could add them here. I also tried adding them as
bootargs using optargs g_ether.dev_addr=00:01:02:03:04:05 and
g_ether.host_addr=06:07:08:09:0a:0b, but that didn't work either!

Robert Nelson

unread,
Aug 7, 2010, 9:53:27 AM8/7/10
to beagl...@googlegroups.com

Hi Ed,

Your missing one important detail..

it can be answered with what "uname -a" returns..

Regards,

--
Robert Nelson
http://www.rcn-ee.com/

Richard Andrews

unread,
Aug 8, 2010, 7:22:28 AM8/8/10
to beagl...@googlegroups.com
On Sat, Aug 7, 2010 at 12:43 PM, Ed <eber...@ccrma.stanford.edu> wrote:
> ubuntu@beagleboard:~$ cat /etc/network/interfaces
> aauto lo
> iface lo inet loopback
>
> auto usb0
> iface usb0 inet static
>        #pre-up modprobe g_ether
>        address 192.168.0.202
>        netmask 255.255.255.0
>        dev_addr 00:01:02:03:04:05
>        host_addr 06:07:08:09:0a:0b
>        network 192.168.0.1
>        gateway 192.168.1.1
>        #post-down rmmod g_ether

I think (man 5 interfaces) you have the ethernet adress syntax wrong.
You're using IPv4 addresses. I think you need

hwaddress ether 00:01:02:03:04:05

Do you really have two As in aauto for lo?

But you have an earlier problem. "Link not ready" messages indicate
that the USB portion has not started properly. This is not because of
any ethernet address as the setup has not reached the point where that
is relevant. Some kernels have a problem that they only start usb0
properly if the USB OTG cable is connected to the host after booting
has completed (monitor via serial). The Angstrom 2010.7 kernel
(angstrom demo image) seems stable provided the gadget configuration
is setup to load g_ether (ie. "networking") instead of composite.

Check if you have an old U-Boot version. I seem to remember hearing
that this can have an effect on USB behaviour.

I would discourage you from using g_composite. I have found it to be
unstable compared to g_ether.

Richard Andrews

unread,
Aug 8, 2010, 7:26:54 AM8/8/10
to beagl...@googlegroups.com
On Sun, Aug 8, 2010 at 9:22 PM, Richard Andrews <bflat...@gmail.com> wrote:
> But you have an earlier problem. "Link not ready" messages indicate
> that the USB portion has not started properly. This is not because of
> any ethernet address as the setup has not reached the point where that
> is relevant. Some kernels have a problem that they only start usb0
> properly if the USB OTG cable is connected to the host after booting
> has completed (monitor via serial). The Angstrom 2010.7 kernel
> (angstrom demo image) seems stable provided the gadget configuration
> is setup to load g_ether (ie. "networking") instead of composite.
>
> Check if you have an old U-Boot version. I seem to remember hearing
> that this can have an effect on USB behaviour.
>
> I would discourage you from using g_composite. I have found it to be
> unstable compared to g_ether.

Sorry. This advice is for Angstrom. For Ubuntu I expect most of the
points to remain relevant.

Ed

unread,
Aug 13, 2010, 12:25:39 PM8/13/10
to Beagle Board
On Aug 8, 4:22 am, Richard Andrews <bflatmaj...@gmail.com> wrote:
> > I think (man 5 interfaces) you have the ethernet adress syntax wrong.
> You're using IPv4 addresses. I think you need
>
> hwaddress ether 00:01:02:03:04:05
Thanks for pointing that out!

> Do you really have two As in aauto for lo?
No.

> But you have an earlier problem. "Link not ready" messages indicate
> that the USB portion has not started properly. This is not because of
> any ethernet address as the setup has not reached the point where that
> is relevant. Some kernels have a problem that they only start usb0
> properly if the USB OTG cable is connected to the host after booting
> has completed (monitor via serial).
I tried this, and it didn't seem to make a difference. The host laptop
is still not detecting an ethernet connection when I plug in the USB
cable (or if I leave the USB OTG cable plugged in while rebooting the
beagleboard).


The Angstrom 2010.7 kernel
> (angstrom demo image) seems stable provided the gadget configuration
> is setup to load g_ether (ie. "networking") instead of composite.
Yes, I had everything working fine in Angstrom, but I am having some
problems with the ALSA drivers in Angstrom. I heard the situation
would be better in ubuntu, so that's why I am trying to use ubuntu.

> Check if you have an old U-Boot version. I seem to remember hearing
> that this can have an effect on USB behaviour.
I think that my uboot is U-Boot 2010.03-rc1, the Xloader is 1.4.4ss
(Apr 13 2010 - 21:22:56). I have a c4 beagleboard.

> I would discourage you from using g_composite. I have found it to be
> unstable compared to g_ether.
I get messages regarding both g_ether and cdc_ether upon startup. When
I previously used Angstrom, both kinds of devices would be detected on
the host laptop, but now with Ubuntu, neither is detected by the host
laptop.

Here is something else weird. If *directly* after setting /etc/network/
interfaces to
auto usb0
iface usb0 inet static
address 192.168.0.202
netmask 255.255.255.0
network 192.168.0.1
gateway 192.168.1.1

I type sudo ifup usb0, then I get
SIOCADDRT: No such process
Failed to bring up usb0.

Then if I reboot, the machine hangs at the following place right
before login, until I change /etc/network/interfaces back to the
default.
[ 3.154663] EXT3-fs (mmcblk0p2):
[ 3.158172] kjournald starting. Commit interval 5 seconds
[ 3.168914] mounted filesystem with writeback data mode
Begin: Running /scripts/local-bottom ...
Done.
Done.
Begin: Running /scripts/init-bottom ...
Done.
init: ureadahead main process (158) terminated with status 5
fsck from util-linux-ng 2.17.2
rootfs: clean, 15909/238080 files, 120626/951851 blocks
init: ureadahead-other main process (351) terminated with status 4


Another thing I'm a bit confused about. It seems that I should be
using the device usb0, but the references in the Beagleboard Ubuntu
are to eth0. So if I change the references in /etc/network/interfaces
from usb0 to eth0 and then I type
ubuntu@beagleboard:/etc/network$ sudo ifup eth0
I get that
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
eth0: ERROR while getting interface flags: No such device
Failed to bring up eth0.

Can someone please confirm that I should be using usb0?

Thanks so much for all of your help so far,
Ed

Robert Nelson

unread,
Aug 13, 2010, 12:58:44 PM8/13/10
to beagl...@googlegroups.com

usb0 is for usb-otg emulation devices, such as connecting your beagle
directly to a pc over the otg port...

*and the lan95xx on the XM also comes up as usb0 or usb1 depending if
you have ^ enabled.. ;)

eth0 would normally come from usb-ethernet adapters such as
asix/moschip usb2.0 based 10/100 ethernet devices.

Ed

unread,
Aug 13, 2010, 12:34:50 PM8/13/10
to Beagle Board, robert...@gmail.com
Thanks for the tip! Here it is with the update you recommended.

ubuntu@beagleboard:/etc/network$ uname -a
Linux beagleboard 2.6.34.3-l2 #1 PREEMPT Wed Aug 11 09:16:57 UTC 2010
armv7l GNU/Li
nux

- Ed


Richard Andrews

unread,
Aug 16, 2010, 6:16:43 AM8/16/10
to beagl...@googlegroups.com
On Sat, Aug 14, 2010 at 2:25 AM, Ed <eber...@ccrma.stanford.edu> wrote:
> The Angstrom 2010.7 kernel
>> (angstrom demo image) seems stable provided the gadget configuration
>> is setup to load g_ether (ie. "networking") instead of composite.
> Yes, I had everything working fine in Angstrom, but I am having some
> problems with the ALSA drivers in Angstrom. I heard the situation
> would be better in ubuntu, so that's why I am trying to use ubuntu.

ALSA works OK for me in Angstrom. What facilities do you need. I you
analog IN and OUT (ie. AUX) jacks.

> Another thing I'm a bit confused about. It seems that I should be
> using the device usb0, but the references in the Beagleboard Ubuntu
> are to eth0. So if I change the references in /etc/network/interfaces
> from usb0 to eth0 and then I type
> ubuntu@beagleboard:/etc/network$ sudo ifup eth0
> I get that
> SIOCSIFADDR: No such device
> eth0: ERROR while getting interface flags: No such device
> SIOCSIFNETMASK: No such device
> eth0: ERROR while getting interface flags: No such device
> Failed to bring up eth0.

I think eth0 is only via an expansion module.

> Can someone please confirm that I should be using usb0?

usb0 is the interface name that I get for CDC ethernet over gadget
USB. This applies to by Angstrom beagleboard and my Ubunut Lucid host.

Regardless of what name is used in the interfaces file, if the device
is initialised by the kernel it will be visible via:
# ifconfig -a

Richard Andrews

unread,
Aug 16, 2010, 6:17:23 AM8/16/10
to beagl...@googlegroups.com
On Mon, Aug 16, 2010 at 8:16 PM, Richard Andrews <bflat...@gmail.com> wrote:
> ALSA works OK for me in Angstrom. What facilities do you need. I you
> analog IN and OUT (ie. AUX) jacks.

s/you/use/

Koen Kooi

unread,
Aug 16, 2010, 6:22:04 AM8/16/10
to beagl...@googlegroups.com

Note that the builtin ethernet on the xM shows up as 'usb0' and cdc as 'usb1'. People can use ifrename if it's too confusing :)

regards,

Koen

Richard Andrews

unread,
Aug 16, 2010, 6:31:50 AM8/16/10
to beagl...@googlegroups.com
On Mon, Aug 16, 2010 at 8:22 PM, Koen Kooi <ko...@beagleboard.org> wrote:
> Note that the builtin ethernet on the xM shows up as 'usb0' and cdc as 'usb1'. People can use ifrename if it's too confusing :)

Duly noted.
When should we expect to see queries relating to xM boards?

Koen Kooi

unread,
Aug 16, 2010, 7:18:12 AM8/16/10
to beagl...@googlegroups.com

Approx 5 seconds after the fix xM gets unboxed by a user :) I don't know when the first boards will get shipped, though.

regards,

Koen

Ed

unread,
Aug 15, 2010, 11:49:42 PM8/15/10
to Beagle Board, robert...@gmail.com
Hi everyone,

Thanks for all the help! While in Angstrom it was easy enough to
simply open an ethernet connection over a USB cable connected to a
laptop, we eventually found it much easier to buy a piece of hardware
so that we could simply plug into the ethernet of a laptop when using
Ubuntu on the Beagleboard. Here is the hardware we used, the USB300m
from linksys support: http://homesupport.cisco.com/en-us/wireless/lbc/USB300M

Perhaps in the future we will try to eliminate this piece of hardware
and just use a USB cable as in Angstrom, but for the time being we are
just trying to get our complete system working, so we will come back
to this later. Note for other newbies: we just plugged this directly
into the USB host connector on the board (and not the USB OTG).

Best,
Ed

SteveD

unread,
Aug 16, 2010, 8:08:39 AM8/16/10
to Beagle Board
On Aug 7, 4:43 am, Ed <eberd...@ccrma.stanford.edu> wrote:
> Thanks so much. I am really looking forward to getting this working.

I'm in the same boat, slightly older kernel:

Linux beagleboard 2.6.32.11-l13 #1 PREEMPT Tue Apr 13 04:25:20 UTC
2010 armv7l

It is .. embarrassing to have to use the ethernet gadget with Windows,
although even that's become flaky!

Otherwise things are running well, except for the inevitable USB
problems ;)

steve d.
Reply all
Reply to author
Forward
0 new messages