Jump to content

Access Point not working


peter12

Recommended Posts

Hello, 

on older Orange Pi zero I used nmcli for creating access point or connecting as a client to wifi.

Now I am running Linux orangepizeroplus2 3.4.113-sun8i #4 SMP PREEMPT Wed Nov 22 13:45:28 CET 2017 armv7l  on Orange Pi Zero plus2 h3 but I am not able to create access point with this (it does not work as on older OpiZero, I am using the same commands):

nmcli c add type wifi ifname wlan0 con-name connection-name autoconnect no ssid hotspotssid
nmcli connection modify connection-name 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli connection modify connection-name wifi-sec.key-mgmt wpa-psk
nmcli connection modify connection-name +ipv4.addresses 192.168.2.1/24
nmcli connection modify connection-name wifi-sec.psk "lepassword"
nmcli connection up connection-name

It writes me that "Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)" but I am not able to broadcast access point from other devices (android, pc, etc.). 

 nmcli d shows:
DEVICE  TYPE      STATE      CONNECTION
wlan0   wifi      connected  connection-name

 

What am I doing wrong please?

 

P.S. when I want to connect to home wifi network as a client with "sudo nmcli device wifi connect myssid password pass" it works.

Link to comment
Share on other sites

1 hour ago, peter12 said:

What am I doing wrong please?

 

Older kernel wireless driver (for chip on Opi zero +2) needs to be loaded with op_mode=2 otherwise AP doesn't work.

Link to comment
Share on other sites

23 minutes ago, Igor said:

thanks, I found something like this:
echo 'options dhd op_mode=2' >/etc/modprobe.d/ap6212.conf
rmmod dhd && modprobe dhd

but will I be able to switch to client mode anytime? Or another special treatment is needed for this?

What I want to achieve is that normally wifi will be used in client mode, but from time to time I want to be able to switch it to AP mode (ideally with nmcli as I showed on the start of thread )

 

UPDATE:

I did:

echo 'options dhd op_mode=2' | sudo tee --append /etc/modprobe.d/ap6212.conf
sudo rmmod dhd
sudo modprobe dhd

 

then: 
nmcli c add type wifi ifname wlan0 con-name connection-name autoconnect no ssid hotspotssid
nmcli connection modify connection-name 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli connection modify connection-name wifi-sec.key-mgmt wpa-psk
nmcli connection modify connection-name wifi-sec.psk "lepassword"
nmcli connection up connection-name

but access point did not start to work.

Link to comment
Share on other sites

1 hour ago, peter12 said:

echo 'options dhd op_mode=2' | sudo tee --append /etc/modprobe.d/ap6212.conf
sudo rmmod dhd
sudo modprobe dhd


With reboot you have much better chances. Unloading/loading on this historical kernel 3.4.y ... not sure. This driver is buggy.
 

Did you check if the module name is dhd at all? I don't recall from my head now, but we had: ap6210, ap6211, ap6212 and dhd for different variants of this AP62xx chip. Old kernel, which you are trying to use, is messy in any case. Modern kernel has brcmfmac and no special modes. It should work STA/AP out of the box.

Link to comment
Share on other sites

15 hours ago, Igor said:


Modern kernel has brcmfmac and no special modes. It should work STA/AP out of the box.

Hi, so I tried Opi0 plus2 h3_Debian_stretch_next_4.14.78 and with nmcli I am able to connect as a client. But when I use nmcli to create AP, then I am getting "Error: Connection activation failed." (AP is visilbe for a while but I am not able to connect to it and then it fails with "Error: Connection activation failed.").

Link to comment
Share on other sites

1 hour ago, peter12 said:

Hi, so I tried Opi0 plus2 h3_Debian_stretch_next_4.14.78 and with nmcli I am able to connect as a client. But when I use nmcli to create AP, then I am getting "Error: Connection activation failed." (AP is visilbe for a while but I am not able to connect to it and then it fails with "Error: Connection activation failed.").

 

Upstream Broadcomm drivers could also not be in a perfect condition. You have to ask their maintainers. It could be some known regression/problem. Unrelated to Armbian: https://duckduckgo.com/?q=brcmfmac+ap+mode

 

Edit: you can also try setting AP with hostapd to rule out Network manager problems. For hostapd way you need to tell Network manager not to use this particular wireless device ...

Link to comment
Share on other sites

2 hours ago, Igor said:

Edit: you can also try setting AP with hostapd to rule out Network manager problems. For hostapd way you need to tell Network manager not to use this particular wireless device ...

Could you please post me short sample for this? My idea is to use command line to switch between NetworkManager as client mode and Hostapd as AP mode. Or does exist any tutorial for this combination please? I googled it but I found just hostapd code but not combination. Or maybe if it is easier to use just hostapd for client as well as AP. I want to have AP just for cases, when something went wrong to be able to log in via AP. Many thanks for your help

Link to comment
Share on other sites

24 minutes ago, peter12 said:

Could you please post me short sample for this?


Check here: 

https://github.com/armbian/config

https://github.com/armbian/config/blob/master/debian-config-jobs#L423-L430
 

Our defaults are Network manager and hostapd for AP. I am not very familiar with NM way of setting AP but I think hostapd has more features and is more resilient. We also use our own patched version. We don't use stock Debian/Ubuntu virtually since day one. 


For your use case it is difficult to say. Hostapd is harder to work with, but you have more control. I doubt you need that in case driver is done by the book. First we need to get to the bottom of the problem why it doesn't work. Is it the driver and why, is it Network manager? Trying complementary tools before jumping into the code is usually better ...

Link to comment
Share on other sites

1 hour ago, Igor said:

For your use case it is difficult to say. Hostapd is harder to work with, but you have more control. I doubt you need that in case driver is done by the book. First we need to get to the bottom of the problem why it doesn't work. Is it the driver and why, is it Network manager? Trying complementary tools before jumping into the code is usually better ...

I found https://seravo.fi/2014/create-wireless-access-point-hostapd and https://www.cberner.com/2013/02/03/using-hostapd-on-ubuntu-to-create-a-wifi-access-point/ and now AP works for me. And with some changes I am able to switch to client, too. So this is solved for me for now. But then I wanted to check if camera works and I found out in mainline there are no drivers>
sudo modprobe gc2035
sudo modprobe vfe_v4l2
sudo modprobe v4l2loopback

 

which Armbian version has these drivers please? Now, when wifi is working for me, I want to try another version of armbian with these drivers for my camera. 

Link to comment
Share on other sites

9 minutes ago, peter12 said:

which Armbian version has these drivers please? Now, when wifi is working for me, I want to try another version of armbian with these drivers for my camera. 


Camera problems are off topic, outside technical support - "on board hardware only" and outside my focus.  Use search 1st.

Link to comment
Share on other sites

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

Important Information

Terms of Use - Privacy Policy - Guidelines