Home Forums Software discussion OS – Yocto problem with network interfaces

This topic contains 7 replies, has 4 voices, and was last updated by  EmiAndrei 1 month, 3 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1434

    clem_ent
    Participant

    Hi,

    My Problem is quite simple I hope.

    I compiled the Yocto image “marvell-image-machine-test” and flashed it on my espresso. I plugged it to my ethernet switch and i cannot get any address from my dhcp server to validate network connectivity on the board.
    I tried to set up a static ip to eth0 and test a point to point connection with my laptop. Again, no communication.

    Is there a configuration trick that i am missing ?

    Regards

    #1452

    gourvy
    Participant

    Hi,

    I have the same problem. This seems might be a kernel related problem. Plugging/unplugging a cable doesn’t seem to be noticed by the kernel (nothing in dmesg). Maybe

    The only logs about the MV-88E6341 I have are the following:

    [ 5.454962] libphy: mv88e6xxx SMI: probed
    [ 5.458792] mdio_bus d0032004.mdio-mi: switch 0x341 probed: Marvell 88E6341, revision 0
    [ 5.467432] mvneta d0030000.ethernet eth0: [0]: detected a Marvell 88E6341 switch
    [ 5.616309] Generic PHY mv88e6xxx-0:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=mv88e6xxx-0:01, irq=-1)
    [ 5.700302] Generic PHY mv88e6xxx-0:02: attached PHY driver [Generic PHY] (mii_bus:phy_addr=mv88e6xxx-0:02, irq=-1)
    [ 5.776342] Generic PHY mv88e6xxx-0:03: attached PHY driver [Generic PHY] (mii_bus:phy_addr=mv88e6xxx-0:03, irq=-1)

    The “irq=-1” seems suspicious, but it may be normal.

    Strangely, I have some interfaces (eth0, wan0@eth0, lan0@eth0, lan1@eth0)

    Edit: I succeeded to have an ip manually on wan:
    # ip li set up eth0
    # ip li set up wan

    Then, I used some dhcp on wan and it worked.
    But, setting up eth0 triggered some messages from the kernel:

    [ 84.485771] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    [ 86.252156] mvneta d0030000.ethernet eth0: Link is Up – 1Gbps/Full – flow control off
    [ 86.260241] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

    [ 90.616631] dsa dsa@0 wan: Link is Down
    [ 92.629555] dsa dsa@0 wan: Link is Up – 1Gbps/Full – flow control rx/tx

    Finally, it’s maybe just a wrong settup from my side.

    #1453

    gourvy
    Participant

    Ok, it’s not a kernel problem at all, I just messed up my network configuration. I use systemd-networkd and after cleaning/updating files in /etc/systemd/network/ my setup works fine.

    #1459

    ezaluzec
    Participant

    Hey @clem_ent,
    I wanted to share the configuration trick that I used to establish a network connection with espressobin.

    First, the Marvell Yocto project is not based off Yocto’s poky distro, but from O.S. Software System’s distro named oel. You can see this under meta-marvell-distro/conf/distro/marvell.conf https://code.ossystems.com.br/gitweb?p=meta-ossystems-base.git;a=blob;f=conf/distro/include/oel.conf;h=a87da9b9cf2958b60f04df8ea96f39ba44f83d27;hb=refs/heads/krogoth

    I mentioned the distro, because it looks like the oel distro uses SysVInit as the start up service for their Linux images. My configuration trick is for Systemd, but the changes can be implemented to /etc/network/interfaces file for SysVInit.

    Under /etc/systemd/network, I added the following network files:

    root@espressobin:/etc/systemd/network# ls -al
    total 32
    drwxr-xr-x    2 root     root          4096 Jan 23 18:14 .
    drwxr-xr-x    5 root     root          4096 Jan  4 21:39 ..
    -rwxr-xr-x    1 root     root            30 Jan  4 21:50 10-br0.netdev
    -rwxr-xr-x    1 root     root            38 Jan  4 21:50 10-br0.network
    -rwxr-xr-x    1 root     root            40 Jan  4 21:50 10-eth0.network
    -rwxr-xr-x    1 root     root            40 Jan  4 21:50 10-lan0.network
    -rwxr-xr-x    1 root     root            40 Jan  4 21:50 10-lan1.network
    -rwxr-xr-x    1 root     root            40 Jan  4 21:50 10-wan.network
    
    10-br0.netdev
    	[NetDev]
    	Name=br0
    	Kind=bridge
    	
    10-br0.network
    	[Match]
    	Name=br0
    
    	[Network]
    	DHCP=ipv4
    
    10-eth0.network	
    	[Match]
    	Name=eth0
    
    	[Network]
    	DHCP=ipv4
    	
    10-lan0.network
    	[Match]
    	Name=lan0
    
    	[Network]
    	Bridge=br0
    
    10-lan1.network
    	[Match]
    	Name=lan1
    
    	[Network]
    	Bridge=br0
    
    10-wan.network
    	[Match]
    	Name=wan
    
    	[Network]
    	Bridge=br0

    Output:

    Poky (Yocto Project Reference Distro) 2.1.2 espressobin ttyMV0
    
    espressobin login: root
    root@espressobin:~# ifconfig
    br0       Link encap:Ethernet  HWaddr 12:51:A9:78:CB:23
              inet addr:10.207.15.91  Bcast:10.207.15.255  Mask:255.255.255.0
              inet6 addr: fe80::1051:a9ff:fe78:cb23%4820736/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:212 errors:0 dropped:4 overruns:0 frame:0
              TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:27150 (26.5 KiB)  TX bytes:2530 (2.4 KiB)
    
    eth0      Link encap:Ethernet  HWaddr 00:51:82:11:22:00
              inet6 addr: fe80::251:82ff:fe11:2200%4820736/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:213 errors:0 dropped:0 overruns:0 frame:0
              TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:532
              RX bytes:32002 (31.2 KiB)  TX bytes:6767 (6.6 KiB)
              Interrupt:105
    
    lan0      Link encap:Ethernet  HWaddr 00:51:82:11:22:00
              UP 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)
    
    lan1      Link encap:Ethernet  HWaddr 00:51:82:11:22:00
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
             [   33.226842] random: nonblocking pool is initialized
     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)
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1%4820736/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:172 errors:0 dropped:0 overruns:0 frame:0
              TX packets:172 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1
              RX bytes:13324 (13.0 KiB)  TX bytes:13324 (13.0 KiB)
    
    wan       Link encap:Ethernet  HWaddr 00:51:82:11:22:00
              inet6 addr: fe80::251:82ff:fe11:2200%4820736/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:213 errors:0 dropped:1 overruns:0 frame:0
              TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:27316 (26.6 KiB)  TX bytes:3651 (3.5 KiB)
    
    root@espressobin:~# ping 8.8.8.8
    PING 8.8.8.8 (8.8.8.8): 56 data bytes
    64 bytes from 8.8.8.8: seq=0 ttl=51 time=34.594 ms
    64 bytes from 8.8.8.8: seq=1 ttl=51 time=31.043 ms
    ^C
    --- 8.8.8.8 ping statistics ---
    2 packets transmitted, 2 packets received, 0% packet loss
    round-trip min/avg/max = 31.043/32.818/34.594 ms
    root@espressobin:~#

    Some links to espressobin wiki pages on network configs
    http://wiki.espressobin.net/tiki-index.php?page=Ubuntu+-+initial+network+configuration
    http://wiki.espressobin.net/tiki-index.php?page=OpenWrt+-+initial+network+configuration
    https://github.com/MarvellEmbeddedProcessors/linux-marvell/wiki/Linux-Porting-Guide#ethernet-configuration

    If you’d like to learn how to re-build your Marvell Yocto project with systemd, I can share these build configuration changes but then you may be outside the realm of marvell yocto support.

    Cheers.

    #1460

    clem_ent
    Participant

    Hi,

    Thanks for the tip.

    I managed to get network working by using a mainline device tree for the espressobin. Unfortunately, i can only see eth0 interface.

    I’ll try to deploy systemd on my yocto and use your trick !

    Just a question though : can your interfaces have a different IP address ?

    #1461

    ezaluzec
    Participant

    You can try to update your /etc/network/interfaces file with the following code snippet to enable the wan, lan0, lan1 interface ports. This way you won’t have to re-build for systemd.

    auto lo br0
    iface lo inet loopback
    
    allow-hotplug eth0
    iface eth0 inet manual
    
    allow-hotplug lan0
    iface lan0 inet manual
    
    allow-hotplug eth1
    iface lan1 inet manual
    
    iface br0 inet dhcp
    bridge_ports lan0 lan1 wan

    With my current systemd-networkd configuration, I am able to plug-in an Ethernet cable between the wan, lan0, & lan1 ports and my network connection is retained. When switching ports, I get the following output:

    root@espressobin:~# [  571.902010] dsa dsa@0 wan: Link is Down
    [  571.905604] br0: port 3(wan) entered disabled state
    [  579.018470] dsa dsa@0 lan0: Link is Up - 100Mbps/Full - flow control rx/tx
    [  579.025461] IPv6: ADDRCONF(NETDEV_CHANGE): lan0: link becomes ready
    [  579.039239] br0: port 2(lan0) entered blocking state
    [  579.044227] br0: port 2(lan0) entered forwarding state  

    Since my network ports are bridged with the bridge set to DHCP and all the network interface ports are on the same nic, the IP address is the same when switching between interfaces. I’m able to configure the bridge to a static IP address. There may be a way to set a different static address to the bridge depending on which network interface port is connected, but I am unfamiliar with how to correctly set-up that kind of network configuration. My first thought would be to look at defining a udev rule to handle this, but there may be a better option. Let me know if you are able to get a different ip address for each interface, I’d be interested to see how the network is configured.

    #1463

    clem_ent
    Participant

    Thank You it worked with systemd ! I am able to communicate between two networks.

    #9455

    EmiAndrei
    Participant

    Hello,

    I saw this post and have the same problem.
    I can’t connect the espressoBin board to the PC with an ethernet cable and can’t ping to a website.

    I follow the network config from this wiki page: http://wiki.espressobin.net/tiki-index.php?page=Ubuntu+-+initial+network+configuration
    and get this error when running:

    root@localhost:~# apt-get install bridge-utils
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    The following NEW packages will be installed:
    bridge-utils
    0 upgraded, 1 newly installed, 0 to remove and 106 not upgraded.
    Need to get 0 B/27.7 kB of archives.
    After this operation, 142 kB of additional disk space will be used.
    Selecting previously unselected package bridge-utils.
    dpkg: unrecoverable fatal error, aborting:
    files list file for package `iputils-ping’ contains empty filename
    E: Sub-process /usr/bin/dpkg returned an error code (2)

    So, I can’t set the iptables or brctl because I can not install them.

    Also, I follow the routing documentation from this page:http://wiki.espressobin.net/tiki-index.php?page=Buildroot+-+initial+network+configuration

    But, I can’t find the BR2_PACKAGE_DNSMASQ in the make menuconfig from kernel 4.4.8 to enable dnsmasq and copy it to sdcard.

    I followed the solutions from above but they didn’t work for me. If you managed to set up the correct PC-espressoBin connection, can you share the steps?

    Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Signup to our newsletter

Technical specification tables can not be displayed on mobile. Please view on desktop