Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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 misc@openbsd.org. 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|improve this answer
    
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 Jul 17 at 21:41
1  
For what it's worth, I ran fw_update -v upon getting the Wifi working, and it reinstalled the urtwn firmware. –  Mike Jul 17 at 21:56
2  
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! –  damien Jul 17 at 22:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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