-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWUS036ACM stability issues #300
Comments
Hi @da-mkay Cool. Time to play with a Pi. Main Menu item 8 is about AP mode. The main document provides example hostapd.conf files and tested settings for many options. For the mt7612u based adapters, it recommends: ht_capab=[HT40+][HT40-][GF][SHORT-GI-20][SHORT-GI-40] I think your ht_capab line is including some items that are not supported with the ACM. It is very important to get the ht_capab and vht_capab lines right. I can show you how to determine the right settings for any specific adapter if you like. require_ht=1 I've never seen that setting do anything but cause problems.
This is only needed if you are going to support DFS channels... of which, there are none for the 2.4 GHz band. ap_isolate=1 Do you need this? Well, instead of going over various lines, let me post the example for 2.4 I have in the document I posted about above:
There could be other causes but let's get hostapd.conf lined out and if it is not rock solid, we can continue. Cheers, |
First of all, thank you for the quick reply.
I got that ht_capab from some issue here about the ACM. I tried also the one from the main page. AFAIK I had the same issue then.
That would be great.
Okay, THX, I will give it a try without the option.
Good point. At some time I was just trying to get best speed and reliability and tried various settings from verious sources. THX for the explanation.
Yes, actually that’s the reason why I‘m using the Raspi as an AP in the first place.
As far as I remember I already tried the settings from the pages here, but I will give it a try again next week when I‘m back from holiday 🌴 |
Check in when you get back and we'll do some work. Enjoy and watch out for fires. |
Hi, I did some more tests the last days. I used the same hostapd settings from the pages here, well almost:
I had the same problems when downloading files from the internet. With this test I only see connection losses on the iPhone, so not on the MacBook anymore (even after 6 hours the MacBook was still connected and receiving data). One could say that this is an iPhone problem then. However, using the WiFi of my router the same test using the same devices shows no problems. The iPhone has not a single connection loss within 3 hours in this case. I wonder if there are some hostapd settings I can use to solve this or if this is some compatibility issue between iPhone and the ACM, such that I need a different adapter to solve this (Realtek based?). |
Hi again @da-mkay Glad you made it back. I had to reread the entire thread to get back up to speed, which was a challenge for me as I am having vision problems that hopefully will be corrected over the next couple of months. My thoughts at this point: (correct me if you see something you don't agree with) It appears that your hostapd.conf changes have improved but not fully corrected the problem. That is good and indicates we have better settings in place but there are other things that could be contributing so maybe some more investigation is in order. My use of my ACM with a RasPi4B and hostapd has mostly been while using 5 GHz and with care, I can see 400 Mbps indefinitely with whatever I connect. I say with care because I know exactly how to set it up so that I don't see any problems. There are problems to be had with the bad USB3 chipset in the Pi4B and I know not to use a powered hub as they are problematic when setting up AP's on Pi's. My recommendation for testing this setup is for you to put the ACM in the USB2 port that is on the same plane as the circuit board and remove the flash drive for now. This is for testing to eliminate possible sources of problems. If you are not seeing any problems in the hostapd log, then how about we press on and see if anything is showing up in the PiOS log: $ sudo dmesg Something to keep in mind given that you are working with a very modern Iphone and a very mature Macbook, is incompatibilities are more likely to show up on the new and old end of the spectrum. I wish the, hopefully, soon to be released new PiOS based on Debian 12 was available as it is a rebase that includes many badly needed parts that are really showing their age in the current PiOS. There are dated versions of wpa_supplicant, hostapd, and other things that could be contributing to this problem. I can show you how to compile and install new versions of these apps if you are interested and do not want to wait for the next PiOS. I would like to try to duplicate this problem but I do own an iPhone. My son is planning to buy an iphone 14 soon so there is hope. I think we have run onto a very specific issue that is showing up due to the specific combination of hardware and software that isin use. If it is a bug in the ACM driver and we can show exactly where the problem happens, then we can report it.
I maintain 6 Realtek out-of-kernel drivers here and would tell you if there is a better solution. The mt7612u driver and chipset are pretty darn stable. Could there be a bug that is causing this? Sure. My recommendation is to continue testing to see if we can determine the problem. Cheers |
I keep my fingers crossed!
Oops, I forgot to mention that I did the same (new) test also with my old settings. The result was the same for my old settings and the new ones: MacBook Pro showed no error anymore, iPhone did. Maybe the MacBook errors in the past were caused by internet connection or the download servers.
I am already using the USB2 Ports (tested both). And no flash drive, USB hub etc. is connected. Only USB-C to power the Raspi4 is connected, Ethernet and the ACM via USB2.
Yes, nothing gets logged when the iPhone looses connection, even when running hostapd with The only thing logged regarding the ACM is:
I just compiled hostapd 2.10 from sources, but the problem was the same: connection loss of iPhone after 19 minutes.
Haha, I bet he will not give his new phone away for a few testing hours 😋
Unfortunately I am running out of ideas what I can test. |
This might be a good idea and you do appear to be rather knowledgeable person. I have used OpenWRT for a long time. It uses hostapd but it is in its own very stable os. Pi4B is one of the many supported systems with OpenWRT: https://openwrt.org/toh/raspberry_pi_foundation/raspberry_pi If you have an extra sd card and want to set your Pi4B up with OpenWRT, I say go for it. OpenWRT has a driver for the ACM but you do have to install it with Luci or manually depending on what you decide. This would be interesting. You might enjoy it. If you have questions, somebody around here can probably point you in the right direction but the OpenWRT forums are very active. |
Maybe try disabling scatter gather.
Google how.
It doesn't appear to be the problem but it's worth a try.
Maybe some sort of power saving thing?
|
I'm pretty sure I saw above somewhere where he said that he tried that. This thread is long and it is hard to remember everything. With that said, I have never seen the need for turning scatter gather off with AP mode using the 2.4 GHz band. I think that is because of the slower speeds on 2.4 GHz.
I'm hesitant to rule this out but I'm beginning to form an opinion that the disconnection is not being initiated by the AP he has built. We are not seeing anything in the logs that would indicated such. I have no idea how to get information from the logs in an iPhone or Macbook Pro because I do not have that hardware but if I did, I would be looking for clues in the logs of those devices. This does not mean that those devices are at fault. I recommended that he look at digging another sd card out so as to burn it with OpenWRT for these reasons:
|
Yes, I already have I also just tried OpenWRT on the RPi4 with ACM and experienced the same issue. |
Random thoughts:
Would you consider changing to 5 GHz for testing? With OpenWRT on the Pi, it is easy with Luci. With RasPiOS, several hostapd.conf lines will need to be added or changed. Also, need to change the ACM to a USB3 port or the speed won't be where we would expect. I understand that you are probably using 2.4 for the range but the ACM does reasonably well on 5 GHz. You could test different 2.4 GHz channels as well. This really is a puzzle and I know you want solid results right now but wifi can work in mysterious ways. |
FYI: A couple of days ago I through a clean installation of OpenWRT 22.3.5 on my ARM based wifi router. The router has a USB2 port and a USB3 port. I put the ACM in the USB3 port. Iset it to channel 6. My router user uses channel 1 as it is the best local 2.4 GHz channel. I installed iperf3 and the driver for the ACM. My mission was to see if the ACM would drop the connection. I tried several USB WiFi adapters as client. Nothing about 30 minutes. I tried my noteboot computer. I finally decided to do a long test. I did an overnight test. I was still going this morning. Not a single retry. Okay, so my RasPi4B was not used as it is busy on another project but I did what I could with what is available. I got nothing. Do you have anything besides the RasPi4B to test? X86 boxes are generally very stable. A RasPi3B or 3B+ would be good boxes to test with as they can handle 2.4 GHz speeds and and would eliminate some things that might be a problem in the 4B. Where are we? The iPhone 14 and RasPi4B are still possibilities to be the guilty party. Have you read any good iPhone 14 support forums to see if any other iPhone 14 users are reporting anything similar? Any recent updates to the iPhone 14 that are not installed yet? |
Thanks for your effort @morrownr ! I also tested 5Ghz now on OpenWRT where I installed kmod-mt76x2u:
Saying "connection loss" I mean that the websocket-connection was lost. Usually, the iPhone still thought for some time, that it was connected to the WiFi. But no new connection was possible until WiFi reconnected. I also had the chance to test an iPhone 11 now running the same most recent iOS -> same problem. Once the test on the iPhone 11 failed, I saw this in dmesg:
Moreover, reconnect to the WiFi was not possible anymore. Actually, nobody could connect anymore. Not even the MacBook. I had to restart the Raspi. I tested again using iPhone 14 Pro, and this time came to the same result:
Again, no connection to WiFi was possible and I had to restart the Raspi. I also tested OpenWRT on a USB-Stick installation on my x86 PC. At first it looked like it was more stable, but in the end I saw the same problems on the iPhone. I tested it with USB3. Since only iPhones are affected it could be an iPhone issue. But again, connecting it to the WiFi of my router, I don't see those issues. Moreover, by then I am a bit worried about running the ACM as an AP. Because it seems that any WiFi client could break the WiFi. Not only accidentally, but with purpose by attackers. Doesn't feel good. Regarding the errors in dmesg, I found something similar here, but with a different error code. The solution was to use a kernel 6.4, my RaspiOS has 6.1. Maybe I give that a try. |
I have a good guide for compiling a new kernel for the RasPiOS if you are interested. I'm seeing some good info in your post. I can do some searching. It is very possible that this is a bug that has been fixed either intentionally or otherwise. |
Shortly after sending my last comment I realised that the error shown in dmesg happened when using OpenWRT on x86 machine, not when using my Raspi. Nevertheless, I compiled kernel 6.4 for Raspi (official guide). However, nothing has improved. iPhones still show connection losses during my test. However, until now it did not break the whole AP, as it did before sometimes. I also tried an iPad with iPadOS 15.x. No problems there within 6 hours. Even after upgrading to newest iPadOS 16.6: no problems within 3 hours. Since the iPhones also showed no errors when connected to my routers WiFi, I tried again with the Raspis internal WiFi. Here, also no connection loss happened within 3 hours. So, somehow the ACM and the iPhones do not work well together in 2.4GHz mode. |
I am adding you to this issue because we are at a point in troubleshooting this issue where the best option to continue may be to capture packets from an iPhone 14. I have some health issues that may limit my ability to help starting this week and you are far more knowledgeable than me. The OP is @da-mkay and he has worked hard to help determine where the issue is. If you have time to take a look, I would appreciate it. |
@morrownr , thanks for the invitation to this report. Usually log files and configuration settings are a good starting point. |
As a starting point, take a look at the Frame Control Field:
where the Retry Bit is a good indicator about the quality: Check this on both directions: I'll say that you have to figure out whether the problem is related to If you "see" a stable connection on the RF side (frames are transmitted and acknowledged - no retires), but your download rate is going down, the problem is located to the Raspberry. |
There is a relationship between rate and RF-bandwidth. Compared to your MAC the iPhone antenna is poor.
Now we increase the rate (that will increase the bandwidth and reduce the range:
In general:
If everything is fine, you can leave this RF part, because you know that the device is working as expected (on the RF side). |
Next step is to check the connection between the RPi and the device, especially the power consumption. |
Now do the same as mentioned above, but on different kernels to make sure it is not a driver regression. |
BTW: It is always good to check (set) the regulatory domain setting, because the impact is huge:
|
@ZerBea Thank you for your input.
You mean without running the ACM as AP? Because, when setting it to monitor mode I cannot use it as AP anymore. If I run tshark while in master mode I do not get the WLAN packages. |
Mixed mode (MONITOR and AP) should work fine:
run iw to add monitor interface |
To monitor the NETLINK communication, just setup a NETLINK MONITOR interface (nlmon):
run hostapd on AP interface You can do that in parallel with the WLAN MONITOR interface (mon0). Wait until the problem occurs. Than inspect the last packets (of WLAN MONITOR interface and NETLINK NL80211 packets). |
Thank you again! I got it working in mixed mode.
In the meantime I bought another adapter, an 8812bu based Alfa AWUS036ACU. However, there is also one small issue with the ACU: Is there a way to ensure bandwidth is spread almost-equally across clients? Because besides this small issue the setup looks almost perfect now and is more stable than the ACM setup before. The wifi never broke down during my tests as it did with the ACM several times. |
Thanks for the information, which is very useful. Partially means that not all combinations of WiFi hardware are affected. Some combinations are working fine, while other running into serious problems. ALFA AWUS036ACM (penetration device) CLIENT (target) AWUS036ACM doesn't "see" all packets (at first time) transmitted by the CLIENT I do not use hostapd, So I don't know if hostapd change channel, rate and bandwidth in case of interferences, like my test router do. If not, this might be one reason. For me, it looks like the ACM is an excellent device to be used as CLIENT, but it has some problems running as an ACCESS POINT (AP), because the requirements (running as AP or CLIENT) are very different. To make sure it is not related to the chipset itself, I ordered an ALL WA1200AC (same chipset, same driver): BTW: ipTIME <---> RTL8821CE 802.11ac PCIe Wireless Network Adapter ipTIME WiFi USB pen Nearly the same problems. FRITZ!Box 7430 (router) <---> RTL8821CE 802.11ac PCIe Wireless Network Adapter |
Good to see that I am not the only one seeing these issues. In the meantime I returned the ACM. |
I got the ALLNET WA1200AC. First tests are not very impressive, because it looks like mt76 USB 3.x support is completely broken: |
I don't have one of the ALLNET adapters but about a year ago or so I got a report from a user with a mt7612u based adapter that would not do USB3. He had 2 of the adapters and sent one to me and I still have it. Let me dig up my notes and pass them on to you. Have you tried a different USB3 port on the same system?
I have several adapters based on the mt7612u chipset and the only one that I have seen that had a problem with USB3 is the one I mentioned above. I have a laptop with gen 3.1 ports so let me take a look with some adapters and see what happens. |
I did a lot more. The motherboard is a MSI B-550A Pro (AMD). Ports external:
Ports internal
tested devices:
Tested kernels 6.4 and 6.5 If the devices are connected to an USB 3.x port they don't work tested USB 2 hubs:
|
Tested: Alfa ACM (mt7612u) USB 3.2 Gen 1 (Type A) Result: $ lsusb -t $ iw dev The ACM is PHY#1 but you know that. I'm sending this message connected with the ACM. I can test other adapters based on the mt7612u. Let me know if there is anything else I can test. |
Thanks for the test. Intel systems are not affected. I have a second AMD system MSI KRAIT. Same behavior as the MSI B-550A. Not affected is my norebook (also AMD): ASUS TUF FX505DT |
Do you know what chipsets are used in the USB3 hubs in the systems where you are seeing the problem? |
AMD Renoir/Cezanne |
Another piece of the puzzle. @da-mkay probably thinks there are all kinds of incompatibilities when it comes to USB WiFi and he is right but it is not as bad as it may look. The Plug and Play list that I started and is on the Main Menu is also an attempt select specific adapters where there is evidence that the adapters are known to be relatively trouble free. The ACM that started this issue is about as solid and trouble free as any adapter that I am aware of. However, The vast majority of USB3 capable adapters have only been tested on basic USB3, not USB3 genX. After testing my ACM on my modern laptop yesterday, I happened to test a rtl8832bu based adapter in a USB3 port on the other side of the system and the system would not recognize it. When I moved the adapter to the other side of the system, it showed up and worked fine. I do answer a lot of questions from users given the 6 Realtek driver repos that are maintained here. Here is what I think to be true to minimize problems with USB WiFi adapters:
If you pay attention to the guidelines I just suggested, it won't guarantee you a problem free experience using USB WiFi adapters with Linux but it will increase the odds GREATLY. If I can come across any info to help @ZerBea , I will pass it on. |
What is your status? FYI: With the release of RasPiOS 2023-10-10, I have been working on my AP guide. Network Manager is now the default and dhcpcd is not even installed. I played around with some options but decided to disable NM and use systemd-networkd plus systemd-resolved along with hostapd. I am using my Alfa ACM with scatter-gather turned off. Three days into testing and abusing, it is a rock. Setup: No powered hubs. ACM is plugged into a USB3 port. The only other device plugged into a USB port is a webcam plugged into a USB2 port. It provides video to my LAN for security reasons. I run the RasPi4B headless via VNC. If you want to test the guide, please do. |
Hi,
I set up a 2,4 GHz AP using a Raspberry Pi 4B and an ALFA AWUS036ACM.
Besides the USB Stick (plugged into a USB2 port) only LAN and USB-C (for power) is connected.
iperf3 measures around 941 mbps from The RPi4 via LAN to a Linux-Server in the same LAN.
A client connected to the AP measures 90-100 mbps to that same server using iperf3. That’s enough as I just want to fully utilise my 100 mbps internet connection.
An internet speed test measures 85 to 90 mbps. That‘s ok.
Now to the problem:
I have 3 devices connected to the AP: One MacBook Pro 2013, one MacBook Pro 2022 and one iPhone 14 Pro.
For testing purpose I ran a download on the MacBooks in an infinite loop using curl and start a download from the iPhone manually as well in parallel.
I always see the same picture:
SSL_ERROR_SYSCALL, errno 54 - according to internet it’s a „Connection reset by peer" error, which basically indicates a generic network connectivity problem. The next download usually works without problems.
Unfortunately nothing was logged by hostpd when downloads failed on MacBook Pro.
I saw some „disassociated“ logs for the iPhone, but after adjusting some hostapd settings and looking at the logs as soon as the download hung on the iPhone, I saw that nothing was logged for the iPhone.
Since the ALFA AWUS036ACM is advertised here as highly recommended, I wonder if someone has similar issues.
Previously I had a Fritz AC 860, which had similar issues. Even worse: there I experienced those freezes even on the MBP 2013, so that I had to reconnect. One time, I even had to reboot the RPi, because WiFi AP was not working at all anymore.
I already tried different USB Ports, even USB3 with disable_usb_sg, but this did not help and speed was worse.
I also tried different hostapd settings, see below.
OS: Raspberry Pi OS Lite (64-bit) - 2023-05-03
hostapd config:
onboard WiFi is disabled.
The text was updated successfully, but these errors were encountered: