Hi, I've been trying for weeks at this point to get Wi-Fi to work on my Pi Zero, with no success.
I'm using a usb wireless dongle, chipset 148f:7601, (it's the old Zero, not the Zero W with inbuilt wireless card), and a fresh install of whatever the heck I can get to work. I've tried DietPi, the latest version of Raspbian, and the lite version, as well as an older version of Stretch and what I think was the last version of Jessie.
From what I've read online, I think it's a problem with the wireless dongle's drivers - I've tried several drivers from online, I've tried installing the firmware-ralink package and firmware-misc-nonfree, each to no effect.

I've tried reinstalling several times, changing things in dchcp.conf, wpa_supplicant.conf and /etc/network/interfaces.
It does show up in when I do lsusb.
On Stretch, it recognises it, ifup returns, and wlan0 exists but it can't connect to the internet, and I get wpa_supplicant errors.
On Jessie, it tells me wlan0 doesn't even exist. I do ifconfig, and the loopback interface is the only one recognised.
/etc/wpa_supplicant/wpa_supplicant.conf looks like
network={
ssid="myssid"
psk="mypassword"
}

obviously where those two are my real ssid and password.
/etc/network/interfaces looks like

And I've tried various other suggestions like including wpa-supplicant, setting wpa-ssid and wpa-psk in this file too, setting wlan1 and eth0, and various other combinations.

Hopefully somebody knows how to help me, I'm getting pretty desperate - and I'm not very experienced in linux at all, so try not to make it too complicated.
I also, obviously, don't have any way to connect this to the internet, which makes installing packages or updates all the more awkward, as I can't do apt-get or git clone or anything of that sort.

# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

/etc/wpa_supplicant/wpa_supplicant.conf should contain (the 3 lines at the top are important. You can change GB to your country code if you like - it affects which wifi channels are available)

I use a PcDuino USB WiFi dongle which works with Raspbian by default (no additional drivers needed). They are available on ebay for less than 4 bucks from China with slow shipping, or from various online dealers for $6-$10.

I combined mine with a tiny OTG adapter that slips inside the USB plug.
It's based on the RT5370 wireless chipset.

I like the open circuit board look, as it matches the Pi Zero nicely. However, there are other Raspbian compatible nano-dongle style WiFi adapters available for similar pricing (or sometimes even less) from various Raspberry Pi dealers.

My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

I have had nothing but good operation from WiPi dongles. They are $4.50 + $3.99 shipping at amazon. They do not need any additional drivers from any of the Raspbian versions so far! I have used them on B 1.0, B1.2, B+, A+, and 2B's

...
I also, obviously, don't have any way to connect this to the internet, which makes installing packages or updates all the more awkward, as I can't do apt-get or git clone or anything of that sort.

Thanks in advance!

I can't help you with the drivers, but I can help you with the problem I of no Internet access. Setup your Pi Zero as a USB Gadget.

USB Gadget mode turns the Pi Zero into a USB Ethernet/RNDIS Gadget network adapter. You can then use Zeroconf to SSH into raspberrypi.local, then you can share your Internet connection with the USB Ethernet gadget (ICS) and use VNC remote desktop (after turning on that service).

Install Etcher and use it to write the Raspbian image to your SD card.

You don't need to extract the image or format the card prior to writing.

Just choose the Raspbian .zip you downloaded, pick your SD card and write.

If you have trouble, verify the SHA256 checksum of the download.

Remove and reinsert the SD card so that your Windows or Mac PC can see the small FAT32 partition on the SD card (labelled "boot").

If you get a message telling you the card must be formatted, cancel it.

On the small FAT32 "boot" partition, create a file with the name ssh (or ssh.txt). It can be empty, the contents don't matter.

Now you'll need to edit 2 existing files.
Add this to the end of config.txt as a new line: dtoverlay=dwc2
Add this to the end of cmdline.txt after rootwait (with a single space between) without creating a new line: modules-load=dwc2,g_ether
Make sure you use a pure text editor like Notepad++ on those files, and that cmdline.txt is one long single line (no breaks).

All of these files are on the small FAT32 partition that is accessible to Windows/Mac computers (not in any folder).

That configures the Pi Zero to use USB Gadget mode, now to simplify your SSH/VNC connection you'll want the Zeroconf network service to resolve hostnames. For Windows you can install Apple's iTunes, Bonjour or Quicktime, but if you don't want to install unnecessary stuff, use WinRAR or 7-Zip to extract the Bonjour installer into a folder, and just install Bonjour.msi (32 bit) or Bonjour64.msi for the Zeroconf network service.

Now safely eject the SD card from your computer and install it into the slot on the Pi Zero. Next get a standard micro-USB cable and connect that to the USB data port of the Pi Zero (the one closer to the HDMI port), and don't connect anything to the other USB port. Finally, plug the other end of the micro-USB cable into your main (Windows/Mac) computer and the Pi Zero should start booting (green activity LED will flash intermittently).

Give the little Pi a minute or so to boot and you should be able to SSH into [email protected] from your main PC.

If you have trouble, check device manager and make sure your Pi Zero shows up as a USB Ethernet/RNDIS Gadget network adapter.
If that's not what you see, then something is wrong with your Windows system, as that's what should get installed automatically.

If all has gone well you can share your Internet connection from your main PC with the USB Gadget to give 'net access to your little Pi. If you want remote desktop control, use the raspi-config utility to turn on the VNC server (sudo raspi-config) and then install RealVNC Viewer on your main PC.

My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

USB Gadget mode turns the Pi Zero into a USB Ethernet/RNDIS Gadget network adapter. You can then use Zeroconf to SSH into raspberrypi.local, then you can share your Internet connection with the USB Ethernet gadget (ICS) and use VNC remote desktop (after turning on that service).

That looks like a very good idea, thanks for the suggestion and instructions - I'm going to try to get it to work normally first anyway, mainly since I don't want to have to sacrifice a USB port, and I'd really like to know what I've been doing wrong.
If I can't, though, and give up, this is definitely what I'll do.

# AP scanning/selection
# By default, wpa_supplicant requests driver to perform AP scanning and then
# uses the scan results to select a suitable AP. Another alternative is to
# allow the driver to take care of AP scanning and selection and use
# wpa_supplicant just to process EAPOL frames based on IEEE 802.11 association
# information from the driver.
# 1: wpa_supplicant initiates scanning and AP selection; if no APs matching to
# the currently enabled networks are found, a new network (IBSS or AP mode
# operation) may be initialized (if configured) (default)
# 0: driver takes care of scanning, AP selection, and IEEE 802.11 association
# parameters (e.g., WPA IE generation); this mode can also be used with
# non-WPA drivers when using IEEE 802.1X mode; do not try to associate with
# APs (i.e., external program needs to control association). This mode must
# also be used when using wired Ethernet drivers (including MACsec).
# 2: like 0, but associate with APs using security policy and SSID (but not
# BSSID); this can be used, e.g., with ndiswrapper and NDIS drivers to
# enable operation with hidden SSIDs and optimized roaming; in this mode,
# the network blocks in the configuration file are tried one by one until
# the driver reports successful association; each network block should have
# explicit security policy (i.e., only one option in the lists) for
# key_mgmt, pairwise, group, proto variables
# Note: ap_scan=2 should not be used with the nl80211 driver interface (the
# current Linux interface). ap_scan=1 is optimized work working with nl80211.
# For finding networks using hidden SSID, scan_ssid=1 in the network block can
# be used with nl80211.
# When using IBSS or AP mode, ap_scan=2 mode can force the new network to be
# created immediately regardless of scan results. ap_scan=1 mode will first try
# to scan for existing networks and only if no matches with the enabled
# networks are found, a new IBSS or AP mode network is created.

If your router ssid is hidden then you will need scan_ssid=1 in the network block.
If you use any other than WPA/WPA2 encryption then you may need other lines in the network block too.

With the
ap_scan=1
line and without, in case.
Nothing changed.
Note that the file I was using before was exactly as it came installed, only with the network={ block added - I didn't change anything else before this.
I'm not 100% sure the problem lies with wpa_supplicant (though it still could, I suppose) - since it says that lo is the only interface that exists, if wpa_supplicant was working, I'd still have no wlan0 interface, wouldn't I?

On Stretch, it recognises it, ifup returns, and wlan0 exists but it can't connect to the internet

I confess I'm mystified.

At one time there were issues with the Ralink 148f:7601 and @MrEngman posted drivers at http://www.fars-robotics.net/
However, there is nothing for the latest Raspbian (uname -r shows 4.9.59+) so I take it that the drivers are now included with Raspbian.
There is some discussion regarding Jessie here viewtopic.php?f=28&t=160246

Not very relevant, but I dug out an old Pi which has no wifi, burned Raspbian Lite and tested it with Edimax EW-78811UN, TP-Link TL-WN722N, Netgear WNA1000M and TP-Link TL-WL725N dongles. I have no idea what chipset these have, but they all connected to my wifi without a problem. I do recall problems with the TL-WL725N on a older release of Raspbian.

it says that lo is the only interface that exists
But in your first post you said
On Stretch, it recognises it, ifup returns, and wlan0 exists but it can't connect to the internet

That was in Raspbian Lite (also latest version), this was in non-Lite.

Maybe it's time to get a new Wifi dongle

That's why this is so painful,. I bought this like two weeks ago specifically for this purpose, and I can't really justify returning it given that there's nothing wrong with it - it works fine on Windows.

If disabling IPv6 doesn't work, I'll probably use it as a gadget and use SSH like the other guy suggested.
Edit: didn't make a difference.

Last edited by Sommanker on Sat Mar 03, 2018 7:28 pm, edited 1 time in total.

But, what purpose does disabling IPv6 have? Even without a route advertiser (radvd daemon) and a globally unique prefix/address (2001:: or 2E00::), IPv6 with fe80:: link local addresses are not on the same network layer as the WiFi hardware layer so can't have any effect on the hardware getting associated with the access point. The network layers are deliberately seperated from one another with a clearly defined interface for data transfer.

I've also now given up on using it as a gadget and booting through SSH, since Windows was having problems with drivers just doing that and it would mean I'd have to keep my main PC on all the time (which is why I'm using the pi in the first place) and sacrifice a USB port.
I'll probably go post in some more places in the hopes of finding a solution, failing that I guess I'll buy a Zero W or a new dongle.
I'll still be checking this too, though - but I'm not sure what more information I can provide, other than the fact that we don't actually know whether it's a problem with anything I've tried so far - the root problem right now is that, well, there are no interfaces installed at all.