ccrisan/thingos

RaspberryPi 0W: Wifi AP is broken

Opened this issue · 0 comments

With current settings, AP on Rpi 0w is not working. Here is log:

---- booting thingOS unknown ----
 * Detecting disk device: /dev/mmcblk0
 * Creating data partition: done
 * Formatting data partition: done
 * Mounting data partition: done
 * Copying data skeleton: done
 * Mounting filesystems: done
 * Mounting overlay filesystems: done
 * Setting empty root password: done
 * Copying version file: done
 * Setting UTC timezone: done
 * Loading kernel modules: done
 * Setting hostname: done
 * Starting syslogd: done
 * Loading device-tree overlays: done
 * Starting throttle watcher: done
 * Starting eudev: done
 * Starting watchdog: done
 * Starting rngd: done
 * Renaming network interfaces: done
 * Preparing AP interfaces: no device
 * Starting dnsmasq: SIOCSIFADDR: No such device
ap0: ERROR while getting interface flags: No such device
done
 * Starting crond: done
 * Generating ssh host keys: done
 * Starting sshd: done

Welcome to thing-115d74d5!
thing-115d74d5 login: root
Password: 
[root@thing-115d74d5 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether b8:27:eb:08:21:80 brd ff:ff:ff:ff:ff:ff

I think problem is with commit 4a4c9e2
There is common variable OS_WLAN1="wlan1" for all boards in os.conf, but if the variable is set, /etc/init.d/S44hostapd will check if this interface is working. Since Rpi 0w does not have wlan1, it will fail. /etc/init.d/S44hostapd should be either changed, or OS_WLAN1 should be set only for boards which actually supports it, not globally. If I remove OS_WLAN1 variable, it works again:

---- booting thingOS unknown ----
 * Detecting disk device: /dev/mmcblk0
 * Creating data partition: done
 * Formatting data partition: done
 * Mounting data partition: done
 * Copying data skeleton: done
 * Mounting filesystems: done
 * Mounting overlay filesystems: done
 * Setting empty root password: done
 * Copying version file: done
 * Setting UTC timezone: done
 * Loading kernel modules: done
 * Setting hostname: done
 * Starting syslogd: done
 * Loading device-tree overlays: done
 * Starting throttle watcher: done
 * Starting eudev: done
 * Starting watchdog: done
 * Starting rngd: done
 * Renaming network interfaces: done
 * Preparing AP interfaces: ap0
 * Starting hostapd on ap0: done (brcmfmac)
 * Starting dnsmasq: done
 * Starting crond: done
 * Generating ssh host keys: done
 * Starting sshd: done

Welcome to thing-115d74d5!
thing-115d74d5 login: root
Password: 
[root@thing-115d74d5 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether b8:27:eb:08:21:80 brd ff:ff:ff:ff:ff:ff
3: ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether b8:27:eb:08:21:80 brd ff:ff:ff:ff:ff:ff
    inet 192.168.27.1/24 brd 192.168.27.255 scope global ap0
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fe08:2180/64 scope link 
       valid_lft forever preferred_lft forever