For our project we need to connect to a 5-Ghz band wifi network. Currently we are trying to use the USB RealTek adapter with the following driver: https://github.com/Grawp/rtl8812au_rtl8821au
At first we had problems compiling the driver but was able to get the module to compile and load it into the kernel thanks to the post here. Now we are having trouble getting the pi to actually connect to the network when the application starts. I was able to connect after ssh-ing into the container and using wpa_supplicant to set up the network. We were also able to get it working on boot with a regular old raspbian image (not through resin).
Our current strategy has been to add edit the /etc/network/interfaces file to reference a wpa_supplicant config file, but we haven’t had any luck with that. Have also tried editing the NetworkManager config file on the resin-boot partition but have not been successful.
I think that ideally coping the module to /lib/modules/$(uname -r)/kernel/drivers/net/wireless might fix this, but that location is not writable from the container
It seems really strange that wpa_supplicant would work, but NetworkManager wouldnt. Could you set up a resinOS-2.0.0+rev3.dev image and ssh into the hostOS using ssh root@<device_IP> and see what the networkmanager logs (journalctl -u NetworkManager -f) show after you modprobe the module from within your container.
Paste the logs here and we can see if there is anything useful there.
Thanks for the quick response @shaunmulligan. I setup a device with resinOS-2.0.0+rev3.dev and our container, but I am not able to ssh to the host OS (I see connection refused) Do I need to do something to start sshd on the host OS? Apologies if this is in the docs, I will check there as well.
@nickd , sorry, i left off the port number. you need to do ssh root@<device_IP> -p22222 .
Alternatively if you have the resin cli installed and are you able to run sudo resin local scan and have it detect your device? if it can find your device on the local network, you will be able to do sudo resin local ssh --host and then interactively select your device. This will drop you into the hostOS. There is no need to start the ssh daemon at all. As long as your device is properly connected to the network,
I’ve had a lot of (far too much) experience with that chipset, and can recommend moving away from that particular version of the driver to this one:
It was released into the wild about a month ago, and has a lot of bug-fixes in it.
Strictly speaking, you shouldn’t have to copy the module any where - just insmod it, and because the container is running in privileged mode, it should “just work”. Having said that, because you always insmod after NM has start up, I could imagine that it gets confused, and doesn’t notice that the device is available.
I’d suggest having a look at this library:
Specifically this nifty utility:
Then, you should be able to do something like this:
@cmoss Thanks a lot for responding to this, good to have some solidarity
I just tried this solution and I think its the closet I’ve gotten, but I still can’t seem to bring up this connection. One problem I notice is that even though the module is appearing when I use lsmod, the kernel doesn’t seem to use it when trying to connect to wifi. When I run the command listed above from the python library, it simply returns with no errors or responses of any kind, but the network does not come up.
I have also tried removing the modules for the on-board wifi chip (brcmfmac and brcmutil) while keeping the 8812au module loaded, but then the script complains that there is no “suitable and available device found.”
I can also see with dmesg that the module seems to be loading properly and is visible with lsmod, but again, doesn’t seem like it is being used to talk with the wifi adapter (which also appears to be properly connected using lsusb). See dmesg logs:
Can you look if the cfg80211 kernel module is loaded? This provides the API that NM is using to configure the card, I’ve seen versions of the module where that dependency gets missed.
Well not sure what to say here, it just started working. NetworkManager is able to find the device driver now, kind of out of no where. The only change I made was moving the adapter to a different USB port on the pi. Seems strange that that would happen.
This python library has really come in handy though, thanks for directing me to that