setting up wifi properly

This forum is for topics dealing with problems with software specifically in the ARMv6h repo.

setting up wifi properly

Postby tchelovek » Tue Mar 24, 2015 4:30 pm

On a Raspberry Pi (armv6) I am setting up a wireless connection with an Edimax EW-7811Un USB dongle.

After having been led astray by various (most) googled advices, it boiled down to the fact, that standard archlinux armv6 uses systemd-networkd as the service for network issues. (No netctl, no dhcpcd)

I can get WLAN up and running _only_ if eth0 is connected at boot. Thereafter I can set eth0 down and unplug it even, but the WLAN will not work if eth0 is unplugged to begin with. The AP shows it as connected though.

I would very much appreciate if anyone had a working suggestion to solve the riddle.

Files involved are

    /etc/systemd/network/wlan0.network

$this->bbcode_second_pass_code('', '[Match]
Name=wlan0

[Network]
#DHCP=both
DNS=192.168.178.1
Address=192.168.178.24/24
Gateway=192.168.178.1')

    /etc/wpa_supplicant/wlan0.conf

$this->bbcode_second_pass_code('', 'update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
ssid="myap"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
psk="top-secret"
# wpa_ptk_rekey=600
}')

    /etc/systemd/system/wpa_supplicant.service

$this->bbcode_second_pass_code('', '[Unit]
Description=Wireless network connection wlan0
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes

ExecStart=/usr/sbin/wpa_supplicant -i wlan0 -D wext -B -c/etc/wpa_supplicant/wlan0.conf

[Install]
WantedBy=multi-user.target')

As stated above, Raspberry Pi connects to the AP, but only if eth0 is present at boot. After boot I can SSH to Raspberry Pi, the set eth0 down and even disconnect the cable (in that order), but not with cable removed before booting or removing cable before setting eth0 down.
ODROID C1 ( armv7h ), Raspberry Pi 2B+ ( armv7h ), 2 x Raspberry Pi B+ ( armv6h ), Raspberry Pi4 (armv7l)
tchelovek
 
Posts: 17
Joined: Sat Mar 07, 2015 1:33 pm
Location: Yes

Re: setting up wifi properly

Postby moonman » Wed Mar 25, 2015 9:45 am

After=network.target is your problem. It waits for the network to be up before starting service
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: setting up wifi properly

Postby tchelovek » Wed Mar 25, 2015 5:19 pm

$this->bbcode_second_pass_quote('', 'A')fter=network.target is your problem. It waits for the network to be up before starting service


Thanks for the fast and helpful reply, moonman, :-)

It now works as expected.

Tchelovek
ODROID C1 ( armv7h ), Raspberry Pi 2B+ ( armv7h ), 2 x Raspberry Pi B+ ( armv6h ), Raspberry Pi4 (armv7l)
tchelovek
 
Posts: 17
Joined: Sat Mar 07, 2015 1:33 pm
Location: Yes


Return to ARMv6h

Who is online

Users browsing this forum: No registered users and 4 guests