Beaglebone eth0 won't connect without toggling on boot

This forum is for supported devices using an ARMv7 Texas Instruments (TI) SoC.

Beaglebone eth0 won't connect without toggling on boot

Postby johonaton » Tue Feb 05, 2013 3:05 pm

I've been having a bit of a strange issue with the onboard ethernet on multiple Beaglebones after a recent update.

First off, I'm sure this isn't the earlier pullup-resistor ethernet issue. I have multiple boards ranging from A3 to A6, and the problem happens across all of them with this image after the update.

I'm trying to start a static IP configuration on boot without having to intervene on the command line...that part is key, as the end use will hopefully not require access to a serial console except for debugging. Right now I have my linux box acting as a local gateway for updates and testing.

Enabling the net-auto-wired service appears to bring up eth0 and set its IP, but attempts to ping between the laptop and beaglebone fail with "Destination Host Unreachable" from both ends. Ifplugd and netcfg by themselves don't really do any better.

On wireshark I can see ARP requests from both ends, and replies from my laptop if the beaglebone is doing the ping, but on the beaglebone I can't see anything incoming. All I can ping is myself.

Completely disabling all on-boot networking services results in the same issue if I try to bring the interface up and configure it manually....that is, until I reset the interface.

Output from uname-a:
Linux TIPR 3.2.32-4-ARCH #1 PREEMPT Mon Nov 5 03:18:39 UTC 2012 armv7l GNU/Linux

And now for the weirdness when I do this manually.
From a fresh boot, with all of the network services disabled, I can bring up eth0 and configure it:
$this->bbcode_second_pass_code('', '
[root@alarm ~]# ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@alarm ~]# ip link set dev eth0 up
[root@alarm ~]# ip addr add 192.168.99.100/24 broadcast 192.168.99.255 dev eth0
[root@alarm ~]# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.99.100 netmask 255.255.255.0 broadcast 192.168.99.255
inet6 fe80::d694:a1ff:fe93:1b14 prefixlen 64 scopeid 0x20<link>
ether d4:94:a1:93:1b:14 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@alarm ~]# ping 192.168.99.1
PING 192.168.99.1 (192.168.99.1) 56(84) bytes of data.
From 192.168.99.100 icmp_seq=1 Destination Host Unreachable
From 192.168.99.100 icmp_seq=2 Destination Host Unreachable
From 192.168.99.100 icmp_seq=3 Destination Host Unreachable
... etc ...
')

If I bring the interface down and then back up, it works.

$this->bbcode_second_pass_code('', '
[root@alarm ~]# ip link set dev eth0 down
[root@alarm ~]# ip link set dev eth0 up
PING 192.168.99.1 (192.168.99.1) 56(84) bytes of data.
64 bytes from 192.168.99.1: icmp_seq=1 ttl=64 time=0.794 ms
64 bytes from 192.168.99.1: icmp_seq=2 ttl=64 time=0.519 ms
64 bytes from 192.168.99.1: icmp_seq=3 ttl=64 time=0.519 ms
... etc ...
[root@alarm ~]# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.99.100 netmask 255.255.255.0 broadcast 192.168.99.255
inet6 fe80::d694:a1ff:fe93:1b14 prefixlen 64 scopeid 0x20<link>
ether d4:94:a1:93:1b:14 txqueuelen 1000 (Ethernet)
RX packets 10 bytes 944 (944.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 34 bytes 2560 (2.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
')

dmesg doesn't give me any differing information between the first time bringing up the interface and the second...though note that the 10/Half speed is due to the hub I had between my laptop and the beaglebone during this particular test. I was able to get a full 100 without it.

$this->bbcode_second_pass_code('', '[ 55.825805] CPSW phy found : id is : 0x7c0f1
[ 55.826568] PHY 0:01 not found
[ 55.827667] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 59.823852] PHY: 0:00 - Link is Up - 10/Half
[ 59.824066] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 70.463226] eth0: no IPv6 routers present
[ 295.070678]
[ 295.070678] CPSW phy found : id is : 0x7c0f1
[ 295.071441] PHY 0:01 not found
[ 295.072296] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 297.063964] PHY: 0:00 - Link is Up - 10/Half
[ 297.064147] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 307.323242] eth0: no IPv6 routers present
')

While adding the toggle fix to the startup scripts does appear to work, knowing why this might be happening (and if there is an actual fix for it) would be very helpful.
johonaton
 
Posts: 8
Joined: Tue Feb 05, 2013 1:21 am

Re: Beaglebone eth0 won't connect without toggling on boot

Postby pepedog » Tue Feb 05, 2013 3:30 pm

I don't have a beaglebone
There is a bug where systemd starts networking scripts before module detected and loaded
Assuming its smsc95xx and a module
$this->bbcode_second_pass_code('', 'echo "smsc95xx" > /etc/modules-load.d/smsc95xx.conf')
Reboot to try
If that fails I have another trick
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Beaglebone eth0 won't connect without toggling on boot

Postby johonaton » Tue Feb 05, 2013 3:38 pm

Thank's for the quick response!

Tried your suggestion, didn't change anything. Now that I think about it, I don't believe the beaglebone uses the same ethernet hardware as the beagleboard.
johonaton
 
Posts: 8
Joined: Tue Feb 05, 2013 1:21 am

Re: Beaglebone eth0 won't connect without toggling on boot

Postby pepedog » Tue Feb 05, 2013 7:28 pm

What driver does the Ethernet use, is it builtin, and did you try that?
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Beaglebone eth0 won't connect without toggling on boot

Postby johonaton » Tue Feb 05, 2013 11:50 pm

The onboard ethernet is an SMSC LAN8710A on an MII interface...

modulels.builtin lists smsc.ko, and the drivers/net/Kconfig lists SMSC_PHY as supporting LAN8700 chips. I admittedly have only just begun to delve much into the linux kernel, so I may be missing something blaringly obvious here.

lsmod output
$this->bbcode_second_pass_code('', '
[root@alarm ~]# lsmod
Module Size Used by
snd_soc_tlv320aic3x 32586 0
spidev 4892 0
autofs4 23132 2
')

Also...I just tried this on another network, this time with dhcp...results were different. The first time, it worked, but ping times were around 1 second...on reboot it worked flawlessly on the first go. Thought it might be that netcfg or dhcpcd is doing something different here, I'm thinking the network configuration itself might not be helping.
johonaton
 
Posts: 8
Joined: Tue Feb 05, 2013 1:21 am

Re: Beaglebone eth0 won't connect without toggling on boot

Postby xenoxaos » Wed Feb 06, 2013 4:33 am

So, you're NOT the only person experiencing this. I just got a BeagleBone today, wrote a new SD....no ethernet. Bring eth0 up/down/up....works fine.

We're looking into it.
Arch Linux ARM exists and continues to grow through community support, please donate today!
xenoxaos
Developer
 
Posts: 323
Joined: Thu Jan 06, 2011 1:45 am

Re: Beaglebone eth0 won't connect without toggling on boot

Postby pepedog » Wed Feb 06, 2013 10:34 am

My last suggestion, based upon it can come up and it's a matter of timing
$this->bbcode_second_pass_code('', 'cp /etc/network.d/examples/ethernet-dhcp /etc/network.d/
#edit /etc/network.d/ethernet-dhcp to have the line
PRE_UP="sleep 10"

#edit /etc/conf.d/netcfg with this line
NETWORKS=(ethernet-dhcp)')
Make sure netcfg is only network service

If this fails you could always add a POST_UP= line to /etc/network.d/ethernet-dhcp to do up/down
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Beaglebone eth0 won't connect without toggling on boot

Postby xenoxaos » Wed Feb 06, 2013 12:07 pm

pepedog,
I've actually disable netcfg.service and brought the device up, let it sit for a while, even unplugged and plugged the eth cable.... on the first ifconfig up && dhcpcd, still times out. On the second ifdown/up...works fine.
Arch Linux ARM exists and continues to grow through community support, please donate today!
xenoxaos
Developer
 
Posts: 323
Joined: Thu Jan 06, 2011 1:45 am

Re: Beaglebone eth0 won't connect without toggling on boot

Postby johonaton » Wed Feb 06, 2013 1:16 pm

The DHCP profile seemed to work on my home network (not the testing one I'm actually gearing this towards). That profile seemed somewhat more reliable, but in my case I'm trying to not use DHCP since it will be in a network that doesn't have DHCP...

That and I don't know what netcfg or dhcpcd are doing in terms of retry attempts. It could just be masking the same issue.

The testing network didn't have a router, it was just a laptop or two connected to this beaglebone through a switch, with static IPs. Initially I was trying to use ifplugd and/or netcfg to autoconfigure this...which made troubleshooting my network connectivity a nondeterministic mess.

Ignoring all of that and just having a raw network.service script bring the interface up has simplified the problem down to needing the toggle on boot.

For now it's a workaround I can live with, but I'll have to leave the board running for a while to be sure there are not secondary stability issues, like connectivity dropping out.
johonaton
 
Posts: 8
Joined: Tue Feb 05, 2013 1:21 am

Re: Beaglebone eth0 won't connect without toggling on boot

Postby pepedog » Wed Feb 06, 2013 1:25 pm

I am wondering if the port is automatic, ie where you can connect without crossover cable to other pc or hub/switch, this affects.
Looks like I'm banging on about netcfg, but you could have a PRE_UP of up/down/spinaround
Does disable ipv6 help?
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Next

Return to Texas Instruments (TI)

Who is online

Users browsing this forum: No registered users and 5 guests