Hi all,
I’m working on a project that needs an access point. I’m using a Raspberry Pi 4, which has built-in Wi-Fi, but I need that Wi-Fi chip to connect to the internet. So I’m using a USB Wi-Fi dongle to create the access point.
I’ve tried the TP-Link WN722N and TP-Link WN725N. Both are not supported by NetworkManager. They use the same driver (r8188eu). So after some investigation, a version of hostapd seems like the winner. So I’ve set some udev rules in the config.json
file of my device, like so:
"os": {
"udevRules": {
"60-tp-link-wn725n-v3-hostapd": "ACTION==\"add\", SUBSYSTEM==\"net\", SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"0bda\", ATTRS{idProduct}==\"8179\", NAME=\"ap0\", ENV{NM_UNMANAGED}=\"1\"",
"60-tp-link-wn722n-v3-hostapd": "ACTION==\"add\", SUBSYSTEM==\"net\", SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"2357\", ATTRS{idProduct}==\"010c\", NAME=\"ap0\", ENV{NM_UNMANAGED}=\"1\""
}
}
So far so good, because it works
Created a container with hostapd running, using interface ap0
as defined in the udev rules, and we have an access point!
But after some thinking, I don’t think this is a sustainable solution. We’ve had some problems in the past with USB dongles being discontinued and the next version having another chipset. And we’re selling hundreds of these devices a year, so we’ve to come up with something sustainable and updatable.
Some of my questions:
-
Update udev rules
Is it even possible to update udev rules after devices are deployed? Because after some research, the only way to do it is to change theconfig.json
. But can a container do this automatically? -
Container udev rules
Is it possible to create udev rules inside a container? I’ve tried it but without success. If this is possible and I can create a container with the udev rules shown above, this would fix question #1 and some headaches. -
Best AP device
Of course nobody knows what is the best practice or best device for setting up an AP. But is it better to use the onboard Wi-Fi chip and lose the 5GHz functionality, or use the USB Wi-Fi dongles with hostapd running in a container? Any suggestions? -
Hotplug AP
Maybe it’s fixable when you can set udev rules inside a container, but when a USB AP is being plugged in, the hostapd should start. Even when you plug it in after the container has started. Any idea how to do that?
I’ve tried many things, and I’m happy that I got hostapd working. But these are still some open questions that I’d like to discuss with some people.
Thanks in advance!