1

So I'm building an autonomous boat with my Pi (3B), to which I connected using an external USB wifi adapter (which had a better range). I used the trick as described here: I simply blacklisted the built in wifi by adding the file /etc/modprobe.d/brcmfmac.conf which contained blacklist brcmfmac. This worked great.

I now added a 2G/GPRS module to the boat, so I can connect to it over the mobile network, so I don't need the bulky wifi adapter anymore. To achieve that I removed the file /etc/modprobe.d/brcmfmac.conf, and then physically removed the adapter from the USB port. After a reboot the built in wifi doesn't seem to work though. When I connect the wifi adapter again the pi connects to my network again. So it seems the pi still connects to the wifi using the external adapter. I repeated this several times, with the same result.

Does anybody know why the pi continues to use the external antenna instead of the built in wifi antenna? How can I make it use the built in antenna again? All tips are welcome!

[EDIT]

I pasted the output of ip link when the adapter is connected below:

$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether b8:27:eb:ba:30:8e brd ff:ff:ff:ff:ff:ff
3: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 3
    link/ppp 
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 44:1c:a8:7f:7e:1a brd ff:ff:ff:ff:ff:ff

To run the same command when the adapter is not connected I opened screen on the terminal, and than ran sleep 20 && ip link and quickly disconnected the adapter. I pasted the output below. I'm not sure whether that is the same output after a reboot with the adapter unplugged though.

$ sleep 20 && ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether b8:27:eb:ba:30:8e brd ff:ff:ff:ff:ff:ff
3: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 3
    link/ppp

[EDIT 2]

I now added the line below as a cron and then rebooted the pi with the adapter unplugged.

@reboot sleep 10 && ip link > /home/pi/iplinkresult.txt

Afterward a while I plugged in the wifi adapter again and ssh'ed into it, to find that the contents of the file iplinkresult.txt where the same as I pasted above.

[EDIT 3]

The result of rfkill list:

$ rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
| improve this question | | | | |
  • with the wifi dongle disconnected, what is the output of ip link - what is the output when the wifi dongle is connected – Jaromanda X Mar 26 at 21:57
  • @JaromandaX - Yes, I'm referring to one of these: aliexpress.com/item/32829125691.html – kramer65 Mar 26 at 21:58
  • yeah, I removed that comment and added a comment asking for information :D – Jaromanda X Mar 26 at 22:04
  • @JaromandaX - I added the results of ip link to the question. – kramer65 Mar 26 at 22:06
  • can you check that the line blacklist brcmfmac doesn't exist in any other file in /etc/modprobe.d folder – Jaromanda X Mar 26 at 22:10
2

Use a systematic testing procedure, rather than a shotgun approach.

Try a fresh Raspbian on a new SD Card

If this works the hardware is OK,
if not you have probably damaged the Pi.

Only if WiFi works on an unmodified OS try software fixes. As always the BEST solution is to restore from your backup.

| improve this answer | | | | |
  • Not sure why the downvote, as this is how troubleshooting should be done! – Jaromanda X Mar 27 at 2:04
  • Well, turns out you seem to be right. I installed a fresh Raspbian on a separate sd-card and with that the wifi also doesn't work without the external wifi adapter. I guess the internal wifi is simply broken. I'm unsure how something like that can happen though. But yeah, time to move on. I was planning on moving this to a Raspi Zero W anyway, to save on battery. Thanks for all your help. Eitherway, I learned a lot from it.. :-) – kramer65 Mar 28 at 9:12
1

Let's have a look at the logic. With default setup you have two interfaces:

eth0
wlan0

With an additional GPRS dongle you should see:

eth0
wlan0
ppp0

With your setup you see without dongle:

eth0
ppp0

and with dongle:

eth0
ppp0
wlan0

Do you see it? In the first case wlan0 is always available, in your case it is ppp0. It seems something is making wlan0 to ppp0 in your case. Adding the dongle will use the first free device name and that is wlan0. So I suggest to look what is renaming your internal WiFi interface wlan0 to ppp0. You fiddled with (un)loading the WiFi driver following an obscure tutorial you have linked. There is no need doing such things. As you will find in /boot/overlays/README, adding a line dtoverlay=disable-wifi to /boot/config.txt will just do that.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.