joaofl / hassio-addons

More add-ons for your Hass.io.
19 stars 25 forks source link

Hassio Hotspot says wlan0 isn't wlan0? #27

Closed SpeeterYT closed 7 months ago

SpeeterYT commented 8 months ago

Here's my log:

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...
Unknown network interface wlan0. Please set one of the available:
wlan0:
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

I am on a RPI3b+

This is my config:

ssid: ESPhometestnet
wpa_passphrase: ***
channel: 2
address: 192.168.2.1
netmask: 255.255.255.0
broadcast: 192.168.2.254
interface: wlan0
internet_interface: eth0
allow_internet: true
dhcp_enable: true
dhcp_start: 192.168.2.100
dhcp_end: 192.168.2.200
dhcp_dns: 1.1.1.1
dhcp_subnet: 255.255.255.0
dhcp_router: 192.168.2.1
hide_ssid: false

I am on Version 1.1.4

joaofl commented 8 months ago

Are you sure there is no space in the end? When I try to reproduce here, It works just fine.

Is that the onboard wifi of the rpi3b? I believe this transceiver does not work as hot-spot (or very poorly). Please make sure its not that issue, and give a try with a USB Wifi dongle as well.

incarvr6 commented 7 months ago

I'm getting exactly same issue with RP4 for both internal and external.

Core 2024.2.2 Supervisor 2024.01.1 Operating System 11.5 Frontend 20240207.1

Unknown network interface wlp1s0u1u4. Please set one of the available: wlan0: wlp1s0u1u4: Unknown network interface wlan0. Please set one of the available: wlan0: wlp1s0u1u4: Logger: homeassistant.components.hassio Source: components/hassio/websocket_api.py:138 Integration: Home Assistant Supervisor (documentation, issues) First occurred: 00:02:11 (1 occurrences) Last logged: 00:02:11 Failed to to call /addons/891ed7ea_hassio-hotspot/stats - Container addon_891ed7ea_hassio-hotspot is not running

24-02-18 00:16:20 WARNING (SyncWorker_3) [supervisor.addons.validate] Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of Hassio Hotspot

SpeeterYT commented 7 months ago

I just rebooted a few times, reinstallled the Addon and searched for APs in the WiFi settings (some people said this should work... (it didn't). At some point the issue fixed itself, idk what did it...

incarvr6 commented 7 months ago

I just rebooted a few times, reinstallled the Addon and searched for APs in the WiFi settings (some people said this should work... (it didn't). At some point the issue fixed itself, idk what did it...

I did the same, several reboots, different ports, reinstalls nothing helped.

Is your HA on latest release? Do you have protection mode off?

incarvr6 commented 7 months ago

I have tried to use add-on on NUC10 same error: Starting... Unknown network interface wlp0s20f3. Please set one of the available: wlp0s20f3:

joaofl commented 7 months ago

I haven't been able to reproduce the issue, but I will check again on the string comparison logic there.

incarvr6 commented 7 months ago

I have rolled back with backup few versions older still same issue. Core 2024.1.2 Supervisor 2024.01.1 Operating System 11.5 Frontend 20240104.0

KnzHz commented 7 months ago

Make sure you use the correct device na<me, Ubnutu changed naming on wireless adapters away from wlan0 etc.

incarvr6 commented 7 months ago

Make sure you use the correct device na<me, Ubnutu changed naming on wireless adapters away from wlan0 etc.

Yes it is the correct name, it is showing in logs!

Problem is even on two different devices!

Other add-on like tailscale is seeing network interfaces with same names and it works, so names are 100% correct.

joaofl commented 7 months ago

The issue seems to be related to this chunk of code:

https://github.com/joaofl/hassio-addons/blob/24bf7bdf86e921d6827c93d453af59ad8584ed5b/hassio-hotspot/run.sh#L53-L72

Could you please try to run those commands on the terminal and see the output of the relevant variables?

incarvr6 commented 7 months ago

It gives output with correct interfaces just like in logs IMG20240222152904.jpg

joaofl commented 7 months ago

It gives output with correct interfaces just like in logs!

The problem is likely related to the : in the end... Can you please try to set your wlan to wlan0: (including the colon)?

incarvr6 commented 7 months ago

It gives output with correct interfaces just like in logs!

The problem is likely related to the : in the end... Can you please try to set your wlan to wlan0: (including the colon)?

Yes, That did the trick!!! It finally started!

incarvr6 commented 7 months ago

Well now different problem: `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... Set nmcli managed no /run.sh: line 75: nmcli: command not found Network interface set to wlan0: Deleting iptables iptables: Bad rule (does a matching rule exist in that chain?). iptables: Bad rule (does a matching rule exist in that chain?). iptables: Bad rule (does a matching rule exist in that chain?). Setup hostapd ... Setup interface ... Resseting interfaces ifdown: interface wlan0: not configured ip: ioctl 0x8914 failed: Address not available Setup udhcpd ... Starting DHCP server... udhcpd: started, v1.36.1 udhcpd: can't open '/var/lib/udhcpd/udhcpd.leases': No such file or directory Starting HostAP daemon ... Interface stats: wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether dc:a6:32:83:23:e5 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0:: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.168.2.1 netmask 255.255.255.0 broadcast 192.168.2.254 ether dc:a6:32:83:23:e5 txqueuelen 1000 (Ethernet)

wlp1s0u1u4: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether 00:25:9c:9e:c4:b1 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) rfkill: Cannot get wiphy information ACS: Automatic channel selection started, this may take a bit wlan0:: interface state UNINITIALIZED->ACS wlan0:: ACS-STARTED ACS: Unable to collect survey data ACS: All study options have failed Interface initialization failed wlan0:: interface state ACS->DISABLED wlan0:: AP-DISABLED ACS: Possibly channel configuration is invalid, please report this along with your config file. ACS: Failed to start wlan0:: AP-DISABLED hostapd_free_hapd_data: Interface wlan0: wasn't started nl80211: deinit ifname=wlan0: disabled_11b_rates=0 wlan0:: interface state DISABLED->DISABLED wlan0:: interface state DISABLED->DISABLED wlan0:: AP-DISABLED wlan0:: CTRL-EVENT-TERMINATING hostapd_free_hapd_data: Interface wlan0: wasn't started`

incarvr6 commented 7 months ago

At the end i managed to make it work only with RP4 internal wlan0: but internet bridge still did't work. Now seems like there is problems with external wifi adapter.

`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... Set nmcli managed no /run.sh: line 75: nmcli: command not found Network interface set to wlp0s20f3: Deleting iptables MASQUERADE all opt -- in out eth0 0.0.0.0/0 -> 0.0.0.0/0
ACCEPT all opt -- in eth0 out wlp0s20f3: 0.0.0.0/0 -> 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT all opt -- in wlp0s20f3: out eth0 0.0.0.0/0 -> 0.0.0.0/0
Configuring iptables for NAT MASQUERADE all opt -- in
out eth0 0.0.0.0/0 -> 0.0.0.0/0
ACCEPT all opt -- in eth0 out wlp0s20f3: 0.0.0.0/0 -> 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT all opt -- in wlp0s20f3: out eth0 0.0.0.0/0 -> 0.0.0.0/0
Setup hostapd ... Setup interface ... Resseting interfaces ifdown: interface wlp0s20f3: not configured ip: ioctl 0x8914 failed: Address not available Setup udhcpd ... Starting DHCP server... udhcpd: started, v1.36.1 udhcpd: can't open '/var/lib/udhcpd/udhcpd.leases': No such file or directory Starting HostAP daemon ... Interface stats: wlp0s20f3: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether d8:3b:bf:93:f6:25 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlp0s20f3:: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether d8:3b:bf:93:f6:25 txqueuelen 1000 (Ethernet)

ztk4jmstlk: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 2800 inet 192.168.195.147 netmask 255.255.255.0 broadcast 192.168.195.255 inet6 fe80::e861:39ff:fe23:6085 prefixlen 64 scopeid 0x20 ether ea:61:39:23:60:85 txqueuelen 1000 (Ethernet) Could not set interface wlp0s20f3: flags (DOWN): Address not available Could not set interface wlp0s20f3: flags (DOWN): Address not available Could not set interface wlp0s20f3: flags (DOWN): Address not available Could not set interface wlp0s20f3: flags (DOWN): Address not available Could not set interface wlp0s20f3: flags (DOWN): Address not available Could not set interface wlp0s20f3: flags (DOWN): Address not available Could not set interface wlp0s20f3: flags (DOWN): Address not available Could not set interface wlp0s20f3: flags (DOWN): Address not available Could not set interface wlp0s20f3: flags (DOWN): Address not available nl80211: Could not configure driver mode nl80211: deinit ifname=wlp0s20f3: disabled_11b_rates=0 nl80211 driver initialization failed. wlp0s20f3:: interface state UNINITIALIZED->DISABLED wlp0s20f3:: AP-DISABLED wlp0s20f3:: CTRL-EVENT-TERMINATING hostapd_free_hapd_data: Interface wlp0s20f3: wasn't started`

incarvr6 commented 7 months ago

same with different adapter:

`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... Set nmcli managed no /run.sh: line 75: nmcli: command not found Network interface set to wlp1s0u1u4: Deleting iptables MASQUERADE all opt -- in out enp1s0u1u3 0.0.0.0/0 -> 0.0.0.0/0
iptables: Bad rule (does a matching rule exist in that chain?). iptables: Bad rule (does a matching rule exist in that chain?). Configuring iptables for NAT MASQUERADE all opt -- in
out enp1s0u1u3 0.0.0.0/0 -> 0.0.0.0/0
ACCEPT all opt -- in enp1s0u1u3 out wlp1s0u1u4: 0.0.0.0/0 -> 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT all opt -- in wlp1s0u1u4: out enp1s0u1u3 0.0.0.0/0 -> 0.0.0.0/0
Setup hostapd ... Setup interface ... Resseting interfaces ifdown: interface wlp1s0u1u4: not configured ip: ioctl 0x8914 failed: Address not available Setup udhcpd ... Starting DHCP server... udhcpd: started, v1.36.1 udhcpd: can't open '/var/lib/udhcpd/udhcpd.leases': No such file or directory Starting HostAP daemon ... Interface stats: wlp1s0u1u4: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether 00:25:9c:9e:c4:b1 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlp1s0u1u4:: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.168.90.10 netmask 255.255.255.0 broadcast 192.168.90.254 ether 00:25:9c:9e:c4:b1 txqueuelen 1000 (Ethernet)

Could not set interface wlp1s0u1u4: flags (DOWN): Address not available Could not set interface wlp1s0u1u4: flags (DOWN): Address not available Could not set interface wlp1s0u1u4: flags (DOWN): Address not available Could not set interface wlp1s0u1u4: flags (DOWN): Address not available Could not set interface wlp1s0u1u4: flags (DOWN): Address not available Could not set interface wlp1s0u1u4: flags (DOWN): Address not available Could not set interface wlp1s0u1u4: flags (DOWN): Address not available Could not set interface wlp1s0u1u4: flags (DOWN): Address not available Could not set interface wlp1s0u1u4: flags (DOWN): Address not available nl80211: Could not configure driver mode nl80211: deinit ifname=wlp1s0u1u4: disabled_11b_rates=0 nl80211 driver initialization failed. wlp1s0u1u4:: interface state UNINITIALIZED->DISABLED wlp1s0u1u4:: AP-DISABLED wlp1s0u1u4:: CTRL-EVENT-TERMINATING hostapd_free_hapd_data: Interface wlp1s0u1u4: wasn't started`

joaofl commented 7 months ago

I guess that the colon satisfies the first condition check, but makes the rest fail. I will work on a fix asap.

But mind that the rpi4 embedded wifi gives a very unstable wifi. At least that was the case last time I tried

incarvr6 commented 7 months ago

I guess that the colon satisfies the first condition check, but makes the rest fail. I will work on a fix asap.

But mind that the rpi4 embedded wifi gives a very unstable wifi. At least that was the case last time I tried

Thank you for your help! Yeah with internal wifi auto channel did't work as well. With external adapter it would be definatley better. Ideally i would want to bridge it with tailscale interface.

smbitech commented 7 months ago

The issue seems to be related to this chunk of code:

... INTERFACES_AVAILABLE="$(ifconfig -a | grep wl | cut -d ' ' -f '1')" ...

Shouldn't the cut delimiter be ':', perhaps also with the grep target being anchored to beginning of line?

i.e., ifconfig -a | grep '^wl' | cut -d ':' -f '1'

joaofl commented 7 months ago

The issue seems to be related to this chunk of code: ... INTERFACES_AVAILABLE="$(ifconfig -a | grep wl | cut -d ' ' -f '1')" ...

Shouldn't the cut delimiter be ':', perhaps also with the grep target being anchored to beginning of line?

i.e., ifconfig -a | grep '^wl' | cut -d ':' -f '1'

Thanks for the suggestion. I will push the changes now.

joaofl commented 7 months ago

Done. I guess this fixes this issue. So I am closing it, and will reopen it if you face any other issues.