lakinduakash / linux-wifi-hotspot

Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface. It is also able to create a hotspot using the same wifi card which is connected to an AP already ( Similar to Windows 10).
BSD 2-Clause "Simplified" License
3.2k stars 296 forks source link

create_ap inside systemd service: wlan0 is not a WiFi interface #243

Closed onny closed 2 years ago

onny commented 2 years ago

Describe the bug I'm currently trying to make a module of linux-wifi-hotspot for NixOS https://github.com/NixOS/nixpkgs/pull/168510

The systemd service launches create_ap with --config parameter and following config file:

INTERNET_IFACE=enp0s25
PASSPHRASE=12345678
SSID=onnys hotspot
WIFI_IFACE=wlan0

This command does work if I run it from my shell. Inside the systemd service it fails with 'wlan0' is not a WiFi interface.

I already did some debugging and it looks like the function is_wifi_interface gets only 0 passed as an argument for the interface name. Not sure why, maybe someone has an idea?

Regards Jonas

lakinduakash commented 2 years ago

Hi, does it start at startup or same happen at in anytime you start the service via systemd?

Are you using this service file ?

It should return 1 when it fails, Anyway can you put the output of iw dev wlan0 info?

onny commented 2 years ago

Oh sorry it was a missing dependency. I guess the NixOS service for your create_ap script should work :) I also wrote a blog post about it: https://blog.project-insanity.org/2022/04/14/easily-configure-a-wifi-hotspot-on-nixos/

Thank you for this program :)

lakinduakash commented 2 years ago

@onny That's great you help to spread this to the community. Thanks

tminhvu commented 1 month ago

Ran into this same issue but I already installed every dependency. No idea what to do now.