Hi, I’m trying to use a USB wifi antenna to allow me to connect my device to a wifi signal at longer range.
My issue is that I can’t work out if the Pi is using the built-in wifi adapter, or using the antenna. I’ve tried running ifconfig but I can only see WLAN0 and not WLAN1.
Then here’s non-exhaustive list of supported wifi dongles – in case you have the option to try these out:
Next, I’d suggest using NetworkManager on the device to scan and inspect the wifi adapter. The nmcli command, on its own, will show all interfaces and the connections they have. nmcli c provides a connection summary, showing all known connection files with the connected ones highlighted. nmcli d displays all network interfaces (devices).
Another useful place to look for NetworkManager information is in the journalctl logs:
journalctl -fn 100 -u NetworkManager
Let us know how your investigation goes and if we could help out further.
Thanks for the links. I tried running the nmcli command and it returned this:
wlp1s0u1u1: connected to resin-wifi-01
"Ralink n"
wifi (rt2800usb), 98:3F:9F:19:0C:27, hw, mtu 1500
ip4 default
inet4 192.168.1.105/24
route4 0.0.0.0/0
route4 192.168.1.0/24
inet6 fe80::3b0a:7d22:ad9d:cbaf/64
route6 fe80::/64
route6 ff00::/8
supervisor0: connected to supervisor0
"supervisor0"
bridge, 02:42:8C:E7:56:7C, sw, mtu 1500
inet4 10.114.104.1/25
route4 10.114.104.0/25
inet6 fe80::42:8cff:fee7:567c/64
route6 fe80::/64
route6 ff00::/8
wlan0: disconnected
"wlan0"
1 connection available
wifi (brcmfmac), 3A:BD:75:BA:CF:09, hw, mtu 1500
eth0: unavailable
"eth0"
ethernet (bcmgenet), DC:A6:32:2F:9C:A6, hw, mtu 1500
As you can see, it says that wlan0 is disconnected, however the device is using a wireless connection as the device is online and there is no ethernet plugged in. I’m not sure what I’m looking for regarding the logs.
Hi, can you paste the NetworkManager logs to see if anything stands out there e.g. journalctl -n 200 -u NetworkManager. Also, if you enable support access and send us the device UUID we can also take a look at the device for you.
I’ve enabled support access on the device with the USB dongle installed. The UUID is 945f7f8a2e99218efddae054005ccbcb
I just want to make sure that it is using the external wifi dongle, as opposed to the built in one as the distance to the router is too far for the built in wifi chip to handle.
Edit: The built in wifi chip on the pi is enough to connect it when the pi boots but it is not reliable and drops out a lot. it then is a hit or a miss whether it reconnects and sometimes has to be restarted. So we have remote access for now, but the device may go offline at any point. We do have someone on site tomorrow that would be able to restart the device in this case. But moving forwards we need to ensure that the pi is always using the USB dongle.
You may bind connection to this interface by adding interface-name=wlp1s0u1u3 to [connection] section of the NetworkManager connection profile for this connection. In this case it is /mnt/boot/resin-wifi-01. You may modify it with vi from a host OS terminal.
Thanks for the reply. So if I understand correctly the wlp1s0u1u3 is the external dongle? When I use “nmcli d” it is showing as disconnected.
I’ll try to bind the connection to resin-wifi-01. I’m concerned that the device goes offline and we don’t have access again until tomorrow. Hopefully, this all goes to plan and solves the issue.
Edit: I cant seem to find the right file in the /mnt/boot/ directory.
You may open a host OS terminal and then do vi /mnt/boot/system-connections/resin-wifi-01. You will need some basic vim skills. Pressing i enters insert mode. Pressing ESC exits it. And then typing :wq will write the file and exit vim.
It will not revert to the built-in WiFi once this is applied. Also please note that WiFi drivers on Linux in general are quite unstable. If you rely on WiFi connection only you may or may not run into driver issues where your connection is lost, etc. This is depending on the dongle/driver quality. It is a trial and error scenario unfortunately.
I restarted the device, and ran the nmcli d command but its saying the wlan0 is still the adaptor in use. I checked the resin-wifi-01 file and it still has the interface-name=wlp1s0u1u3 line in it.