So I got a bridged hostapd AP server working with a MT7612U chipset #200
Replies: 26 comments 10 replies
-
So I just dropped the 2g version of the hostapd.conf listed here: The same file, changing the interface to the Realtek 8812bu and eliminating the unsupported [GF] flag with that chipset, generates 108 mbs. So it looks like this is a hardware issue or a driver issue for the Alfa, which is a shame. :( Unless anyone else knows how to get the Alfa to perform 2g better, I'm stumped and stuck, |
Beta Was this translation helpful? Give feedback.
-
Hi @Thimbles809 Let me throw some ideas out, then we can see about optimizing things if that is what you want to do. I have a RasPi4B w/4gb RAM. To say that I have worn it out testing and building the Bridged Wireless Access Point guide is an understatement. Here are some observations:
So, given two adapters, the ACM and one based on the 8812bu, I would use the ACM as the 5 GHz AP and the 8812bu as the 2.4 GHz AP in the dual band setup. You are pretty much optimizing the capabilities of the PI and those two adapters with that setup. To do any tweaking, I would need to look at your hostapd.coonf files. |
Beta Was this translation helpful? Give feedback.
-
I get that. It can take a while to really understand how all this networking stuff works, hostapd is powerful but it takes time to learn. One of these days when you think about setting up WiFi 6, it gets more complicated. WiFi 6e is even more complicated.
The best 2.4 GHz adapter depends on what you are doing and what the need is. Twice last year I had individuals looking for adapters to support the IoT setup they were building in their house. What they needed was an adapter that could handle 32-64 connections, long range and 24/7/365 stability. There was no need to big throughput because the devices just don't need it and only 2.4 GHz was needed. The Realtek drivers that I am aware of limit out at about 32 connections so they were ruled out. I did some testing and the adapter at the top of the list was the Panda PAU08. The users bought one to test and, in both cases, they were very pleased. That adapter has very long range and will cover a large home. The in-kernel driver is rock solid. It could do a link rate of about 72 Mb/s with a throughput of about 30 Mb/s... basic 20 MHz channel width 2.4 GHz band wifi. If I need long range with 2.4 GHz, the Panda works well or my personnel favorite is the Alfa ACHM. It costs more than the Panda but the range that little mighty mite adapter has is really something. If you are looking for big throughput, we might look somewhere else but it depends on your local situation. Generally speaking, I stick to 20 MHz channel width because going to 40 can actually slow things down depending on your local traffic. If you live out in the country away from other APs, sure use 40 MHz channel width and you can get more throughput. Were you running 20 or 40 MHz channel width? Do you have other APs in the area? Have you tested to see what channels provide the best throughput?
I know the author. He tries to take care of that driver but back to topic. WiFi is a sharing technology. So that I don't bore you, here is a link that provides some good info: https://metis.fi/en/2017/10/txpower/ Nick |
Beta Was this translation helpful? Give feedback.
-
Update. I got my second AWUS36ACM and, though I was getting 802.11g speeds, I decided to go with an in-kernel driven card. And I learned something from doing so. It turns out my area is quite congested on the 2.4ghz band and I thought the sub par speeds might be related to being forced into a 20mhz wide channel. So to test, I compiled a hostapd patch that forces a 40mhz channel: https://github.com/d2r2/upstream-hostapd-force-ht40-mode-patch and did some test runs in user mode (I didn't make install). I verified my SSID was 40mhz wide with this: https://play.google.com/store/apps/details?id=com.farproc.wifi.analyzer&hl=en And my findings were the channel width made no difference. The Alfa pushes the 2.4 band at the speed it wants to push it - WRT54G speed. So I sucked it up an decided to take a fresh 2g file from the bridged AP section and just focus on making it secure for the devices that use it and will use it slowly. And what I found then was that A) my daughters beloved tablet did not support wpa2. Here's my hostapd file: |
Beta Was this translation helpful? Give feedback.
-
And I thought I was going to be able to relax this evening.
Please allow me to wax poetic... I've been using Linux since 1994 and wifi since the beginning. My experience with the 2.4 GHz band tells me...
So, job number one is to find the least congested of channels 1, 6 or 11. Then we can look at others things. Nick |
Beta Was this translation helpful? Give feedback.
-
So after going over the wifi analyzer, it appears my best channel is 8 and I get just under 90mbs on it. I've removed all the 40 mhz ht_capab's so there are no complaints at startup about how our wifi toilet is clogged and we can only support 20mhz. ACS, I assume, is still not working since it returns "ACS: Unable to collect survey data" whenever I try to use it and it seems I'm not alone. So it appears that on the Alfa, having the setting "wpa_key_mgmt=WPA-PSK" limits the wifi to under 54mbs despite setting everything else to 802.11n and enabling all the extensions. I've found reference to this problem here: |
Beta Was this translation helpful? Give feedback.
-
Then use channel 6. Your options are 1, 6 and 11. Seriously.
You don't want ACS. Set a fixed channel.
You need to copy and paste your hostapd.conf that you are using for 2.4 Ghz. Let me help you. Something is wrong. |
Beta Was this translation helpful? Give feedback.
-
The only changes that I would make if it were my system are the following. The reason is that many older devices just can't handle WPA3 on 2.4 band.
I enjoy it. Let me switch out adapters on my Pi4B so as check what kind of throughput I can get. |
Beta Was this translation helpful? Give feedback.
-
Here is the iperf3 result when I used a Alfa ACM 7612u adapter on my Pi4B:
Below is the .conf file I used for the above. I cut all of the comments and spaces to make it more readable.
|
Beta Was this translation helpful? Give feedback.
-
I decided to do a test with the adapter in a USB2 port so as to show you that USB2 does just fine with the 2.4 band. In other words, there is no need to use a USB3 port for the 2.4 GHz band. iperf3 result:
It turns out that it seemed to give consistently higher results in a USB2 port. Don't ask. Something else to keep in mind: The placement of the antennas is extremely important for AP mode. You may have to try different locations to determine what gives the best results but in general:
Don't underestimate location of the antennas as an issue for setting up an AP. |
Beta Was this translation helpful? Give feedback.
-
Work and IRL activities really cut into my 2.4g network tunning hobby this week so sorry for the delay. What I can say is that the usb2 improvement may be related to my experience with the pi and its usb port placement. I had a pocket keyboard to control a pi dlna server and the keyboard started glitching really bad when I switched from sd cards to USB3 ssd drives. I thought the keyboard was broken until I stumbled on this: https://www.usb.org/sites/default/files/327216.pdf The keyboard glitch was solved by a 3ft male to female usb cable. I don't know if that might be the reason why you're seeing performance loss when plugging a 2.4g emitter into a usb3 port, but boy was I getting mad at my misbehaving keyboard until I found out it was a dongle proximity problem. |
Beta Was this translation helpful? Give feedback.
-
Wow. Wow. I'm just insert explodey head here. That pishop link with the cheap rt5370's? Turns out they sent me cheap RealTek 8188EU's. To get one of them working in AP mode, I had to git clone a driver and then downgrade the encryption to the barest in order for hostapd not to fail with the cryptic error "Failed to set beacon parameters". Honestly. insert mad "$%^" face here* I've had good experiences with pishop as a vendor in the past, but this is a major screw up. |
Beta Was this translation helpful? Give feedback.
-
Even my head exploded. While you cool down, we can have a discussion. I've had good luck with the below on Pi's. https://www.amazon.com/dp/B07S6B5X76 Here is a new adapter I just posted in the In-Kernel list today: Look at that high gain antenna. It is getting good reviews. |
Beta Was this translation helpful? Give feedback.
-
The red adapter would look real thematic here in Canada, if amazon and panda made them available in canada :( Better too much than too little, I say. I do have a minor hiccup with the 5gz channel selection. the first AP is set at 36 and has an 80mhz width. I tried to set it to 40, using "vht_oper_chwidth=0", but that failed with "Could not set channel for kernel driver". For the second AP, I attempted to keep the channels from overlapping and there seems to be a lot of channels reserved for radar detection or are just disabled 149 to 165 seem available, but every channel assignment leads to a downgrade from the requested 80mhz width to 20mhz. Not a big deal because I get just over 100 mbs down with that 20mhz width, which is about half the performance of the 80mhz, but no one but me is measuring that if the youtubes and netflixes work seamlessly. I currently have the channel of the second AP at 165, since that is the most unoccupied band. I'd like to get every AP matched up on different channels with about 40mhz width and the spirits won't let me. On another note, while learning how to set up multiple interfaces to run hostapd on multiple bands I learned (what I've heard) is the proper way of configuring systemd to start hostapd with multiple configuration files. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/morrownr/USB-WiFi If you go to item 9 on the USB-WiFi main menu (see link above), the document gives very specific setup instructions for the above. It is widely tested and works well. The document is a long read but it is hard to include the needed information in a short document.
When using hostapd, often, when you want to make a change, you have to move several settings at the same time for it to work. You can post your hostapd.conf along with a short description of what you are trying to and I can point out any issues. |
Beta Was this translation helpful? Give feedback.
-
Man. If I had found this tutorial last month, would have been so helpful. But I went a different route on the bridging by setting up the bridge and interfaces in files in the interfaces.d directory. And this process gave me insight into what the bridge tends to do (which is why it took me so long to get the bridgework done right). The bridge tends to take the MAC address of the last interface it absorbs and, because our hostapd added wireless is the last interface to join the bridge, it captures the MAC address of the wireless. And then it requests an ip address from your DHCP server for that address. angry face %^&$%@$! So I went through the steps just now on the tutorial and I got to here:
did the reboot, and got locked out of my AP. Home network wrecker. What I found worked was tying down the bridge to the interface it uses to talk to the dhcp server. In the interfaces.d/br0 file, I did this by: Using your method, I had to do this in the 30-config-bridge-br0.network: Which got everything working again. Sorry for turning this thread into a pain in the ass, but the good news is my site is making progress thumbs up emojis |
Beta Was this translation helpful? Give feedback.
-
I knew I should have bought an ad for the Super Bowl.
There are a lot of different ways to set this up. The setup you see in the guide was developed over time as it falls into what I call a
What I use to stick things is:
You have a hybrid setup so I need to be quiet or I will mess you up. If you do see any problems, a
No problem. Things that are a pain in the ass are what I do. It is for educational purposes. If you see any improvements that can be made to the guide, let me know. |
Beta Was this translation helpful? Give feedback.
-
We're at the end of a very long day. So I did it from scratch, format c: if you will, and over the howls of my family only having one working AP to rely on, I pulled it all together. Here's what I came up with.
What that enables you to do is to assign an IP from your DHCP server to the br0 macaddress, which will allow you to connect any ethernet (or maybe even a wifi) interface to the DHCP server and even rotate them, which I have done. I still like the idea of explicitly tying the bridge to a MAC in case a name change breaks your DHCP setup. I spent a a lot of time trying to diagnose why I kept getting garbage ipv6 addresses from avahi and dhcpcd. Turns out if you are running a ipv4 home network, you better tell your interfaces. The ethernet interfaces seem to follow br0's lead, because they're all joined first and then config'ed, but wifi gets added later and so it needed it's own coaxing. And then there was my clever service file which was not clever when I converted to systemd-networkd. Don't put quotes in your ExecStartPost command and it's good form to explicitly define your root level invocations. Oh, and I put into dhcpcd.conf: Calling it a day. |
Beta Was this translation helpful? Give feedback.
-
Whew! It is going to take some time for me to digest the above.
Recommend you discontinue the use of I see you re using MAC addresses to do certain things. I can't do that as I am constantly changing out adapters to test when users have problems. Keep me posted and make sure the family has good wifi. Happy wife, happy life! |
Beta Was this translation helpful? Give feedback.
-
So I cloned my original AP, renamed it, configured it for the interfaces on the secondary ap, took out the hard coded MACAdress, and systemd networkd generated the exact same MAC for a similarly named interface on a different computer. |
Beta Was this translation helpful? Give feedback.
-
I recently upgraded. My search for a working adapter solution from amazon was a fail and I'm not brave enough to put my credentials in alibaba's hands, but it seems that some alibaba resellers are setting up shop in canada under the walmart banner and 35 bucks canadian for an MT7612 chipset with 4 antennas is too sweet to pass up. What I did note was that, if you are going to be like me and not use a static address for your wifi bridges, it was important to put an edit in /etc/dhcpcd.conf (the dhcp client config file) This is what I have:
This gives you an output upon reboot of:
Using iperf3, a meter away from the AP, I'm getting:
on the 5ghz spec and
The hostapd 2g file is vanilla bridged hostapd with a canadian touch:
On the isc-dhcp / ddns server side of things, we still get multiple request behavior from the wifi AP's as indicated in the server's syslog:
And indications of the same on the bridged AP's syslog: but I've set the lease expire, in /etc/dhcp/dhcpd.conf to 7200 seconds so that my syslog traffic is manageable: Anyways, I know that's a lot more to digest so I'll leave it at that. |
Beta Was this translation helpful? Give feedback.
-
I'm not ignoring you. My lab is shut down and I am moving. I can probably be back in business in a week or two. Let me know how it is going then. |
Beta Was this translation helpful? Give feedback.
-
Ahem. I prematurely declared victory over the dhcpcd dragon with my: My logs have gone from this: to
I honestly don't know if all other raspberry pi dhcpcd clients are doing this and it's just the obsessive compulsive bridged AP folks that checked our logs compulsively enough to notice, but this is the behavior that's configured in the |
Beta Was this translation helpful? Give feedback.
-
You know what I hate? Being right until something proves me horribly wrong and that is what rebooting my APs did. Mass dhcpcd requests were back, which tells me that it's something at startup to do with dhcpcd ad I suspect it has something to do with the dhcpcd-run-hooks NOCARRIER message I see logged, but who cares. According to |
Beta Was this translation helpful? Give feedback.
-
I know what you mean. The AP guide on the Main Menu here is something I worked on for a long time until I had a setup that would provide 24/7/365 stability and fast connections. It is fun and you learn a lot while doing it. Right now I am having problems with the hostapd.conf for WiFi6 that I have on the Main Menu. It seems to work well until the AP sits overnight and then nopackets. The connection is there but no packets. Trying to figure out what is causing this. |
Beta Was this translation helpful? Give feedback.
-
So once again, I don't know if it's a dhcpcd bug or what, but the mass poll behavior returns no matter what flags I set for dhcpcd, given enough time. |
Beta Was this translation helpful? Give feedback.
-
But I have a problem.
I have an Alfa AWUS36ACM and it works brilliantly in "hw_mode=a", pulling the limits of my cable modem plan at about 250 to 300 mbs, which is what I get when wired.
But I need to have a 2.4 ghz network to support some older devices that can't hit 5 ghz. When I put the Alfa in "hw_mode=g", it pulls 50 to 60 mbs.
I've tried tweaking many hostapd.conf parameters but it's just not working, and I've set up a realtek 8812bu in g mode and it's pulling about 100mbs using morrownr's driver:
https://github.com/morrownr/88x2bu-20210702
but I would like to use the Alfa at full capacity on the 2.4ghz spectrum. Is this a hardware limit, or am I just not invoking the right hostapd.conf spell?
Running on 64 bit raspberry os on a 8gig Raspi4.
Beta Was this translation helpful? Give feedback.
All reactions