mattlongman / Hassio-Access-Point

Hass.io addon to let you create a WiFi access point, perfect for using WiFi devices on off-grid installations.
MIT License
81 stars 62 forks source link

rfkill: Cannot open RFKILL control device #18

Closed lululombard closed 3 months ago

lululombard commented 2 years ago

Hey there,

I just tried installing this module on the latest version of Home Assistant (OS 6.6, running Home Assistant 2021.11.4) on a Pi 4, and for some reason, the Wi-Fi network doesn't broadcast. I can't find it at all.

Here are the logs:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Starting Hass.io Access Point Addon
Add DNS: dhcp-option=6,1.1.1.1
Configuration file: /hostapd.conf
rfkill: Cannot open RFKILL control device
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr e4:5f:01:1e:fa:4b and ssid "HomeAssistant"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED

And here's my config:

ssid: HomeAssistant
wpa_passphrase: xxxxxx
channel: '6'
address: 192.168.99.1
netmask: 255.255.255.0
broadcast: 192.168.99.255
interface: wlan0
hide_ssid: '0'
dhcp: '1'
dhcp_start_addr: 192.168.99.10
dhcp_end_addr: 192.168.99.99
allow_mac_addresses: []
deny_mac_addresses: []
debug: 0
hostapd_config_override: []
client_internet_access: '0'
client_dns_override: []

I'm wondering if this problem is related to AppArmor.

Anyways I don't know if the rfkill: Cannot open RFKILL control device and wlan0: Could not connect to kernel driver are supposed to be here, but I guess not? Either way I don't even understand why it says AP-Enabled when it's not enabled :/

Thanks!

hellresistor commented 2 years ago

+1 And not get internet access.

my config

ssid: rpihole
wpa_passphrase: raspberry69
channel: '6'
address: 192.168.10.1
netmask: 255.255.255.0
broadcast: 192.168.10.255
interface: wlan0
hide_ssid: '0'
dhcp: '1'
dhcp_start_addr: 192.168.10.10
dhcp_end_addr: 192.168.10.20
allow_mac_addresses: []
deny_mac_addresses: []
debug: 1
hostapd_config_override: []
client_internet_access: '1'
client_dns_override:
  - 8.8.8.8
dnsmasq_config_override: []

My log with 2 devices connected without internet.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Starting Hass.io Access Point Addon
# Setup interface:
Add to /etc/network/interfaces: iface wlan0 inet static
Run command: nmcli dev set wlan0 managed no
Run command: ip link set wlan0 down
Add to /etc/network/interfaces: address 192.168.10.1
Add to /etc/network/interfaces: netmask 255.255.255.0
Add to /etc/network/interfaces: broadcast 192.168.10.255
Run command: ip link set wlan0 up
# Setup hostapd:
Add to hostapd.conf: ssid=rpihole
Add to hostapd.conf: wpa_passphrase=********
Add to hostapd.conf: channel=6
Add to hostapd.conf: ignore_broadcast_ssid=0
Add to hostapd.conf: macaddr_acl=0
Add to hostapd.conf: interface=wlan0
# DHCP enabled. Setup dnsmasq:
Add to dnsmasq.conf: dhcp-range=192.168.10.10,192.168.10.20,12h
Add to dnsmasq.conf: interface=wlan0
Add custom DNS: dhcp-option=6,8.8.8.8
## Starting dnsmasq daemon
## Starting hostapd daemon
Configuration file: /hostapd.conf
rfkill: Cannot open RFKILL control device
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr dc:a6:32:77:fb:62 and ssid "rpihole"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 
wlan0: STA f4:cf:a2:15:89:4d IEEE 802.11: disassociated
wlan0: STA f4:cf:a2:15:89:4d IEEE 802.11: disassociated
wlan0: STA f4:cf:a2:15:89:4d IEEE 802.11: disassociated
wlan0: STA f4:cf:a2:15:89:4d IEEE 802.11: disassociated
wlan0: STA f4:cf:a2:15:89:4d IEEE 802.11: disassociated
wlan0: STA f4:cf:a2:15:89:4d IEEE 802.11: disassociated
wlan0: STA f4:cf:a2:15:89:4d IEEE 802.11: disassociated
wlan0: STA f4:cf:a2:15:89:4d IEEE 802.11: disassociated
wlan0: STA f4:cf:a2:15:89:4d IEEE 802.11: associated
wlan0: AP-STA-CONNECTED f4:cf:a2:15:89:4d
wlan0: STA f4:cf:a2:15:89:4d RADIUS: starting accounting session 6991D96AF001D84A
wlan0: STA f4:cf:a2:15:89:4d WPA: pairwise key handshake completed (RSN)
wlan0: STA 7c:fd:6b:74:a7:ad IEEE 802.11: associated
wlan0: AP-STA-CONNECTED 7c:fd:6b:74:a7:ad
wlan0: STA 7c:fd:6b:74:a7:ad RADIUS: starting accounting session 8DB0749D88B49EF2
wlan0: STA 7c:fd:6b:74:a7:ad WPA: pairwise key handshake completed (RSN)
pepjo commented 2 years ago

I also have this problem, like the OP, I am using a RPi4 my AP does not start either, and I cannot find how to fix it. I am however running HAOS 7.1.

These are the logs from the UI:

# Setup hostapd:
Add to hostapd.conf: ssid=PORTAL
Add to hostapd.conf: wpa_passphrase=********
Add to hostapd.conf: channel=4
Add to hostapd.conf: ignore_broadcast_ssid=0
Add to hostapd.conf: macaddr_acl=0
Add to hostapd.conf: interface=wlan0
# DHCP not enabled. Skipping dnsmasq
## Starting hostapd daemon
Configuration file: /hostapd.conf
rfkill: Cannot open RFKILL control device
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr e4:5f:01:20:4a:a5 and ssid "PORTAL"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
petervflocke commented 2 years ago

Exactly same error messages in my configuration on Host Operating System | Home Assistant OS 7.0 Supervisor Version | supervisor-2022.01.1 Hardware: RPI4 Access point appears for a few seconds and disappears. And I cannot connect to it. Any suggestion?

jaybz commented 2 years ago

I've been having the same issue on RPI4 and HassOS 7. It looks like hw_mode=g doesn't work. Forcing hw_mode=a "fixes" but that means your clients need 5ghz. If you do have 2.4ghz clients that need to connect, upgrading to HassOS 8.0.rc3 (you'll need to join the beta channel) will let hw_mode=g work on RPI4.

petervflocke commented 2 years ago

upgrading to HassOS 8.0.rc3 (you'll need to join the beta channel) will let hw_mode=g work on RPI4. Many thanks for your workaround and detailed clarification! As my homeassistant is a productive environment with a couple of important automations, I'll wait till HassOS 8.x move to the official, not-beta release and then use hw_mode=g.

Cheers! Peter

ROBOT0-VT commented 3 months ago

Issue seems fixed, and is stale