site  contact  subhomenews

USB wifi fixed

June 18, 2008 — BarryK
Ah, it is so nice to have the hardware to test, rather than relying on sending questions and answers backwards and forwards via the forum and blog!

About a week ago I purchased a D-Link USB wireless networking device, model DWA-110. This has a cable, one end of which is a heavy base onto which the USB wireless unit plugs. I've got it sitting on the top of my desktop PC right now, and using right now also.

In my previous post I mentioned a common complaint that the Networking Wizard works, but that there is no Internet connection after a reboot. Well, I had the same experience. I am running 4.1alpha with the 2.6.25.4 kernel, and at bootup all of these kernel modules automatically loaded:

rt73usb, rt2x00usb, rt2x00lib, rfkill, input_polldev, crc_itu_t, mac80211, cfg80211

This PC also has a Netgear PCI wifi card, that uses the acx module, so I ran the BootManager and blacklisted the acx module. I don't know what would happen leaving it loaded, so played safe. Then rebooted.

I then ran the Wizard, and hey I was connected right off, no hassles. Note, I have an open network, which does simplify things. Great I thought, but after a reboot there was no Blinky, no Internet. But then there is that possible solution that I mentioned in the previous post...

Yes indeed. /etc/rc.d/rc.network logs its stdout to /tmp/bootsysinit.log, and looking at that I saw that the 'wlan0' interface was not available when 'ifconfig -a' executed. So, I put in a loop to wait for the interface, which fixed that.

But still no Blinky. But I noticed something else in rc.network. There is a line 'ifconfig $INTERFACE down' just before dhcpcd is executed. It has always been there, but I do not understand why. I suppose that dhcpcd brings the interface up again, which it must do in most cases as the script works fine for most cases. Anyway, I commented-out the 'ifconfig $INTERFACE down' and that fixed it!

...but will that cause trouble for other hardware?

This pup boots so fast. The new module loading system is very fast. It also means that the X desktop is there and there is a long wait before Blinky appears. So I think I might also add an informational message at the top of the screen that the network connection is being negotiated.

The two fixes should also work for earlier puppies. The single line that sets INTERFACE needs to be replaced with this:

#v403 wait for interfaces...
echo -n "Waiting for interfaces... "
sleep 2
WAITCNT=2
INTERFACES=""
WANTINTS="`ls -1 /etc/*mode | sed -e 's%/etc/%%' | sed -e 's%mode%%'`"
for WANTONE in $WANTINTS
do
while [ $WAITCNT -lt 12 ];do
INTERFACES=" `ifconfig -a | grep 'Link encap:Ethernet' | cut -f 1 -d ' '`"
[ "`echo $INTERFACES | grep "$WANTONE"`" != "" ] && break
echo -n "$WAITCNT "
WAITCNT=`expr $WAITCNT + 2`
sleep 2
done
done
echo


And further down comment out this line:
#i think should bring ${INTERFACE} down first, then bring up again...
#v403 why do we have to take it down here? commented out...
#ifconfig ${INTERFACE} down


Oh yes, there was an earlier 'sleep 3' that I removed. I also simplified the loop that tests for an alive network. Er, perhaps I should just upload the whole file somewhere... Okay, it's here:

Comments

WLAN Router
Username: ANOSage
I have a KCorp 4-port wireless router (and a matching PCI card) sitting around in my spares box this last few years. KLS-6615, 802.11g. Although I've little interest in wireless comms. for viable daily operation (I have my house wired for real security!), as an HW junkie, I'd be interested to know if would work with Puppy? Feel free to delete this, or move it to the Forum if it can be accompanied by your recent blog offerings on the subject, Barry.

Wired static settings lost
Username: dogone
"Barry. I swapped in your new rc.network, rebooted and my static IP wired (RealTek RTL-8139) connection did not come up. Running the network wizard, I found the IP and Gateway addresses blank. I re-entered both and the wired connection came up. However, both these addresses are forgotten at reboot. The same thing happens under Puppy 400.

Ready to test
Username: Rarsa
"I will certainly test the fix. It sounds better than an old request for the wizard to add a "delay" field. Additionally we should start making the recommendation for NOT hiding the essid on the router. This seems like a counter intuitive recommendation but one that will make the network more secure and avoid a lot of connection headaches. Some wireless drivers have trouble with Hidden SSIDs mainly because hiding it is not recommended security wise.

It's fixed for broadcom!
Username: Rarsa
"I implemented your fix and now my broadcom connection is coming up at boot! I'm sure many people will be very happy with this fix. Me included. My interface uses the bcm43xx driver. (Although I think this one should be replaced by the more stable b43 driver

WiFi on Classmate
Username: tronkel
"This script has fixed Wifi on the Classmate PC which previously would not work with Puppy Alpha 4.02 at all. The rt73usb-driven interface was invisible in the connection wizard, but could be loaded manually afterwards. On trying to connect via DHCP, an IP address was found apparently, but the network would then still not come up. With this new rc.network script though, the classmate now has a wireless network connection using rt73usb that gets remembered on the next boot. This is the first time ever that the classmate has remembered the WLAN0 configuration over subsequent reboots .... Yippee! Also seems OK on the wife's HP nx6110 laptop. So full steam ahead with testing on 4.02. Looking forward to 4.03. Any forecast available as to when that might be approx?

Wired Network Settings
Username: dogone
"Despite my wired IP and Gateway addresses disappearing from the Network Wizard after each boot (with the revised rc.network), I find that /etc/ethmode contains all the right information: < ifconfig eth0 192.168.1.200 netmask 255.255.255.0 broadcast 192.168.1.255 up route add -net default gw 192.168.1.1 > Files /etc/hosts and resolv.conf appear correct as well.

Re: static networking
Username: BarryK
"dogone, okay, I think I know, maybe... Edit /etc/eth0mode and insert this line first: ifconfig eth0 down

Re: static networking
Username: dogone
"Barry. I ran Network Wizard, configured eth0 and tested the connection. I then added "ifconfig eth0 down" at the top of /etc/eth0mode and rebooted. No luck. The machine's IP and Gateway addresses were lost with the reboot. DNS addresses remained intact, as did the edit to /etc/eth0mode.

Re: ifconfig
Username: BarryK
"dogone, the removal of 'ifconfig eth0 down' from rc.network was the only change that would affect you. So I don't see why you are continuing to have that problem.

Re: ifconfig
Username: dogone
"Well, "the fact is" that as soon as I replaced the existing rc.network (by downloading your revised file) in either/both Puppy 400 or 402, static configuration of my wired connection (eth0) failed to be retained across a reboot. In both cases I can reverse the effect by restoring the original rc.network. Perhaps we need to find another user of static IP who can confirm these observations.

Re: static network setup
Username: BarryK
"I just tested the Wizard choosing to setup my network statically. Using the new rc.network, it works when I reboot, using it now. So I don't understand why dogone is having a problem -- will need testing by others to confirm this problem.

Re: static network setup
Username: dogone
"Barry, I downloaded a fresh copy of your revised rc.network and rebooted. Again, my IP and gateway addresses were not retained. For your info, I'm booting Puppy (400/402) from CD, using Pup_save files on my flash key. IOW, I insert the Puppy disk du jour and select the appropriate save file...one way of managing a litter of Puppies. If anyone reading employs a static IP or would care to test Barry's new rc.network, please review this thread and test your install. We need more feedback.


Tags: puppy