Jump to content

Recommended Posts

Posted

Hi,

 

I would like to configure my nanopi Air as an AP and facing some issues.

 

I have edit my /etc/network/interfaces as follow to use hostapd

 

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
hostapd /etc/hostapd.conf
address 192.168.1.1
netmask 255.255.255.0

and I have linked the the hostapd.config config file in the /init.d/hostapd.

 

my hostapd.config is as below

 

ssid=AERS
interface=wlan0
hw_mode=g
channel=5
driver=nl80211

logger_syslog=0
logger_syslog_level=0
wmm_enabled=1
wpa=2
preamble=1

wpa_passphrase=aerstest
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0

noscan=1

# controlling enabled
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

when I power on my board, few things might happen

 

  • SSID shows up for few seconds and disappear
  • SSID doesn't show up

 

Does anyone has an idea for troubleshooting this?

 

I haven't started to configure the dnsmasq yet.

 

Thank you,

 

Tibibs

Posted

Take a look at your logfiles like syslog. Enable debug logging für hostapd and what everyone likes to see: armbianmonitor -u

Posted

Hi,

 

thank you for the quick answer.

the link for armbian monitor => http://ix.io/2jDG

 

it has been generated while being in client mode (as I can't access the board when in AP)

I hope it is not a problem.

 

I will dig in the log files to see what I can spot.

 

a very quick look made me get my attention on this

 

Apr 26 19:04:44 AERS NetworkManager[635]: <warn>  [1587899084.5349] device (wlan0): re-acquiring supplicant interface (#2).
Apr 26 19:04:44 AERS wpa_supplicant[630]: ctrl_iface exists and seems to be in use - cannot override it
Apr 26 19:04:44 AERS wpa_supplicant[630]: Delete '/run/wpa_supplicant/wlan0' manually if it is not used anymore
Apr 26 19:04:44 AERS wpa_supplicant[630]: Failed to initialize control interface '/run/wpa_supplicant'.#012You may have another wpa_supplicant process already running or the file was#012left by an unclean termination of wpa_supplicant in which case you will need#012to manually remove this file before starting wpa_supplicant again.
Apr 26 19:04:44 AERS wpa_supplicant[630]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Apr 26 19:04:44 AERS NetworkManager[635]: <error> [1587899084.6793] sup-iface[0x18e59f0,wlan0]: error adding interface: wpa_supplicant couldn't grab this interface.
Apr 26 19:04:44 AERS NetworkManager[635]: <info>  [1587899084.6796] device (wlan0): supplicant interface state: starting -> down
Apr 26 19:04:53 AERS systemd[1]: systemd-hostnamed.service: Succeeded.
Apr 26 19:04:54 AERS NetworkManager[635]: <warn>  [1587899094.5251] device (wlan0): re-acquiring supplicant interface (#3).
Apr 26 19:04:54 AERS wpa_supplicant[630]: ctrl_iface exists and seems to be in use - cannot override it
Apr 26 19:04:54 AERS wpa_supplicant[630]: Delete '/run/wpa_supplicant/wlan0' manually if it is not used anymore
Apr 26 19:04:54 AERS wpa_supplicant[630]: Failed to initialize control interface '/run/wpa_supplicant'.#012You may have another wpa_supplicant process already running or the file was#012left by an unclean termination of wpa_supplicant in which case you will need#012to manually remove this file before starting wpa_supplicant again.
Apr 26 19:04:54 AERS wpa_supplicant[630]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Apr 26 19:04:54 AERS NetworkManager[635]: <error> [1587899094.6595] sup-iface[0x18e5a60,wlan0]: error adding interface: wpa_supplicant couldn't grab this interface.
Apr 26 19:04:54 AERS NetworkManager[635]: <info>  [1587899094.6599] device (wlan0): supplicant interface state: starting -> down
Apr 26 19:05:04 AERS NetworkManager[635]: <warn>  [1587899104.5292] device (wlan0): re-acquiring supplicant interface (#4).
Apr 26 19:05:04 AERS wpa_supplicant[630]: ctrl_iface exists and seems to be in use - cannot override it
Apr 26 19:05:04 AERS wpa_supplicant[630]: Delete '/run/wpa_supplicant/wlan0' manually if it is not used anymore
Apr 26 19:05:04 AERS wpa_supplicant[630]: Failed to initialize control interface '/run/wpa_supplicant'.#012You may have another wpa_supplicant process already running or the file was#012left by an unclean termination of wpa_supplicant in which case you will need#012to manually remove this file before starting wpa_supplicant again.
Apr 26 19:05:04 AERS wpa_supplicant[630]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Apr 26 19:05:04 AERS NetworkManager[635]: <error> [1587899104.6513] sup-iface[0x18e5ad0,wlan0]: error adding interface: wpa_supplicant couldn't grab this interface.
Apr 26 19:05:04 AERS NetworkManager[635]: <info>  [1587899104.6516] device (wlan0): supplicant interface state: starting -> down
Apr 26 19:05:14 AERS NetworkManager[635]: <warn>  [1587899114.5346] device (wlan0): re-acquiring supplicant interface (#5).
Apr 26 19:05:14 AERS wpa_supplicant[630]: ctrl_iface exists and seems to be in use - cannot override it
Apr 26 19:05:14 AERS wpa_supplicant[630]: Delete '/run/wpa_supplicant/wlan0' manually if it is not used anymore
Apr 26 19:05:14 AERS wpa_supplicant[630]: Failed to initialize control interface '/run/wpa_supplicant'.#012You may have another wpa_supplicant process already running or the file was#012left by an unclean termination of wpa_supplicant in which case you will need#012to manually remove this file before starting wpa_supplicant again.
Apr 26 19:05:14 AERS wpa_supplicant[630]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Apr 26 19:05:14 AERS NetworkManager[635]: <error> [1587899114.6792] sup-iface[0x18e5b40,wlan0]: error adding interface: wpa_supplicant couldn't grab this interface.
Apr 26 19:05:14 AERS NetworkManager[635]: <info>  [1587899114.6796] device (wlan0): supplicant interface state: starting -> down
Apr 26 19:05:14 AERS NetworkManager[635]: <info>  [1587899114.6798] device (wlan0): supplicant interface keeps failing, giving up
Apr 26 19:05:18 AERS CRON[1391]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Apr 26 19:11:22 AERS wpa_supplicant[511]: wlan0: WPA: Group rekeying completed with 04:f0:21:23:23:42 [GTK=TKIP]

 

Posted

so far the only thing I have done are:

 

  • flashing my SDcard
  • Editing the interfaces file in order to connect to my router
  • apt-get update / upgrade / dist-upgrade
  • Editing the hostname file
  • editing the hostapd.conf
  • editing the hostapd file in init.d to specify the hostapd.conf location
  • editing the interfaces file for switching on the APmode (as per first post)
Posted
15 hours ago, tibibs said:
  • flashing my SDcard
  • Editing the interfaces file in order to connect to my router
  • apt-get update / upgrade / dist-upgrade
  • Editing the hostname file
  • editing the hostapd.conf
  • editing the hostapd file in init.d to specify the hostapd.conf location
  • editing the interfaces file for switching on the APmode (as per first post)


If you didn't do anything about Network Manager, all those steps are pointless.

Posted

Hi,

 

I have basically followed the following procedure in the documentation

 

https://docs.armbian.com/User-Guide_Advanced-Features/#how-to-set-wireless-access-point

 

So, from what I understand (I am really new with linux so far, but learning a bit more every day), armbian is booting, and get twice the same service to start so it get in conflict.

 

Is my understanding correct? 

 

I thought the config for the network manager was coming from the interfaces file, so when I specified hostapd on this file, I thought it would detect that it shuld run as AP. But it seems it is not that straight forward. The fact that I detect the SSID for a short period of time let me think I was right.

 

what additional config should i look into?

Posted

I think the documentation might be outdated in this point. Most likely it has been written in ages before NM became default.

tl;dr search google for disabling NetworkManager and go back to ifupdown.

Posted
3 hours ago, tibibs said:

Is my understanding correct? 


Its more complicated than this.

Network manager is our default application for managing the network. We choose it because also "new to Linux" folks is able to operate with it. Its inutive, menu driven, simple. As any networking settings can be ... 

Ifconfig is old, ancient way of setting up networking - you defind interfaces by editing /etc/network/interfaces file and write your config by hand. If you know what you are doing it should be fine. Network manager and ifconfig can work together fine, which is why we leave both. If you define configuration old style, that is the primary one. If not defined, Network manager and its automatic services takes over.

 

For seting up AP we developed an application to make it as easy as possible. But it doesn't operate on this board since it needs network connection at the time you run setup. Our application - even its using hostapd - is disabling network manager functions at tha adaptor. We choose a little bit complicated way of having AP, but its much more resiliant. Also Network manager is able to run AP. Give it a try.

Posted
3 hours ago, Igor said:

Network manager and ifconfig can work together fine

That was true six months ago, but there recent months, that is not true any more :

I'm using "old school" /etc/network/interfaces since years, in the old days, if "old school" was used, NetworkManager simply ignored those devices, but since few months, probably when I switched from Stretch to newer dist, it is still trying to use the devices although defined in /etc/network/interfaces. To make "old school" working again, I've to do specifically "systemctl disable NetworkManager". So, my conclusion is that a bug has been introduced in NetworkManager ...

Posted
2 minutes ago, martinayotte said:

So, my conclusion is that a bug has been introduced in NetworkManager ...

 

Didn't notice but ofc possible ... will pay attention on that. WIth Network manager you never know :) 

Posted
12 minutes ago, Igor said:

WIth Network manager you never know

BTW, since this behaviour was found when I stopped using Stretch and using Buster, I may look at this issue again with Bulleye instead of Buster...

Posted

Hi,

 

Thank's a lot for your help. Indeed, Network Manager seems a lot simpler to use.

 

I have managed to configure my connection so far but I encounter 1 issue at the time of activation. It says that my device is not available which is, I guess, because it is currently active and connected to my local network.

Can you confirm my hypothesis?

 

How could I for example activate a specific connection at boot?

 

I think that after this preparing a script to switch from one connection to another should not be such a big deal but would reauire some research from my part, but at least I would like to manage to set this AP at least once properly.

 

Thank you for your help, this is very helpful and actually really helps to improve its knowledge.

 

G.

 

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines