WiFi 6 on the Raspberry Pi CM4 makes it Fly! MORE THAN 1 Gbps!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i got wi-fi 6 working at 1.34 gigabits on the raspberry pi compute module 4. in this video i'll show you how i blew through my budget on three wireless cards and a new wi-fi router cross-compiled the linux kernel installed intel's wi-fi firmware patched intel's wireless driver to work with the raspberry pi and benchmarked everything on my pokey old gigabit network have you ever started a project that should take a couple hours with a 50 budget and realized at the end you spent a whole month on it and spent close to a thousand bucks yeah well that's this project for me when i tested the compute module 4's onboard wi-fi 802.11 ac chip i got up to around 80 megabits and i thought that's pretty respectable but respectable is another way of saying not actually that impressive so i wondered if i could get better performance with a pci express card i bought this asus ac51 card that has a real tech chip inside and i spent a few days debugging realtek's linux drivers eventually though i gave up because most people using this chip on linux seem to be using a usb version not pci express if you want to read more about that failure check out the github issue linked in the description around the same time i told redshirt jeff i was thinking about upgrading the home network to 10 gigs and he got a bit carried away since i didn't have the right cabling to replace my old cat5 wiring i thought why not go all the way and see if i can get wi-fi six working on the raspberry pi connected to my mac over a 10 gig wired network through a new 80211ax router and to my knowledge nobody else besides apple with their new m1 laptops have used wi-fi 6 on an arm computer so i did it i bought an edie up intel ax200 pci express card and jammed it into the pcie slot but before we get to the card what's 802.11 ax and what's wi-fi six well this video isn't about wi-fi specifically but here's a quick overview in wi-fi's early days this thing was all the rage and we had 802.11b wi-fi it was rated up to 11 megabits then in the past couple decades we saw 802.11 a and g having 54 megabits 802.11n which is also called wi-fi 4 having 300 to 600 megabits and using either the 2.4 or 5 gig spectrum and more recently 802.11 ac aka wi-fi 5 having up to 1.3 gigabits on the 5 gigahertz band there are some other standards i'm skipping over but last year the 802.11 ax standard was christened as wi-fi 6 and it's now the gold standard allowing a theoretical maximum of 10 gigabits over the 5 gigahertz band one very important thing to note though is that all the advertise speeds are theoretical maximums and you're never going to reach those speeds even in a perfect lab environment and things you wouldn't even think about matter a lot like the antenna configurations on your router and your computer the placement of the router and the layout and materials of the building you're in even the walls there's a good reason everyone recommends using wired networking if you need consistency now back to the pci express card it fits nicely in the 1x slot on the compute module 4 i o board and the first thing i do with all the boards i test is boot the pi and see what i can see using ls pci and this card showed up beautifully with that out of the way i also ran d message and looked for the pci express initialization section to make sure there weren't any bar space issues this happens with some cards but it didn't seem to be an issue with this card so we're good to go there too and then i thought maybe i'm in luck today and i ran ipa to see if the new wi-fi interface was already working by some crazy miracle well not so much i needed to do a little bit more work to get the driver working as with many pci express devices the raspberry pi os doesn't include the drivers in the kernel by default but they're just to recompile away and after going through the struggle of recompiling the linux kernel almost a dozen times for my gpu testing video i finally decided to do what hetzbiz originally recommended in a comment a few months ago and set up a reliable cross-compile environment on my mac which has a much faster core i9 processor the environment is built inside a virtual machine on my mac and the main reason for that is it's hard to mount the raspberry pi ext4 file system on my mac but it's easy to do it inside a linux vm i have to do that to be able to copy the compiled kernel into place for the pi the first step is to create the vm which i do with vagrant running the command vagrant up as part of the process i have a script that automatically runs and installs the build tools for linux after i built the vm i powered it down with vagrant halt then went into the virtual box settings to enable a virtual usb port and connect my usb card reader to the vm so i could read the raspberry pi's microsd card in linux then i booted up the vm again with vegrent up and once it was running i logged in with vagrant ssh the first step to compile linux is to clone the kernel source which i did with this git clone command it takes a little time but once it's done i cd into the linux folder set the environment variable kernel equals kernel 8 since i'm testing with the 64-bit kernel then i ran the make command you see here to build the kernel configuration everything i'm doing here is documented in the cross compile link in the description below once the initial configuration is built i run make again to enter menu config which is a graphical interface for configuring kernel options inside menuconfig i navigated to device drivers then found the network device support section then scroll down until i got to wireless lan in the wireless lan section i kept scrolling until i found the intel devices and then press the space bar to select intel wireless wi-fi next-gen agn this selects the iwl wi-fi driver for the ax-200 chip i also enabled the intel wireless wi-fi mvm firmware support once that was selected i went to save then exited out of the menu config gui the final step for compilation is to run this make command to compile the image modules and dtbs or device tree blobs this step takes quite a while and one other thing i should note is that all the commands i'm running are for the 64-bit kernel if you want to compile the 32-bit version of raspberry pi os the instructions are slightly different again remember everything i'm doing is documented thoroughly in the link in the description below on my macbook pro the compile takes 20 to 25 minutes on the pi it took an hour and if you watched my kubuntu focus m2 review it only took 10 to 15 minutes natively on a fast linux laptop anyways watching the whole compile would be really boring so let's move on to the next step once the kernel is compiled i had to move it to the pi so the first step is to shut down the pi and pop out the micro sd card i put the card into the card reader that i had attached to my linux vm then hopped back into the vm first i needed a place to mount both of the volumes on the micro sd card so i used makeder to create a mount point for the fat32 boot partition and another one for the main ext4 partition then i used sudo to mount the micro sd card which was available as device sdb in both places i mounted the boot partition sdb1 to the fat32 directory i mounted the main partition sdb2 to the ext4 directory at this point all that's left is to copy the built kernel into place first i ran the modules install command with make to install all the modules into place on the mounted ext4 volume after that finished i ran the commands you see on the screen now to back up the existing 64-bit kernel image copy the new image into place and then finally to copy all the device tree overlays into place after all the copying was finished i unmounted both partitions and shut down the vm i pulled the microsd card from my mac put it back in the pie booted it up and crossed my fingers i logged into the pie and ran d message to check the logs and i realized there was something missing because i saw the message no suitable firmware found and looking further i found that i also had to install the appropriate device firmware from the linux wireless website i searched for iwl wi-fi and found the page for all the intel devices i scrolled down and found the download link for the ax200 and copied the download url then i went back to the pi used wget to download the firmware archive and used tar to unzip and untar the firmware and finally went into the firmware directory and copied all the files into the right place on the file system in this case slash lib firmware i rebooted the pi and crossed my fingers the second time this time i ran d-message and saw a lot more output but there was still a lot of red so i decided to follow the log output using d-message-follow and i saw something was definitely going wrong because there was a lot of output every couple seconds looking closer at the output i found a couple issues first there was a failure to read out a thermal zone and second there was a message about a microcode sw error it's not really fun trying to figure out these error messages when they're mixed up with the rest of the log output so i decided to disable the iwl wi-fi kernel module to disable the module i used sudo to create a config file named blacklist-iwl wi-fi inside the slash etsy modprobe.d directory then i added the line blacklist iwl wifi inside saved the file and rebooted the pi now i could follow the d message output in one window and run sudo mod probe iwl wifi in a separate window so i could monitor the output from d message a lot more easily and using the amazing power of copying and pasting error messages into duckduckgo and google i found two things first it seemed like the thermal zone issue was just misdirection it's not a fatal error and in fact if i manually read out the thermal zone data it seems to actually work so it's probably just a bug in the driver second i used iwlist to list wifi interfaces and it seemed like the ax200 was actually identified but then i noticed the id of the device keeps seeming to increase which seemed a little strange so i also ran ipaddress to see if the device was recognized and it was but again the device id kept going up from two one two to two on seven two two two two two four two two six and so on so i kept digging into the d message output and eventually i found a helpful patch on the linux kernel mailing list someone else had one of the same errors i had which was failed to configure rxqs the solution he came up with delete the error message and the check that triggered it well i figured it was worth a try so now i'll show you how i patched the intel wifi driver in the raspberry pi linux kernel i copied out the patch straight from the mailing list page the patch starts with the diff line and ends on the last line of code i went back to my cross compile environment booted up the vm again logged in with vagrant ssh then went into the linux source directory in there i created a new file called iwl wi-fi.patch i pasted in the patch that i had copied from the mailing list then i used get to apply the patch with the command get apply v iwl wi-fi dot patch get reported the patch applied cleanly so now it was time to recompile and see if it actually works after the compile which went a lot faster the second time i copied everything back over the micro sd card again the same way that i did the first time and then i shut down the cross compile vm i popped the card back into my raspberry pi the second time and crossed my fingers the third time i logged into the pi watched the d message log ran the mod probe command to load the driver and it seems like it worked to make sure it was working i ran ipa to see the interface and it showed up as wlan1 and i ran iwlist and it also showed up correctly there so the last thing to test was whether it would actually connect to my network so i edited the wpa supplicant file in slash etsy slash wpa supplicant i made sure the country code was set so wi-fi would work then i added my network details including my network's ssid and passphrase and you didn't think i'd show you my network password did you i don't even give that to redshirt jeff anymore after what he did i saved the file and rebooted the pi when i logged in again i ran ip address and i noticed the interface wasn't there what happened well remember i had blacklisted iwl wifi earlier but that was quick to fix i deleted the blacklist file and rebooted again after logging back in i ran ipaddress again and this time it looked like everything was working so the first time i did this a few weeks ago i ran a few tests using iperf but realized at this point that i had an 802.11 ax wireless card connecting to a pokey old 802.11 ac wireless router so i had to figure out a way to connect over wi-fi 6. instead of upgrading my entire home network pixel rainbow on github suggested i try upgrading one of my other computers to wi-fi 6 then test connecting it directly to the pi so i was excited when i found this 20 dollar wise tiger intel ax 200 upgrade for my dell xps 13 laptops built-in wi-fi i bought it and installed it in the dell i even made an entire video about that process which you can see in the card linked above me but when i tested the speeds i was disappointed to find that the upgraded card could only pump through maybe 300 to 400 megabits on the xps 13 and it's likely due to the 2x2 antenna performance and configuration on the dell my macbook pro which doesn't have wi-fi 6 can get speeds up to 900 megabits over ac wi-fi so the design of the entire system is extremely important so i was happy to have wi-fi 6 in my dell laptop but it wasn't good enough to test how much speed i could get out of the pi so my next step was upgrading my wireless router and there are a lot of ax routers available but most of the ones with faster than gigabit speeds cost a lot more than the basic models and if i wanted to break the gigabit barrier i'd need one with a faster uplink after a bit of searching i found the local micro center had the asus rtax86u 6 router with a 2.5 gig uplink port my home internet can't do anything near that much heck i'm lucky to get 20 megs upload speeds thanks spectrum but i do want to upgrade my internal network to 10 gig soon so it'd be nice to have the fast wi-fi connection too i bought that router and replaced my old router with it it was funny when i went down to my little network area in the basement i realized my old router was very similar but it was the 802.11 ac version also as an aside i know the pronunciation of asus is supposed to be like a and then soos like dr seuss but when you say it quickly it's easier to just say asus so that's how i say it even in the official pronunciation video which is linked in the description it sounds more like asus than asus asus repeat once again asus anyways getting the new router working only took a few minutes and it seemed to work great at this point though i realized two more things first i still didn't have any other computers with more than one gigabit of connectivity and second i had blown through my budget for this video weeks ago and probably through the budget for an entire month's worth of videos so i decided to do two things first i bought some 10 gig networking gear that i realized after the fact wouldn't work with the router's 2.5 gig port because it only did one or 10 gigabits it didn't do 2.5 or 5 gigabits so second i decided to follow the advice of stoned b on github and set up the merlin firmware on my asus router so i could run iperf directly between my router and the raspberry pi the instructions for doing this with the asus router are in the github issue linked in the description if you want to try the same thing on your own anyways here's the bottom line over my gigabit network the pi matched its built-in gigabit wired network performance maxing it out at about 930 megabits and connected directly to the ax router it could pump through 1.34 gigabits or a total of 1.5 gigabits bi-directional with a full duplex transfer so my official benchmark for this card on the pi as measured with iperf is 1.34 gigabits per second making it 30 percent faster than the built-in gigabit wired networking and a whopping 16 times faster than built-in wi-fi on the pi it can probably get even faster but i was happy enough with this result so what did we learn today first i need to get serious about upgrading my home network to 10 gigabits especially since redshirt jeff just knocked out half my wired network second getting faster wi-fi on the raspberry pi isn't too hard but it does require some extra tweaking and a kernel patch making it hard for most people to get it working hopefully the issues i ran into here will be easier to work around in the future third i want to explore more like using wi-fi 6 along with fast sata or nvme storage for a super fast wireless nas or using wi-fi 6 along with gigabit ethernet to build a custom router or an access point subscribe to see what crazy things i'll try next and please support me on patreon or github so my wife doesn't stop my 10 gig upgrade until next time i'm jeff gearling this part you don't see my face so it doesn't matter what i'm doing i should be like i mean it just looks weird anywhere that i'm looking so maybe just cut that this step takes this step for the 64-bit cornrow kernel the butt partition that's when you spread your in any way and let's not go there sudo get reported the pachapide cleanies clean oh man wpa underscore supplement sup i can never say supplicant
Info
Channel: Jeff Geerling
Views: 156,895
Rating: undefined out of 5
Keywords: raspberry pi, ax, 802.11ax, wifi 6, 802.11ac, benchmark, performance, wifi, wireless, network, networking, ethernet, gigabit, 10G, 5G, 2.5G, intel, ax200, asus, rt-ax86u, pci, pci express, pcie, edup, wise tiger, dell, xps 13, xps, firmware, driver, iwlwifi, kernel, cross compile, linux, compute module, cm4, sbc, airport
Id: csI19aOJEik
Channel Id: undefined
Length: 18min 11sec (1091 seconds)
Published: Mon Dec 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.