Jump to content

Banana-pi m64 and access point


domoticity

Recommended Posts

Hy Everybody. 

For my Work, I need an Access Point into the Bananapi M64. 

So I have followed this tutorial:

 

https://www.awasu.com/weblog/bpi-gateway/wifi-access-point/

 

And more precisely:

 

First, install the packages needed to compile:

sudo apt-get install gcc git make

sudo apt-get install libnl-3-dev libnl-genl-3-dev openssl libssl-dev pkg-config

Then, get the source for hostapd:

cd /tmp

git clone git://w1.fi/srv/git/hostap.git

Then, configure it:

cd hostap/hostapd

cp defconfig .config

Edit .config and make sure that CONFIG_DRIVER_NL80211=y and CONFIG_LIBNL32=y are active i.e. not commented out.

Then, compile and install it:

make

sudo cp hostapd /usr/sbin/

 

My  /etc/hostapd/hostapd.conf: 

 

interface=wlan0

ssid=testPiAP

hw_mode=g

channel=11

macaddr_acl=0

auth_algs=1

ignore_broadcast_ssid=0

wpa=2

wpa_passphrase=badpassword

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP

Copy the Code

 

When I launch Hostapd I have :

 

pi@bpi-iot-ros-ai:~$ sudo hostapd -B /etc/hostapd/hostapd.conf

Configuration file: /etc/hostapd/hostapd.conf

Using interface wlan0 with hwaddr 44:2c:05:ee:81:21 and ssid "testPiAP"

wlan0: interface state UNINITIALIZED->ENABLED

wlan0: AP-ENABLED

 

But I don't see my access point wifi with my smartphone, laptop or another devices. 

 

Here my ifconfig and I can scan wifi network :

 

[sudo] password for pi:

eth0      Link encap:Ethernet  HWaddr aa:c2:4f:16:ee:b8

          inet addr:192.168.1.48  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:272 errors:0 dropped:0 overruns:0 frame:0

          TX packets:99 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:23758 (23.2 KiB)  TX bytes:13132 (12.8 KiB)

          Interrupt:114

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:25 errors:0 dropped:0 overruns:0 frame:0

          TX packets:25 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:2728 (2.6 KiB)  TX bytes:2728 (2.6 KiB)

 

wlan0     Link encap:Ethernet  HWaddr 44:2c:05:ee:81:21

          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0

          inet6 addr: fe80::462c:5ff:feee:8121/64 Scope:Link

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:2232 (2.1 KiB

 

I don't manage to see where I am wrong and it's been two Weeks I tried to find a solution. Help me please :)

Link to comment
Share on other sites

7 hours ago, domoticity said:

Bananapi M64

AP6212 or AP6212A so you need to instruct the driver to switch between normal and AP mode as Igor explained. You should be able to use any of the countless scripts around to deal with these Ampak modules (eg from FriendlyELEC or armbian-config)

Link to comment
Share on other sites

10 minutes ago, domoticity said:

but always same thing : my ap wifi stays no visible.


:( No other ideas. I knew that this mode switching was a problem on those AMPAK chips but unfortunately we don't deal with Banana M64. Wifi drivers could be simply broken ...  while mainline support with a different/better driver is not ready yet. I made an image yesterday , out of curiosity to see how far things are, but there is no USB nor WiFi. Most likely "only" DT bits are missing, while WiFi is supported via a general broadcomm-brcfmac driver.  Wens is doing something on those Bananas, check here. If you have some knowledge or a lot of time, better try to make mainline linux working on this board.

Link to comment
Share on other sites

21 minutes ago, Igor said:


:( No other ideas. I knew that this mode switching was a problem on those AMPAK chips but unfortunately we don't deal with Banana M64. Wifi drivers could be simply broken ...  while mainline support with a different/better driver is not ready yet. I made an image yesterday , out of curiosity to see how far things are, but there is no USB nor WiFi. Most likely "only" DT bits are missing, while WiFi is supported via a general broadcomm-brcfmac driver.  Wens is doing something on those Bananas, check here. If you have some knowledge or a lot of time, better try to make mainline linux working on this board.

Thanks anyway for your help :) what banana-pi would you advise me? The m2 or m2 +?Or another.  I just need a WiFi chip and an ethernet Gigabit port and make access point.

Link to comment
Share on other sites

33 minutes ago, domoticity said:

I just need a WiFi chip and an ethernet Gigabit port and make access point.


Get any Armbian supported board which can run the mainline kernel (4.13+) and get 8812au based USB adaptor. Those have currently the best speed/price ratio. It can run 2.4 or 5Ghz AP. I am waiting to test some smaller versions 8811au but they are not at my location yet.

 

Latest Armbian comes with a utility which autodetects the best mode for your Wifi chip, but low-level support, a good working driver must exist. This wifi autodetect will run properly only on Armbian.

 

I did some testings :) 

 

Link to comment
Share on other sites

49 minutes ago, domoticity said:

what banana-pi would you advise me?

 

Except of the two R boards all Bananas use the same AP6212/AP6212A which can be considered ultra low end especially for an AP.

 

I second Igor's suggestion but recommend to read it closely and again: a board that will run mainline kernel or at least 4.9LTS with the 8812AU driver included is important (just noting since it seems your last buying decision was a bit precipitously -- if you would've done some research before you would've been warned wrt horrible vendor software support for some of the SBC brands out there, eg. Orange and Banana Pis most probably being the worst)

Link to comment
Share on other sites

4 hours ago, tkaiser said:

 

Except of the two R boards all Bananas use the same AP6212/AP6212A which can be considered ultra low end especially for an AP.

 

I second Igor's suggestion but recommend to read it closely and again: a board that will run mainline kernel or at least 4.9LTS with the 8812AU driver included is important (just noting since it seems your last buying decision was a bit precipitously -- if you would've done some research before you would've been warned wrt horrible vendor software support for some of the SBC brands out there, eg. Orange and Banana Pis most probably being the worst)

Hy :)

I haven't bought the Bananapi M64, it's my Employer. I will take another card with all your Recommendations. 

Thank you again

Link to comment
Share on other sites

6 hours ago, Igor said:


Get any Armbian supported board which can run the mainline kernel (4.13+) and get 8812au based USB adaptor. Those have currently the best speed/price ratio. It can run 2.4 or 5Ghz AP. I am waiting to test some smaller versions 8811au but they are not at my location yet.

 

Latest Armbian comes with a utility which autodetects the best mode for your Wifi chip, but low-level support, a good working driver must exist. This wifi autodetect will run properly only on Armbian.

 

I did some testings :) 

 

I just ordered a banana-pi m1, which can have mainline kernel. And I will take the usb wifi Adaptateur you suggest me. 

I have managed to do an Access Point and a lot of things with my raspberry 2 but it doesn't have Gigabit ethernet. Shame on her lol. 

Link to comment
Share on other sites

29 minutes ago, domoticity said:

I just ordered a banana-pi m1

Maybe still the best Banana variant to order... but now you might run into this https://forum.armbian.com/index.php?/announcement/1-1-check-power-supply-check-sd-card-and-check-other-people-experiences/ (BPi M1 has for whatever stupid reasons a Micro USB connector for DC-IN, combine this with a powerful Wi-Fi adapter on the USB port and maybe you just run into the next drama).

 

The good news: You can check for undervoltage situations at least if you use Armbian based mainline kernel images since we're the only ones including patches to read out voltage/current with mainline kernel so you can then check for underpowering as explained here: http://linux-sunxi.org/Lamobo_R1#Powering_the_board (you can use the same sysfs nodes and if you choose a wrong cable to power the board it will look like it's graphed here)

Link to comment
Share on other sites

48 minutes ago, tkaiser said:

Maybe still the best Banana variant to order... but now you might run into this https://forum.armbian.com/index.php?/announcement/1-1-check-power-supply-check-sd-card-and-check-other-people-experiences/ (BPi M1 has for whatever stupid reasons a Micro USB connector for DC-IN, combine this with a powerful Wi-Fi adapter on the USB port and maybe you just run into the next drama).

 

The good news: You can check for undervoltage situations at least if you use Armbian based mainline kernel images since we're the only ones including patches to read out voltage/current with mainline kernel so you can then check for underpowering as explained here: http://linux-sunxi.org/Lamobo_R1#Powering_the_board (you can use the same sysfs nodes and if you choose a wrong cable to power the board it will look like it's graphed here)

I wll tell you if it makes my happiness the Bananpi m1 lol. But she seems to be better than the m64, even if this last one seems to be powerfull. I will keep it for a Domotic box :P

Link to comment
Share on other sites

On 04/10/2017 at 2:16 PM, Igor said:


Get any Armbian supported board which can run the mainline kernel (4.13+) and get 8812au based USB adaptor. Those have currently the best speed/price ratio. It can run 2.4 or 5Ghz AP. I am waiting to test some smaller versions 8811au but they are not at my location yet.

 

Latest Armbian comes with a utility which autodetects the best mode for your Wifi chip, but low-level support, a good working driver must exist. This wifi autodetect will run properly only on Armbian.

 

I did some testings :) 

 

Hy me again :P

So i have my Bananapi m1 and i have someone who give me an wifi adaptator : Edimax ew-7811un.

He said me it's a 8812au.

But when i do a lsmod i don't see 8812au but RTL 8192CU.

I have seen in Internet that's i can complied Driver 8812au for this Adaptator,but it's for Raspberry.

Can you help me for my Bananapi :):):)

I know that you have given me a model of adaptator,but a nano adaptator is better for my Project :)

If i don't have the choice,i will take it.

armbian-config is very nice and helpfull.

Link to comment
Share on other sites

On 04/10/2017 at 2:16 PM, Igor said:


Get any Armbian supported board which can run the mainline kernel (4.13+) and get 8812au based USB adaptor. Those have currently the best speed/price ratio. It can run 2.4 or 5Ghz AP. I am waiting to test some smaller versions 8811au but they are not at my location yet.

 

Latest Armbian comes with a utility which autodetects the best mode for your Wifi chip, but low-level support, a good working driver must exist. This wifi autodetect will run properly only on Armbian.

 

I did some testings :) 

 

Hy, i have a Notification which tell me you have aswered but i don't Manage to See your Post:(

Capture.PNG

Link to comment
Share on other sites

On 07/10/2017 at 8:28 PM, Igor said:

I delete it after replaying since I was not reading carefully. Nothing to add to what I already wrote.

Hy,

I have found the Solution.

Tested with a Banana pi m64 and the m2 Berry ( with AP6212 and driver BCMDHD).

 

First : For HOSTAPD .

If you are in Ubuntu, just do a apt-get install hostapd

If you are in Debian, use the Second Method of this Link.

 

Then, make the hostapd.conf

 

An Example :

interface=uap0
ssid=testPiAP
hw_mode=g
channel=11
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=badpassword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

 

 

 

AP MODE : the msot important :)

sudo nano /etc/modprobe.d/bcmdhd.conf.

and write 

options bcmdhd op_mode=2

Reboot the Card.

 

To see if the AP mode is ok :

systool -m bcmdhd -v

If you haven't the Systool 

 

sudo apt-get install sysfsutils

And to launch hostapd

sudo hostapd /etc/hostapd/hostapd.conf

 

I hope i was understandable with my Bad English :)

Quote

 

 

Link to comment
Share on other sites

i have some problem

use Banana-pi m64

OS:BPI-M64 new image:2017-08-14-ubuntu-16.04-mate-desktop-beta-aarch64-bpi-m64-sd-emmc 

how to set hostapd.service autorun at startup???

 

 

1. initial status

pi@bpi-iot-ros-ai:~$ sudo systemctl status hostapd.service
[sudo] password for pi: 
● hostapd.service - LSB: Advanced IEEE 802.11 management daemon
   Loaded: loaded (/etc/init.d/hostapd; bad; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:systemd-sysv-generator(8)

2. start hostapd.service ,  it's "Active:active (running)" , WIFI AP is connectable

pi@bpi-iot-ros-ai:~$ sudo systemctl start hostapd.service

pi@bpi-iot-ros-ai:~$ sudo systemctl status hostapd.service
● hostapd.service - LSB: Advanced IEEE 802.11 management daemon
   Loaded: loaded (/etc/init.d/hostapd; bad; vendor preset: enabled)
   Active: active (running) since Thu 2018-01-25 22:23:21 CST; 8s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 984 ExecStart=/etc/init.d/hostapd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/hostapd.service
           └─989 /usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf

Jan 25 22:23:21 bpi-iot-ros-ai systemd[1]: Starting LSB: Advanced IEEE 802.11 management daemon...
Jan 25 22:23:21 bpi-iot-ros-ai hostapd[984]:  * Starting advanced IEEE 802.11 management hostapd
Jan 25 22:23:21 bpi-iot-ros-ai hostapd[984]:    ...done.
Jan 25 22:23:21 bpi-iot-ros-ai systemd[1]: Started LSB: Advanced IEEE 802.11 management daemon.

 

3. stop hostapd.service ,  use the command「sudo hostapd -B /etc/hostapd/hostapd.conf」, WIFI AP is connectable too

pi@bpi-iot-ros-ai:~$ sudo systemctl stop hostapd.service

pi@bpi-iot-ros-ai:~$ sudo hostapd -B /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE

 

4. set hostapd.serice to enable, and reboot

pi@bpi-iot-ros-ai:~$ sudo systemctl enable hostapd.service
hostapd.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install enable hostapd
insserv: warning: current start runlevel(s) (empty) of script `hostapd' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `hostapd' overrides LSB defaults (0 1 6).
pi@bpi-iot-ros-ai:~$ sudo reboot
Connection closing...Socket close.
Connection closed by foreign host.
Disconnected from remote host(bpi-iot-ros-ai.local) at 22:31:56.

 

5. After reboot...WIFI AP no signal , check hostapd.service status have fail

pi@bpi-iot-ros-ai:~$ sudo systemctl status hostapd.service
[sudo] password for pi: 
● hostapd.service - LSB: Advanced IEEE 802.11 management daemon
   Loaded: loaded (/etc/init.d/hostapd; bad; vendor preset: enabled)
   Active: active (exited) since Thu 2018-01-25 22:32:18 CST; 1min 18s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 633 ExecStart=/etc/init.d/hostapd start (code=exited, status=0/SUCCESS)

Jan 25 22:32:17 bpi-iot-ros-ai systemd[1]: Starting LSB: Advanced IEEE 802.11 management daemon...
Jan 25 22:32:17 bpi-iot-ros-ai hostapd[633]:  * Starting advanced IEEE 802.11 management hostapd
Jan 25 22:32:18 bpi-iot-ros-ai hostapd[633]:    ...fail!
Jan 25 22:32:18 bpi-iot-ros-ai systemd[1]: Started LSB: Advanced IEEE 802.11 management daemon.

 

6. then restart hostapd.service, wifi ap can be connect

pi@bpi-iot-ros-ai:~$ sudo systemctl restart hostapd.service
pi@bpi-iot-ros-ai:~$ sudo systemctl status hostapd.service
● hostapd.service - LSB: Advanced IEEE 802.11 management daemon
   Loaded: loaded (/etc/init.d/hostapd; bad; vendor preset: enabled)
   Active: active (running) since Thu 2018-01-25 22:33:49 CST; 2s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1004 ExecStop=/etc/init.d/hostapd stop (code=exited, status=0/SUCCESS)
  Process: 1011 ExecStart=/etc/init.d/hostapd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/hostapd.service
           └─1016 /usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf

Jan 25 22:33:49 bpi-iot-ros-ai systemd[1]: Starting LSB: Advanced IEEE 802.11 management daemon...
Jan 25 22:33:49 bpi-iot-ros-ai hostapd[1011]:  * Starting advanced IEEE 802.11 management hostapd
Jan 25 22:33:49 bpi-iot-ros-ai hostapd[1011]:    ...done.
Jan 25 22:33:49 bpi-iot-ros-ai systemd[1]: Started LSB: Advanced IEEE 802.11 management daemon.
pi@bpi-iot-ros-ai:~$ 

 

Edited by Allen Chen
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