[ solved ] Networking with UDHCPC

April 3rd, 2013

Home Forums GeeXboX for PC [ solved ] Networking with UDHCPC

This topic contains 20 replies, has 2 voices, and was last updated by  tomlohave 1 year, 3 months ago.

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #6189

    dave1981
    Member

    I had to start this thread since I couldn’t reply to http://www.geexbox.org/forum/topic/missing-library-pcmcia-ethernet-not-seen/page/3/ thread for some reason…

    Anyway, I’ve added the following to /usr/lib/udhcpc/net-udhcpc

    #!/bin/sh

    echo “starting net scrip” >> /tmp/net.txt

    . /etc/network

    … etc etc with more echo statements.

    However, the /tmp/net.txt file is never created, so I guess the script is never run. Who is supposed to be calling it? I have set /etc/network NETWORK_BACKEND=”udhcpc” already. I think I saw a synonym for that property somewhere (NET_B?) is it possible something got out of date and udhcpc is never activated?

    #6190

    dave1981
    Member

    Don’t know if this is important, but I can start the script with

    sh /usr/lib/udhcpc/net-udhcpc

    but not with

    ./usr/lib/udhcpc/net-udhcpc

    When I run it with sh the behavior is as expected and /tmp/net.txt is generated with all the right text.

    #6191

    tomlohave
    Moderator

    this file is started by /lib/systemd/system/udhcpc.service right after the execution of network-link.service

    content of udhcpc.service :

    [Unit]
    Description=Connection service (udhcpc)
    After=syslog.target network-link.service
    ConditionPathExists=/run/geexbox/network/udhcpc

    [Service]
    ExecStart=/usr/lib/udhcpc/net-udhcpc
    RemainAfterExit=yes

    [Install]
    WantedBy=network.target

    network-link service is part of network-backend package

    it contains :

    [Unit]
    Description=Network backend

    [Service]
    Type=oneshot
    EnvironmentFile=/etc/network
    ExecStartPre=/bin/mkdir -p /run/geexbox/network
    ExecStart=/bin/touch /run/geexbox/network/${NETWORK_BACKEND}
    RemainAfterExit=yes

    [Install]
    WantedBy=network.target

    so if NETWORK_BACKEND is correctly set in /etc/network, udhcpc.service should start (look at the condition to start it)

    do you have a file called udhcpc in   /run/geexbox/network/ ?

    if you reboot and try to start manually this service , executing :

    systemctl start udhcpc

    what returns the console ?

    #6193

    dave1981
    Member

    That’s interesting:

    my /run/geexbox/network/ dir is completely empty (ls -a)

    and so of course, “systemctl start udhcpc” doesn’t do anything (I Assume because that dir is empty). What should be in /run/geexbox/network/ then?

     

    #6195

    tomlohave
    Moderator

    I’ ve downloaded  a fresh iso, ,

    changing udhcpc on /etc/network , stopping connman , restarting network-link and udhcpc services, it works

    can you double check /etc/network ?

    no typo in it ?

    #6197

    dave1981
    Member

    Doesn’t this line “ConditionPathExists=/run/geexbox/network/udhcpc” mean that udhcpc.service is not started if that path does not exist? As I mentioned above  /run/geexbox/network/ is empty so there is no udhcpc file in there.

     

    Also, “ExecStart=/bin/touch /run/geexbox/network/${NETWORK_BACKEND which becomes “…../udhcpc” does not exist on my machine. When I run “systemctl start udhcpc” nothing happens at all.

     

    I’m pasting the contents of my files but I’m pretty sure everything is ok:

     

    /etc/network

    # Network configuration

    # Backend software to use for network management (e.g. “connman”)

    NETWORK_BACKEND=”udhcpc”

    # “LAN” or “WLAN” or “” (default is “” <–> “LAN”)

    NETWORK=”WLAN”

    # Network interface name or address (e.g. “eth0″ or “00:0d:56:ec:ba:0c”)

    IFACE=”wlan0″

    # Static IP address (“” for DHCP) in CIDR format (e.g. “192.168.1.1/24″)

    ADDRESS=””

    # Network gateway (e.g. “192.168.1.254″)

    GATEWAY=””

    # List of DNS servers (e.g. “192.168.1.253 192.168.1.254″)

    # This will override the DNS servers from DHCP

    DNS_SERVER=””

    SSID=”xxx”

    # “true” or “”

    HIDDEN=”true”

    # “WEP” or “PSK” or “” or “RSN”

    SECURITY=”WPA”

    PASSPHRASE=”xxx”

    # set to “” to disable NTP

    TIMESERVERS=”0.geexbox.pool.ntp.org 1.geexbox.pool.ntp.org 2.geexbox.pool.ntp.or

    # Services to be started at boot time

    TELNET_SERVER=”true”

    FTP_SERVER=”true”

    HTTP_SERVER=”false”

    SAMBA_SERVER=”false”

    # Use Zeroconf service discovery

    ZEROCONF=”true”

    # Static Samba shares can be defined as shown in the commented examples below,

    # where <%>,<@>,<&>,<#> field separators must be present as shown (Note that

    # the password cannot contain  these special delimiters):

    #STATIC_SMB=”username<%>password<@>ip<&>myservername<#>share1<#>share2<#>share3″

    #STATIC_SMB=”<%><@>ip<&>myservername<#>share1″

    WAIT_FOR_SLOW_DEVICE=”true”

     

    /usr/lib/udhcpc/net-udhcpc:

    #!/bin/sh

    echo “starting net script” >> /tmp/net.txt

    . /etc/network

    sleep 5

    #iwconfig $IFACE essid $SSID key $PASSPHRASE

    systemctl stop wpa_supplicant.service

    echo “stopped wpasu” >> /tmp/net.txt

    /usr/sbin/wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -u -B

    echo “started wpasup” >> /tmp/net.txt

    ifconfig wlan0 up

    echo “wlan up done” >> /tmp/net.txt

    udhcpc -s /bin/assign-ip -i wlan0

    echo “got ip” >> /tmp/net.txt

    ifconfig wlan0 192.168.0.5 up

    echo “done all” >> /tmp/net.txt

    exit 0

    #6198

    tomlohave
    Moderator

    assuming you use one of the last devel iso,

    does the file /lib/systemd/system/network-link.service exist on your system ?

    else your files are correct.

    #6199

    dave1981
    Member

    I’m going to reinstall from ISO – which one would you recommend, the release (with your patch from previous forum thread) or the latest from snapshot dir? It has to be stable enough to use..

    #6200

    tomlohave
    Moderator
    #6201

    dave1981
    Member

    I will try it. Does networking work for you if you use udhcpc manager instead of connman?

    #6202

    tomlohave
    Moderator

    yep, I have tested this version under virtual-box

    #6203

    dave1981
    Member

    The iso you linked installs but the GUI won’t boot, it just flickers the GeexBox logo on and off (though I can log in the terminal). I’m going to reinstall the 3.0 release and patch etc. to get a fresh system and then try everything again.

    #6204

    tomlohave
    Moderator

    ok,

    video card you use ?

    #6205

    dave1981
    Member

    It’s an old Compaq EVO n610c, specs (http://h18000.www1.hp.com/products/quickspecs/11382_div/11382_div.HTML)

    ATI Mobility Radeon 7500 Graphics Controller with 32 MB of DDR video RAM.
    14.1-inch SXGA+ or 14.1-inch XGA display

    #6206

    dave1981
    Member

    Did you change the file at http://download.openbricks.org/test/linux_3.6.7-1_i686.opk ?

    I installed sysfsutils then the kernel upgrade, but now pcmcia module can’t be loaded:

    lsmod -> no output!

    modprobe pcmcia -> “can’t open ‘modules.dep’: no such file or directory

     

Viewing 15 posts - 1 through 15 (of 21 total)

You must be logged in to reply to this topic.

Comments are closed.