saugat10
Posts: 11
Joined: Wed Nov 23, 2022 9:55 am
Location: Copenhagen, Denmark

Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Wed Jan 18, 2023 9:29 am

Hello,
I followed the configuration from https://www.raspberrypi.com/documentati ... cess-point to make my raspberry pi an access point with the topic "Setting up a Routed Wireless Access Point".
After completing the setup and rebooting my raspberry pi I get an error "Failed to start Access point server for wifi and ethernet.
When i see the details using command " systemctl status hostapd.service" i see the following error

Code: Select all

● hostapd.service - Access point and authentication server for Wi-Fi and Ethernet
     Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Wed 2023-01-18 09:24:50 GMT; 1s ago
       Docs: man:hostapd(8)
    Process: 800 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=1/FAILURE)
        CPU: 39ms
When i try to run this line in terminal " ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B /etc/hostapd/hostapd.conf"
it gives me the following error

Code: Select all

-bash: -B: command not found
This is the output of "uname -a"

Code: Select all

Linux raspberrypi 5.15.88-v7+ #1617 SMP Mon Jan 16 15:29:29 GMT 2023 armv7l GNU/Linux
Am i missing something during my configuration?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4931
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Wed Jan 18, 2023 9:38 am

To try the rule on the command line you need to drop the ExecStart= and run it with sudo:

Code: Select all

sudo /usr/sbin/hostapd -B -P /run/hostapd.pid -B /etc/hostapd/hostapd.conf

saugat10
Posts: 11
Joined: Wed Nov 23, 2022 9:55 am
Location: Copenhagen, Denmark

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Wed Jan 18, 2023 10:27 am

This is the output.

Code: Select all

Configuration file: /etc/hostapd/hostapd.conf
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211 driver initialization failed.
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED
wlan0: CTRL-EVENT-TERMINATING
hostapd_free_hapd_data: Interface wlan0 wasn't started
This is the output of my iwconfig

Code: Select all

lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     unassociated  ESSID:""  Nickname:"<WIFI@REALTEK>"
          Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=0/100  Signal level=0 dBm  Noise level=0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

MiscBits
Posts: 1406
Joined: Wed Jan 27, 2021 12:48 pm

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Wed Jan 18, 2023 4:50 pm

Does the adapter support AP mode?

Not all WiFi adapters do...

User avatar
dickon
Posts: 2367
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, in Tiffield

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Wed Jan 18, 2023 5:08 pm

Code: Select all

iw phy | grep AP
will tell you.

You may need to install the 'iw' package.
As it is apparently board policy to disallow any criticism of anything, as it appears to criticise something is to criticise all the users of that something, I will no longer be commenting in threads which are not directly relevant to my uses of the Pi.

saugat10
Posts: 11
Joined: Wed Nov 23, 2022 9:55 am
Location: Copenhagen, Denmark

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Wed Jan 25, 2023 7:37 am

The driver that is needed for this WIFI adapter cannot be installed in raspberry pi 2 model B. The required driver for this adapter is is rtl8812au.

User avatar
dickon
Posts: 2367
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, in Tiffield

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Wed Jan 25, 2023 8:47 am

saugat10 wrote:
Wed Jan 25, 2023 7:37 am
The driver that is needed for this WIFI adapter cannot be installed in raspberry pi 2 model B. The required driver for this adapter is is rtl8812au.
Fairly sure I've had that working perfectly well on a Pi. Needs an out-of-tree driver, but that isn't too difficult these days.
As it is apparently board policy to disallow any criticism of anything, as it appears to criticise something is to criticise all the users of that something, I will no longer be commenting in threads which are not directly relevant to my uses of the Pi.

saugat10
Posts: 11
Joined: Wed Nov 23, 2022 9:55 am
Location: Copenhagen, Denmark

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Thu Jan 26, 2023 7:12 am

dickon wrote:
Wed Jan 25, 2023 8:47 am
saugat10 wrote:
Wed Jan 25, 2023 7:37 am
The driver that is needed for this WIFI adapter cannot be installed in raspberry pi 2 model B. The required driver for this adapter is is rtl8812au.
Fairly sure I've had that working perfectly well on a Pi. Needs an out-of-tree driver, but that isn't too difficult these days.
I was able to use Edimax n 150 wifi adapter in PI4 for making it an access point but not in PI2

User avatar
dickon
Posts: 2367
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, in Tiffield

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Thu Jan 26, 2023 8:22 am

saugat10 wrote:
Thu Jan 26, 2023 7:12 am
dickon wrote:
Wed Jan 25, 2023 8:47 am
Fairly sure I've had that working perfectly well on a Pi. Needs an out-of-tree driver, but that isn't too difficult these days.
I was able to use Edimax n 150 wifi adapter in PI4 for making it an access point but not in PI2
Hmm. I'll have to try this.
As it is apparently board policy to disallow any criticism of anything, as it appears to criticise something is to criticise all the users of that something, I will no longer be commenting in threads which are not directly relevant to my uses of the Pi.

saugat10
Posts: 11
Joined: Wed Nov 23, 2022 9:55 am
Location: Copenhagen, Denmark

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Mon Jan 30, 2023 8:38 am

dickon wrote:
Thu Jan 26, 2023 8:22 am
saugat10 wrote:
Thu Jan 26, 2023 7:12 am
dickon wrote:
Wed Jan 25, 2023 8:47 am
Fairly sure I've had that working perfectly well on a Pi. Needs an out-of-tree driver, but that isn't too difficult these days.
I was able to use Edimax n 150 wifi adapter in PI4 for making it an access point but not in PI2
Hmm. I'll have to try this.
Did you have a try?

User avatar
dickon
Posts: 2367
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, in Tiffield

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Mon Jan 30, 2023 9:22 am

saugat10 wrote:
Mon Jan 30, 2023 8:38 am
dickon wrote:
Thu Jan 26, 2023 8:22 am
saugat10 wrote:
Thu Jan 26, 2023 7:12 am
I was able to use Edimax n 150 wifi adapter in PI4 for making it an access point but not in PI2
Hmm. I'll have to try this.
Did you have a try?
I haven't had a chance, I'm afraid. Busy weekend.
As it is apparently board policy to disallow any criticism of anything, as it appears to criticise something is to criticise all the users of that something, I will no longer be commenting in threads which are not directly relevant to my uses of the Pi.

saugat10
Posts: 11
Joined: Wed Nov 23, 2022 9:55 am
Location: Copenhagen, Denmark

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Mon Jan 30, 2023 11:16 am

dickon wrote:
Mon Jan 30, 2023 9:22 am
saugat10 wrote:
Mon Jan 30, 2023 8:38 am
dickon wrote:
Thu Jan 26, 2023 8:22 am


Hmm. I'll have to try this.
Did you have a try?
I haven't had a chance, I'm afraid. Busy weekend.
Fair enough. Let me know if you find something.

User avatar
dickon
Posts: 2367
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, in Tiffield

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Mon Jan 30, 2023 4:59 pm

saugat10 wrote:
Mon Jan 30, 2023 11:16 am
dickon wrote:
Mon Jan 30, 2023 9:22 am
saugat10 wrote:
Mon Jan 30, 2023 8:38 am
Did you have a try?
I haven't had a chance, I'm afraid. Busy weekend.
Fair enough. Let me know if you find something.
Ah. The dongle I thought was an 8812au is actually an 8188ee. Apologies.

I still can't see why it would work on a 4, but not a 2 -- there's nothing inherently different about a 2 that would break AP mode (and AP mode only) -- did you have the same driver, kernel, and firmware versions installed?
As it is apparently board policy to disallow any criticism of anything, as it appears to criticise something is to criticise all the users of that something, I will no longer be commenting in threads which are not directly relevant to my uses of the Pi.

saugat10
Posts: 11
Joined: Wed Nov 23, 2022 9:55 am
Location: Copenhagen, Denmark

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Wed Feb 01, 2023 12:09 pm

dickon wrote:
Mon Jan 30, 2023 4:59 pm
saugat10 wrote:
Mon Jan 30, 2023 11:16 am
dickon wrote:
Mon Jan 30, 2023 9:22 am

I haven't had a chance, I'm afraid. Busy weekend.
Fair enough. Let me know if you find something.
Ah. The dongle I thought was an 8812au is actually an 8188ee. Apologies.

I still can't see why it would work on a 4, but not a 2 -- there's nothing inherently different about a 2 that would break AP mode (and AP mode only) -- did you have the same driver, kernel, and firmware versions installed?

Code: Select all

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 5.15.84-v7+ #1613 SMP Thu Jan 5 11:59:48 GMT 2023 armv7l GNU/Linux

Code: Select all

pi@raspberrypi:~ $ lsmod
Module                  Size  Used by
8188eu                798720  0

Code: Select all

pi@raspberrypi:~ $ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     unassociated  ESSID:""  Nickname:"<WIFI@REALTEK>"
          Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=0/100  Signal level=0 dBm  Noise level=0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Code: Select all

pi@raspberrypi:~ $ iw list
pi@raspberrypi:~ $
I installed 8188eu driver in my pi2 but i cannot see any output of iw list
In pi4 there was no need to install the driver.

User avatar
dickon
Posts: 2367
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, in Tiffield

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Wed Feb 01, 2023 1:11 pm

That isn't the right driver for that chip, I believe. Try the one at https://github.com/aircrack-ng/rtl8812au -- I seem to have that tree around on my router, so presumably I did have a device that used it. I'll see if I can find it; it'll've been two house-moves ago, though, so I may not.

[Edit:]
Found it, conveniently plugged into the front of the router. It's showing up as an 8811au, with AP capability, but it's using the 8812au Aircrack-ng driver. A second device I've managed to locate I think is missing the firmware, but a quick google for its USB IDs suggests it should also work.
[/Edit]
As it is apparently board policy to disallow any criticism of anything, as it appears to criticise something is to criticise all the users of that something, I will no longer be commenting in threads which are not directly relevant to my uses of the Pi.

saugat10
Posts: 11
Joined: Wed Nov 23, 2022 9:55 am
Location: Copenhagen, Denmark

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Mon Feb 06, 2023 10:48 am

dickon wrote:
Wed Feb 01, 2023 1:11 pm
That isn't the right driver for that chip, I believe. Try the one at https://github.com/aircrack-ng/rtl8812au -- I seem to have that tree around on my router, so presumably I did have a device that used it. I'll see if I can find it; it'll've been two house-moves ago, though, so I may not.

[Edit:]
Found it, conveniently plugged into the front of the router. It's showing up as an 8811au, with AP capability, but it's using the 8812au Aircrack-ng driver. A second device I've managed to locate I think is missing the firmware, but a quick google for its USB IDs suggests it should also work.
[/Edit]

Code: Select all

pi@raspberrypi:~/rtl8812au $ sudo make install
install -p -m 644 88XXau.ko  /lib/modules/5.15.84-v7+/kernel/drivers/net/wireless/
/sbin/depmod -a 5.15.84-v7+

pi@raspberrypi:~/rtl8812au $ lsmod
Module                  Size  Used by
sha256_generic         16384  0
cfg80211              765952  0
rfkill                 32768  2 cfg80211
8021q                  32768  0
garp                   16384  1 8021q
stp                    16384  1 garp
llc                    16384  2 garp,stp
nft_counter            16384  1
nft_chain_nat          16384  4
xt_MASQUERADE          16384  1
nf_nat                 49152  2 xt_MASQUERADE,nft_chain_nat
nf_conntrack          126976  2 xt_MASQUERADE,nf_nat
nf_defrag_ipv6         20480  1 nf_conntrack
nf_defrag_ipv4         16384  1 nf_conntrack
nft_compat             20480  1
nf_tables             217088  5 nft_compat,nft_chain_nat,nft_counter
vc4                   290816  2
nfnetlink              20480  2 nft_compat,nf_tables
8188eu                798720  0
snd_soc_hdmi_codec     20480  1
cec                    49152  1 vc4
drm_kms_helper        274432  2 vc4
snd_soc_core          233472  2 vc4,snd_soc_hdmi_codec
snd_compress           20480  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_bcm2835            24576  0
snd_pcm               114688  5 snd_compress,snd_pcm_dmaengine,snd_soc_hdmi_codec,snd_bcm2835,snd_soc_core
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
raspberrypi_hwmon      16384  0
bcm2835_isp            32768  0
snd_timer              32768  1 snd_pcm
bcm2835_codec          45056  0
i2c_bcm2835            16384  0
v4l2_mem2mem           36864  1 bcm2835_codec
videobuf2_dma_contig    20480  2 bcm2835_isp,bcm2835_codec
bcm2835_v4l2           45056  0
snd                    86016  6 snd_compress,snd_soc_hdmi_codec,snd_timer,snd_bcm2835,snd_soc_core,snd_pcm
bcm2835_mmal_vchiq     32768  3 bcm2835_isp,bcm2835_codec,bcm2835_v4l2
videobuf2_vmalloc      16384  1 bcm2835_v4l2
videobuf2_memops       16384  2 videobuf2_dma_contig,videobuf2_vmalloc
videobuf2_v4l2         32768  4 bcm2835_isp,bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem
videobuf2_common       65536  8 bcm2835_isp,bcm2835_codec,videobuf2_dma_contig,videobuf2_vmalloc,videobuf2_memops,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
videodev              245760  6 bcm2835_isp,bcm2835_codec,videobuf2_common,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
vc_sm_cma              32768  2 bcm2835_isp,bcm2835_mmal_vchiq
mc                     45056  6 bcm2835_isp,bcm2835_codec,videobuf2_common,videodev,v4l2_mem2mem,videobuf2_v4l2
uio_pdrv_genirq        16384  0
uio                    20480  1 uio_pdrv_genirq
fixed                  16384  0
drm                   540672  3 vc4,drm_kms_helper
fuse                  131072  1
drm_panel_orientation_quirks    16384  1 drm
backlight              20480  2 drm_kms_helper,drm
ip_tables              28672  0
x_tables               32768  3 ip_tables,nft_compat,xt_MASQUERADE
ipv6                  524288  28
i installed the driver but it does not show up in lsmod output

User avatar
dickon
Posts: 2367
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, in Tiffield

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Mon Feb 06, 2023 6:56 pm

You'll need to

Code: Select all

modprobe 88XXau
as it won't load it just because you've installed it. Or reboot.
As it is apparently board policy to disallow any criticism of anything, as it appears to criticise something is to criticise all the users of that something, I will no longer be commenting in threads which are not directly relevant to my uses of the Pi.

saugat10
Posts: 11
Joined: Wed Nov 23, 2022 9:55 am
Location: Copenhagen, Denmark

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Tue Feb 07, 2023 8:26 am

dickon wrote:
Mon Feb 06, 2023 6:56 pm
You'll need to

Code: Select all

modprobe 88XXau
as it won't load it just because you've installed it. Or reboot.

Code: Select all

pi@raspberrypi:~ $ lsmod
Module                  Size  Used by
r8188eu               598016  0
88XXau               2007040  0
8021q                  32768  0
garp                   16384  1 8021q

Code: Select all

pi@raspberrypi:~ $ iw list
pi@raspberrypi:~ $
still iw list is giving no output. Now i think in PI4 it was inbuilt wireless features that supported AP mode not the usb adapter i will double check it and confirm.

User avatar
dickon
Posts: 2367
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, in Tiffield

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Tue Feb 07, 2023 8:46 am

Have you got the firmware-realtek package installed?
As it is apparently board policy to disallow any criticism of anything, as it appears to criticise something is to criticise all the users of that something, I will no longer be commenting in threads which are not directly relevant to my uses of the Pi.

saugat10
Posts: 11
Joined: Wed Nov 23, 2022 9:55 am
Location: Copenhagen, Denmark

Re: Make Raspberry pi 2 model B an access point using EDIMAX N 150 Wifi 4 nano usb adapter

Tue Feb 07, 2023 9:14 am

dickon wrote:
Tue Feb 07, 2023 8:46 am
Have you got the firmware-realtek package installed?
Yes. I was able to make AP with NETGEAR wifi adapter in raspberry pi 2

Return to “Advanced users”