Wireless settings don't survive reboot

10 posts / 0 new
Last post
#1 Mon, 2016-05-23 02:39
dbabits
  • dbabits's picture
  • Offline
  • Last seen: 1 year 10 months ago
  • Joined: 2016-05-23

I followed instructions on this page, which work, but don't survive reboot:
https://wiki.alpinelinux.org/wiki/Connecting_to_a_wireless_access_point
wpa_supplicant exits with this message in /var/logs/messages:

Jan  1 00:00:11 alpine daemon.err /etc/init.d/wpa_supplicant[1102]: ERROR: wpa_supplicant failed to start
Jan  1 00:00:12 alpine daemon.info init: starting pid 1220, tty '': '/sbin/rc default'
Jan  1 00:00:12 alpine daemon.warn openrc[1220]: WARNING: clock skew detected!
Jan  1 00:00:12 alpine daemon.err /etc/init.d/wpa_supplicant[1240]: start-stop-daemon: failed to start `/sbin/wpa_supplicant'
Jan  1 00:00:12 alpine daemon.err /etc/init.d/wpa_supplicant[1222]: ERROR: wpa_supplicant failed to start

Every time after reboot, I execute commands referenced at the WIki link above, and then everything works.
I'm running Raspberry Pi 2, and have followed installation instructions at that page.
I do not forget lbu commit

alpine:~$ sudo rc-update
                ....
               udhcpd | boot                                         
       wpa_supplicant | boot          

Mon, 2016-05-23 05:06
AmatCoder
  • AmatCoder's picture
  • Offline
  • Last seen: 1 year 4 months ago
  • Joined: 2013-10-18

Has you followed this part? :

Quote:
Next, create /etc/wpa_supplicant/ (permissions of 755 with root:root are fine), and move wpa.conf into that folder, renaming it to wpa_supplicant.conf.

Also check your /etc/network/interfaces file.

Mon, 2016-05-23 06:19
dbabits
  • dbabits's picture
  • Offline
  • Last seen: 1 year 10 months ago
  • Joined: 2016-05-23

Yes, I followed all parts, and it works when executing manually. wpa_supplicant fails to start on reboot without any detailed error.

Mon, 2016-05-23 08:32 (Reply to #3)
AmatCoder
  • AmatCoder's picture
  • Offline
  • Last seen: 1 year 4 months ago
  • Joined: 2013-10-18

Here it is working (and I am using diskless mode too), so something is wrong with your configuration.
One thing I can think of is dbus. I believe it needs to start before wpa_supplicant at boot.

Try rc-update add dbus then lbu ci and reboot.

This is my complete rc-update:

                acpid |      default                 
             bootmisc | boot                         
                 dbus |      default                 
                devfs |                       sysinit
                dmesg |                       sysinit
             hostname | boot                         
              hwclock | boot                         
            hwdrivers |                       sysinit
              keymaps | boot                         
            killprocs |              shutdown        
                local |      default                 
              modloop |                       sysinit
              modules | boot                         
             mount-ro |              shutdown        
           networking | boot                         
            savecache |              shutdown        
               sysctl | boot                         
               syslog | boot                         
                 udev |      default          sysinit
       udev-postmount |      default          sysinit
         udev-trigger |                       sysinit
              urandom | boot 
       wpa_supplicant | boot

Sun, 2016-05-29 08:08
dbabits
  • dbabits's picture
  • Offline
  • Last seen: 1 year 10 months ago
  • Joined: 2016-05-23

I added dbus, but it didn't help.
Should it be at default level or boot level?

alpine:~$ sudo rc-update
                acpid |      default                 
             bootmisc | boot                         
              chronyd |      default                 
                 cron |      default                 
                 dbus |      default                 
                devfs |                       sysinit
                dmesg |                       sysinit
             hostname | boot                         
            hwdrivers |                       sysinit
              keymaps | boot                         
            killprocs |              shutdown        
                 mdev |                       sysinit
              modloop |                       sysinit
              modules | boot                         
             mount-ro |              shutdown        
           networking | boot                         
                nginx |      default                 
                 ntpd | boot default                 
              php-fpm |      default                 
            savecache |              shutdown        
                 sshd | boot default                 
              swclock | boot                         
               sysctl | boot                         
               syslog | boot                         
               udhcpd | boot                         
              urandom | boot                         
       wpa_supplicant | boot              
 
alpine daemon.err /etc/init.d/wpa_supplicant[1122]: start-stop-daemon: failed to start `/sbin/wpa_supplicant'

This is what I have to do manually every time after boot to activate wireless:
alpine:~$ cat start_wireless 
iwconfig wlan0 essid D2D8F4
wpa_supplicant -B -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
udhcpc -i wlan0
iwconfig wlan0
ifconfig wlan0

alpine:~$ cat /etc/wpa_supplicant/wpa_supplicant.conf 
# reading passphrase from stdin
network={
        ssid="D2D8F4"
        #psk="78508162"
        psk=8ac8cb56916ac69475fb794563b1b973fd32e6f83a0ebe06adb7f740744814c6
}

Sun, 2016-05-29 02:43 (Reply to #5)
AmatCoder
  • AmatCoder's picture
  • Offline
  • Last seen: 1 year 4 months ago
  • Joined: 2013-10-18

Please could you also post your /etc/network/interfaces ? Perhaps the problem is there.

Sun, 2016-05-29 08:06
dbabits
  • dbabits's picture
  • Offline
  • Last seen: 1 year 10 months ago
  • Joined: 2016-05-23

dima@alpine:~$cat /etc/network/interfaces 
auto lo
iface lo inet loopback
 
auto eth0
iface eth0 inet dhcp
        hostname alpine
 
auto wlan0
iface wlan0 inet dhcp
        hostname alpine

Sun, 2016-05-29 10:30 (Reply to #7)
AmatCoder
  • AmatCoder's picture
  • Offline
  • Last seen: 1 year 4 months ago
  • Joined: 2013-10-18

Maybe udhcpc times out and it does not get a lease. Try:

auto lo
iface lo inet loopback
 
auto eth0
iface eth0 inet dhcp
        hostname alpine
 
auto wlan0
iface wlan0 inet dhcp
        udhcpc_opts -t 10 -T 10
        hostname alpine

Sun, 2016-05-29 22:37
dbabits
  • dbabits's picture
  • Offline
  • Last seen: 1 year 10 months ago
  • Joined: 2016-05-23

Thanks, but it did not help.

Tue, 2016-05-31 23:37 (Reply to #9)
ScrumpyJack
  • ScrumpyJack's picture
  • Offline
  • Last seen: 6 months 3 weeks ago
  • Joined: 2013-06-20

Can we see more output from wpa_supplicant? Start it with the -dd flag from the init script.

Also, how does this behave?
rc-update del wpa_supplicant
reboot
rc-service wpa_supplicant start

Log in or register to post comments