OpenBSD failing to load firmware of supposedly supported WiFi USB adapter

9,674

First things first: your hostname.urtwn0 file looks good and if you had a mistake in there you'd get completely different error messages.

The message urtwn0: failed loadfirmware of file urtwn-rt18192cfwT (error 2) indicates that the firmware isn't installed in the proper location:

As explained in loadfirmware(9), this function returns errno style error codes: and errno(2) explains:

2 ENOENT No such file or directory.
    A component of a specified pathname did not exist, or the pathname
    was an empty string.

There should be a file /etc/firmware/urtwn-rt18192cfwT for the driver to load.1 Most likely you won't find this file in your tree.

1See the end of the answer for more details


Assuming you have some way of connecting your box to the internet:

Try running fw_update -v to install the firmware and ensure that the files are in the right place and not corrupted. If you're lucky, that's all you need to do.

If this fails, you can try to install the firmware from packages or ports (read this FAQ first!). My local mirror doesn't have any urtwn-related packages, so you probably need to use the ports tree.

Set up the ports tree as explained in the FAQ, then run make install as root from /usr/ports/sysutils/firmware/urtwn.


If you can't connect your box to the internet:

The firmware can be downloaded by hand from http://firmware.openbsd.org/firmware-dist/urtwn-1.1p0.tgz. Grab it from there, throw it on a USB stick and copy it to your OpenBSD box. Extract the archive and move the files urtwn-* to /etc/firmware/.

If this works, it is a good idea to run fw_update -v once you have network connectivity. That way, the firmware will be monitored and upgraded if necessary by the system maintenance scripts.


If all this doesn't help, you should probably ask on the mailing lists. The people there are generally friendly and helpful if you've done your homework2.

2 The driver is mentioned a few times on [email protected]. For example, there were some usb-related issues, check if anything might be related to what you see before posting.


Added:

I now looked at the source code, and the only way you can get this error message is from the function urtwn_load_firmware(), in sys/dev/usb/if_urtwn.c at line 2194:

   /* Read firmware image from the filesystem. */
   if ((sc->chip & (URTWN_CHIP_UMC_A_CUT | URTWN_CHIP_92C)) ==
       URTWN_CHIP_UMC_A_CUT)
           name = "urtwn-rtl8192cfwU";
   else
           name = "urtwn-rtl8192cfwT";
   if ((error = loadfirmware(name, &fw, &len)) != 0) {
           printf("%s: failed loadfirmware of file %s (error %d)\n",
               sc->sc_dev.dv_xname, name, error);
           return (error);
   }

The function loadfirmware() (in sys/dev/firmload.c) generates the path /etc/firmware/urtwn-rtl8192cfwT and tries to load that file into the memory of your USB adapter. Since it can't find the file, you get the error message you reported.

Share:
9,674

Related videos on Youtube

Mike
Author by

Mike

Updated on September 18, 2022

Comments

  • Mike
    Mike almost 2 years

    I recently bought an Edimax EW-7811Un WiFi USB adapter on Amazon. A handful of OpenBSD users have reported success with it, and it's listed as being supported by urtwn(4) in its man pages.

    I'm currently running OpenBSD 5.5 amd64 (downloaded last weekend) on an Asus netbook. The wireless adapter is recognized as urtwn0, as expected, and it is reported as such when I insert or remove it. I created /etc/hostname.urtwn0 as described in the man page, with the following contents:

    nwid mynetwork
    wpakey mykey
    dhcp
    

    where mynetwork and mykey are my Wifi network name and password, respectively. The network is actually WPA2, which could have caused issues of its own, but the OS seems to be unable to even load the firmware. When I execute sh /etc/netstart urtwn0, I get the following output:

    urtwn0: failed loadfirmware of file urtwn-rt18192cfwT (error 2)
    urtwn0: no link ............ sleeping
    

    Is it possible that the firmware is corrupted? This is my first time using the adapter. More likely, has Edimax changed the firmware and broken OpenBSD's current urtwn implementation? Also likely, am I just making a dumb mistake?

  • Mike
    Mike almost 10 years
    Success! Thanks so much! I downloaded the firmware and copied it over with a USB drive. Out of curiosity, why wasn't the firmware included with the install? It seems pretty small and innocuous, and getting network connectivity firmware onto a machine is often a pain.
  • Mike
    Mike almost 10 years
    For what it's worth, I ran fw_update -v upon getting the Wifi working, and it reinstalled the urtwn firmware.
  • damien
    damien almost 10 years
    Great, glad to hear that! I don't know why this firmware blob wasn't included in the installer, the license would seem to permit it and I agree that this would have been much more convenient :-) I'm unsure about the details of the exact considerations that go into the final decision which firmware is distributed and which isn't. Number of downloads, maybe? // Yes, issuing fw_update -v is a very good idea. I should have said that in my answer (now edited in): that way this file will be monitored by the system maintenance scripts. Have fun!
  • Rui F Ribeiro
    Rui F Ribeiro about 7 years
    This has got to be the best source out there out to proceed to use a proprietary firmware in OpenBSD. +1