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 63 forks source link

Internet access not working #30

Closed Dejv311 closed 2 years ago

Dejv311 commented 2 years ago

After your latest update the internet access option stopped working and it is a huge problem for me. Please resolve ASAP, thank you!

mattlongman commented 2 years ago

@Dejv311 - thanks for the report. To clarify, issues since v0.4.2 (from a couple of days ago)?

Dejv311 commented 2 years ago

Yes

mattlongman commented 2 years ago

I didn't bump the version number after 28, only after 23, so issue could be caused by either of these.

@esotericnonsense - don't suppose you could test this before I back out the change, could you?

mattlongman commented 2 years ago

After your latest update the internet access option stopped working and it is a huge problem for me. Please resolve ASAP, thank you!

Can you provide logs please @Dejv311

Dejv311 commented 2 years ago

Hi I had to leave for work, so I have no further way to test it, but while my TV (android 11 I think) and phone (android 12) had no internet, my Xiaomi vacuum seems to be connected to the cloud at the moment. I tried restarting the plugin in the morning multiple times, but it did not resolve the issue.

The log is here:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Starting Hass.io Access Point Addon
/run.sh: line 62: nmcli: command not found
/run.sh: line 186: nmcli: command not found
Couldn't get DNS servers from host. Consider setting with 'client_dns_override' config option.
rfkill: Cannot open RFKILL control device
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: associated
wlan0: AP-STA-CONNECTED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX RADIUS: starting accounting session CD8D4910980F49A4
wlan0: STA XX:XX:XX:XX:XX:XX WPA: pairwise key handshake completed (RSN)
wlan0: EAPOL-4WAY-HS-COMPLETED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: associated
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: associated
wlan0: AP-STA-CONNECTED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX RADIUS: starting accounting session F423A49389816BCF
wlan0: STA XX:XX:XX:XX:XX:XX WPA: pairwise key handshake completed (RSN)
wlan0: EAPOL-4WAY-HS-COMPLETED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: associated
wlan0: AP-STA-CONNECTED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX RADIUS: starting accounting session 8A63778E1A75FDD8
wlan0: STA XX:XX:XX:XX:XX:XX WPA: pairwise key handshake completed (RSN)
wlan0: EAPOL-4WAY-HS-COMPLETED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: associated
wlan0: AP-STA-CONNECTED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX RADIUS: starting accounting session 0E7766B5AFB99B81
wlan0: STA XX:XX:XX:XX:XX:XX WPA: pairwise key handshake completed (RSN)
wlan0: EAPOL-4WAY-HS-COMPLETED XX:XX:XX:XX:XX:XX
wlan0: AP-STA-CONNECTED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX RADIUS: starting accounting session 93CC2AC73B038E86
wlan0: STA XX:XX:XX:XX:XX:XX WPA: pairwise key handshake completed (RSN)
wlan0: EAPOL-4WAY-HS-COMPLETED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: associated
wlan0: AP-STA-CONNECTED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX RADIUS: starting accounting session 79E52B33F3269E0F
wlan0: STA XX:XX:XX:XX:XX:XX WPA: pairwise key handshake completed (RSN)
wlan0: EAPOL-4WAY-HS-COMPLETED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: disassociated
wlan0: AP-STA-DISCONNECTED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: disassociated
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: disassociated
wlan0: AP-STA-DISCONNECTED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: disassociated
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: disassociated
wlan0: AP-STA-DISCONNECTED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: disassociated
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: disassociated
wlan0: AP-STA-DISCONNECTED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: disassociated
mattlongman commented 2 years ago

Couldn't get DNS servers from host. Consider setting with 'client_dns_override' config option.

Could you try setting this option, e.g.:

"client_dns_override": ['1.1.1.1', '8.8.8.8']

G2G2G2G commented 2 years ago

I've never got internet working, nor ability to connect to HA through it.. but the AP seems to work. There are several other threads open about this but I cant' tell what is solved and what isn't since they are so old

How do you see network info in HA OS? (I'm on a raspberry pi 4, I've used linux for 20 years but never HA.. seems OS is locked down and everything is accessed through HA?)

1 This is the only almost relevant info, says wireless is null but this addon is running fine and the AP is up. IDK how to actually see info, let alone iptables info etc

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Starting Hass.io Access Point Addon
/run.sh: line 62: nmcli: command not found
Add custom DNS: dhcp-option=6,1.1.1.1,8.8.8.8
rfkill: Cannot open RFKILL control device
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 
wlan0: STA fc:c2:de:c8:c7:3d IEEE 802.11: associated
wlan0: AP-STA-CONNECTED fc:c2:de:c8:c7:3d
wlan0: STA fc:c2:de:c8:c7:3d RADIUS: starting accounting session 652A73E635E36778
wlan0: STA fc:c2:de:c8:c7:3d WPA: pairwise key handshake completed (RSN)
wlan0: EAPOL-4WAY-HS-COMPLETED fc:c2:de:c8:c7:3d

wtf is the 6 in my dhcp option? That's my wifi channel...

mattlongman commented 2 years ago

dhcp-option=6,[DNS server 1],[DNS server 2] is used to specify DNS servers. The 6 is just what dnsmasq uses to specify this.

It's worth reiterating that this addon will try to get DNS servers from the host (HA) OS, if it can't, you'll see Couldn't get DNS servers from host. Consider setting with 'client_dns_override' config option. in the log (as @Dejv311 saw), in which case you'll need to specify it yourself.

Even if the addon can get DNS, you may want to override it for clients anyway (e.g. point clients to a public DNS server instead of local DNS).

FWIW, I should be getting some RPIs very soon, so I'll be able to do some testing.

mattlongman commented 2 years ago

Couldn't get DNS servers from host. Consider setting with 'client_dns_override' config option.

Could you try setting this option, e.g.:

"client_dns_override": ['1.1.1.1', '8.8.8.8']

@Dejv311 can you confirm whether this worked?

I've just tested this on: Home Assistant Core 2022.6.6 Home Assistant Supervisor 2022.05.3 Home Assistant OS 8.2

and it's working as expected. If you're still having issues, please provide your config (redacted if required).

Dejv311 commented 2 years ago

Hi, I am sorry for the late reply (i was not home). I tried the custom DNS, but it did not solve the issue (though the warning is now gone). I noticed few interesting things in windows network info:

DNS:

fec0:0:0:ffff::1%1 (bez šifrování)
fec0:0:0:ffff::2%1 (bez šifrování)
fec0:0:0:ffff::3%1 (bez šifrování)

Date of receiving DHCP: čtvrtek ‎1. ‎ledna ‎1970 2:00:00

Date of returning DHCP: čtvrtek ‎1. ‎ledna ‎1970 2:00:00

The DHCP IP adress seemed to be correct (within the defined range of the DHCP)

LOG FROM HA:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Starting Hass.io Access Point Addon
/run.sh: line 62: nmcli: command not found
Add custom DNS: dhcp-option=6,1.1.1.1,8.8.8.8
rfkill: Cannot open RFKILL control device
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: associated
wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: associated
wlan0: AP-STA-CONNECTED XX:XX:XX:XX:XX:XX
wlan0: STA XX:XX:XX:XX:XX:XX RADIUS: starting accounting session C52EA3CF17198200
wlan0: STA XX:XX:XX:XX:XX:XX WPA: pairwise key handshake completed (RSN)
wlan0: EAPOL-4WAY-HS-COMPLETED XX:XX:XX:XX:XX:XX
wlan0: AP-STA-CONNECTED XX:XX:XX:XX:XX:XX
...
[nothing interesting follows]

My configuration:

ssid: MyWifi
wpa_passphrase: MyPassword
channel: '6'
address: 192.168.99.1
netmask: 255.255.255.0
broadcast: 192.168.99.255
interface: wlan0
hide_ssid: '1'
dhcp: '1'
dhcp_start_addr: 192.168.99.10
dhcp_end_addr: |-
  192.168.99.200,12h
  dhcp-host=XX:XX:XX:XX:XX:XX,192.168.99.111
  ... [few more reservations here]
  dhcp-host=XX:XX:XX:XX:XX:XX,192.168.99.123
   #
allow_mac_addresses: []
deny_mac_addresses: []
debug: 0
hostapd_config_override: []
client_internet_access: 1
client_dns_override:
  - 1.1.1.1
  - 8.8.8.8
dnsmasq_config_override: []

I use the "old school" way to make reservations [This config worked 100% fine before the update]. Thanks for having a look at this!

mattlongman commented 2 years ago

Just pushed a minor update to fix Issue 31. Turns out any nmcli command would've been failing since Alpine was updated to 3.16 (this addon doesn't specify versions - maybe it should, but doesn't currently), so any rebuilds since May 23rd would've used this version.

See Alpine 3.16.0:

NetworkManager plugins have moved to subpackages and are no longer installed by default. Users may need install plugins to not lose network connectivity

You can probably remove the client_dns_override option now if you didn't need it before, as this should work again.

I have tested using your config (and especially using the DHCP reservation within the dhcp_end_addr option), and this works for me.

Please update to this and try again now, as there may have been something else here causing this. If it still doesn't work, please set debug to 1 and include the extra logging info.

Edit: you could also try coping the extra info for DHCP reservations into the new dnsmasq_config_override option from 23