0
rednoka

Creating access point on Orange Pi Zero Plus 2

Recommended Posts

(edited)
Armbianmonitor:

I am not experienced on the Linux networking so please tolerate my ignorance.

 

1.) I am trying to create an wireless access point on "Orange Pi Zero Plus 2 H3" board. And I fail...

2.) I am using Armbian image: Armbian_5.76_Orangepizeroplus2-h3_Ubuntu_xenial_next_4.19.21.img

3.) I am using nmcli for this purpose:

https://gist.github.com/narate/d3f001c97e1c981a59f94cd76f041140

nmcli con add type wifi ifname wlan0 con-name MyAccessPoint autoconnect yes ssid MyAccessPoint
nmcli con modify MyAccessPoint 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify MyAccessPoint wifi-sec.key-mgmt wpa-psk
nmcli con modify MyAccessPoint wifi-sec.psk "1234567890"
nmcli con up MyAccessPoint

4.) When I look at the syslog it fails like:

May 22 08:24:52 localhost NetworkManager[738]: <info>  [1558513492.3757] Config: added 'key_mgmt' value 'WPA-PSK'
May 22 08:24:52 localhost NetworkManager[738]: <info>  [1558513492.3758] Config: added 'psk' value '<omitted>'
May 22 08:24:52 localhost NetworkManager[738]: <info>  [1558513492.3794] sup-iface[0x2dd8d8,wlan0]: config: set interface ap_scan to 2
May 22 08:24:53 localhost wpa_supplicant[1099]: wlan0: Failed to start AP functionality
May 22 08:24:53 localhost NetworkManager[738]: <info>  [1558513493.4425] device (wlan0): supplicant interface state: inactive -> disconnected

5.) Failed to start AP functionality message is coming from ap.c in wpa_supplicant code:
 

if ( wpa_drv_associate(wpa_s, &params) < 0) {

    wpa_msg(wpa_s, MSG_INFO, "Failed to start AP functionality");

    return -1;

}

It seems the wpa_supplicant cannot match requested parameters with a wifi driver.

6.) I have read:

 

 

 

7.) When I do:
 

echo 'options dhd op_mode=2' >/etc/modprobe.d/ap6212.conf

rmmod dhd && modprobe dhd

modeprobe complains:

modprobe: FATAL: Module dhd not found in directory /lib/modules/4.19.21-sunxi

 

8. Lastly; What is "dhd module"? How can I enable it? How can I create a wireless access point?

 

Regards...

Edited by rednoka

Share this post


Link to post
Share on other sites

Thanx Igor... I will try your suggestion today...

 

By the way, I researched more... Just for general knowledge for interested; wireless chip on Orange Pi Zero Plus 2 is AP6212 and it's kernel module on the mainline kernel is brcmfmac. The other module, dhd,  is used on the sunxi-3.4 legacy kernel.

For anybody interested: http://linux-sunxi.org/Wifi

 

Another thing (to my surprise) nmcli worked on Raspberry Pi without needing any change...

Share this post


Link to post
Share on other sites
11 minutes ago, rednoka said:

Thanx Igor... I will try your suggestion today...

 

By the way, I researched more... Just for general knowledge for interested; wireless chip on Orange Pi Zero Plus 2 is AP6212 and it's kernel module on the mainline kernel is brcmfmac. The other module, dhd,  is used on the sunxi-3.4 legacy kernel.

For anybody interested: http://linux-sunxi.org/Wifi

 

Another thing (to my surprise) nmcli worked on Raspberry Pi without needing any change...


Each kernel has its own version of the driver. Some needs special handling for AP mode and on some its (temporally?) broken. RPi is different hardware, has different kernel but by coincidence similar chip. One can not conclude anything from this mess.

 

22 hours ago, rednoka said:

I am not experienced on the Linux networking so please tolerate my ignorance.

 

That's why I provide you safest option.

In general, be (very) skeptical what you read around on the internet. Do some testings, read, test more, ...


 

Share this post


Link to post
Share on other sites

Dear Igor,

I tried to use armbian-config (as your link suggested) to create a Hotspot but it fails... I will try to capture the failures...

But even it works, it doesn't solve my problem. What I want is to be able to create and destroy wireless access point programmatically and only on certain conditions.

 

 

Share this post


Link to post
Share on other sites
(edited)
21 minutes ago, rednoka said:

Another thing (to my surprise) nmcli worked on Raspberry Pi without needing any change...


Troubles means it can works under certain conditions, but sometimes or mostly not.

 

4 minutes ago, rednoka said:

Dear Igor,

I tried to use armbian-config (as your link suggested) to create a Hotspot but it fails... I will try to capture the failures...

But even it works, it doesn't solve my problem. What I want is to be able to create and destroy wireless access point programmatically and only on certain conditions.


Aha. I see now what is the problem. You need to have active internet connection to setup AP. If your only adaptor is already connected, you can not add AP to id. That is not supported in this driver/chip version. And if it would, performance would sucks.

Edited by Igor
adding "not"

Share this post


Link to post
Share on other sites

Dear Igor,

 

I will try to establish an access point using hostapd directly instead of nmcli. I will also look at the armbian-config code. I will post the progress and maybe ask more. Thanx your prompt responses.

Share this post


Link to post
Share on other sites

Dear Igor,

 

Quote

Aha. I see now what is the problem. You need to have active internet connection to setup AP. If your only adaptor is already connected, you can not add AP to id. That is not supported in this driver/chip version. And if it would, performance would sucks.

 

This, "you need to have an active internet connection to setup AP" confused me a bit... I don't want to "share" the internet from another channel (another wifi or GPRS/3G) from my device... Basically my Orange Pi device will sit on a long pole and will  create a WiFi access point at a definite time (between 23:00 and 24:00 for example) and my sensors will join the WiFi network Orange Pi created and send their data to Orange Pi. And at another certain time (for example every Sunday between 13:00 and 16:00) a mobile device with WiFi will come to collect data from Orange Pi. This time Orange Pi will join the mobile device's WiFi. For all this, only one WiFi adaptor should suffice without any internet connection.

Share this post


Link to post
Share on other sites

Dear Igor,

 

I have succeeded to create a standalone access point. The problem is coming from TKIP (Temporal Key Integrity Protocol) used in WPA. I think one of the ciphering algorithms needed by TKIP is not installed in the kernel, it may be arc4. Are we setting CONFIG_CRYPTO_ARC4=y while building kernel? I used another protocol then TKIP in hostapd config and now I am OK.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
0