Tiny Core Linux

General TC => General TC Talk => Topic started by: GNUser on February 18, 2022, 08:19:50 AM

Title: [Solved] wlan1 sometimes does not exist after boot
Post by: GNUser on February 18, 2022, 08:19:50 AM
I run TCL13 x86_64 on a laptop. Laptop has an internal wifi card (wlan0) but I prefer to use a wireless usb adapter (wlan1), which is always plugged in.

About half the time, after boot both wireless interfaces are recognized (e.g., "ifconfig -a" shows both wlan0 and wlan1) and all is well. The other half the time, only wlan0 is recognized and don't know how to make wlan1 show up short of rebooting and hoping that it will show up after the reboot.

Two questions: Is there something I can do after boot to make wlan1 show up? Is there something that can be done during boot to make wlan1 be recognized more consistently?

PS: I've seen the "waitusb" boot code. Does it exist exactly for the kind of problem I'm experiencing? I didn't want to assume.

PS2: The laptop is used as a router and is not in a very accessible place. Therefore, unplugging/replugging the device is not an option.
Title: Re: wlan1 sometimes does not exist after boot
Post by: GNUser on February 18, 2022, 09:23:01 AM
I just checked and can confirm that this machine already boots with "waitusb=5", so my problem occurs despite me already using that boot code.
Title: Re: wlan1 sometimes does not exist after boot
Post by: curaga on February 18, 2022, 10:49:58 AM
waitusb is for slow usb sticks that you're using for tce/backup. For helping a wlan stick, it depends on why it's not showing up. For a driver issue, you can modprobe -r and modprobe the driver. If it drew too much power etc, you can disable and enable the usb hub/ports via /proc or /sys, I don't remember the details.
Title: Re: wlan1 sometimes does not exist after boot
Post by: GNUser on February 18, 2022, 10:55:40 AM
curaga, thanks for clarifying the intended use for waitusb. Next time the problem occurs, I will try both approaches you recommended and will report back.
Title: Re: wlan1 sometimes does not exist after boot
Post by: Rich on February 18, 2022, 11:47:12 AM
Hi GNUser
The first thing I would do is grab copies of  dmesg  and  /var/log/messages*  when it works and again when it fails.
It's possible they will provide clues to why  wlan1  doesn't always come up.
Title: Re: wlan1 sometimes does not exist after boot
Post by: GNUser on February 18, 2022, 12:37:32 PM
Hi, Rich. I have rebooted over 10 times and cannot get it to show up at all. Maybe the device was on its last leg and now it's totally dead.

I replaced the device with a different one and now wlan1 shows up after boot 100% of the time. (Old device was Atheros, new one is Ralink--unfortunately this introduces a lot of variables. It would be interesting to see if a brand-new Atheros would also show up after boot 100% of the time, but I don't have any new Atheros ones on hand.)

If I discover anything interesting I will update the thread. Thank you both for all your help! :)
Title: Re: wlan1 sometimes does not exist after boot
Post by: Rich on February 18, 2022, 01:13:06 PM
Hi GNUser
Logs of when it fails to show up could still provide clues. There just won't be good logs to compare against.
Title: Re: wlan1 sometimes does not exist after boot
Post by: GNUser on February 18, 2022, 03:19:55 PM
Hi, Rich. The usb adapter that acts up is made by Alfa and has an AR9271 chipset (one of these: https://tinyurl.com/5n6kkcsc). I grepped through the output of dmesg and these entries seem relevant:

Code: [Select]
usb 1-1: device descriptor read/64, error -110
usb 1-1: new high-speed USB device number 3 using ehci-pci
usb 1-1: device descriptor read/64, error -110
usb 1-1: device descriptor read/64, error -110
usb usb1-port1: attempt power cycle
usb 1-1: new high-speed USB device number 4 using ehci-pci
usb 1-1: device not accepting address 4, error -110
usb 1-1: new high-speed USB device number 5 using ehci-pci

Do these errors mean anything to you? A quick internet search suggests that the error has something to do with insufficient power (e.g., https://askubuntu.com/a/644014). The laptop is old and always has the wireless adapter as well as two other USB devices plugged in. Maybe the three devices together demand more power than the laptop can provide.

The replacement usb adapter that is working consistently is made by Ralink and has the RT5370 chipset (one of these: https://tinyurl.com/2p97tw34)


Title: Re: wlan1 sometimes does not exist after boot
Post by: patrikg on February 18, 2022, 04:05:52 PM
If you wish you could try to connect the adapter to Powered usb hub and then to the network adapter.
To amplify the power, to the network adapter.
Title: Re: wlan1 sometimes does not exist after boot
Post by: Rich on February 18, 2022, 05:33:26 PM
Hi GNUser
Error 110 is a timeout error which could be caused by many things, including a failing USB peripheral.
A powered USB hub could be used to confirm if it's a power issue. It could also be used to power all external
USB devices and remove that load from the laptop.

... PS2: The laptop is used as a router and is not in a very accessible place. ...
Some laptops have a little fan with vents on the bottom to pull in air. A side effect of this design is the laptop
functions as a mini vacuum cleaner, pulling in dust and increasing it's internal temperature. If yours is designed
this way, consider propping it up so there is a large open area around that intake. This will reduce how much
dust gets sucked in.
Title: Re: wlan1 sometimes does not exist after boot
Post by: GNUser on February 18, 2022, 08:43:15 PM
Thank you, patrikg and Rich, for the excellent advice. I have created some extra room around the laptop to increase cooling and decrease dust intake. I will look into getting a powered usb hub. I'll report back eventually. In the meantime, the Ralink device will tide me over.
Title: Re: wlan1 sometimes does not exist after boot
Post by: gadget42 on February 19, 2022, 06:17:59 AM
while looking into the exhaust side of the airflow path, shine a flashlight into the intake side. you should see an unobstructed path all the way across the radiator. pet hair is the great enemy of a cool running machine...go figure.

sharing is caring
Title: Re: wlan1 sometimes does not exist after boot
Post by: GNUser on February 20, 2022, 12:53:10 PM
A powered USB hub made wlan1 show up consistently. Plus I cleared some space around the laptop (including beneath it) to keep it cool. And I also stopped using the "waitusb" boot code now that I know it has nothing to do with this issue.

Thank you all so much for sharing your insights. You guys are one sharp bunch. The issue is 100% solved :)
Title: Re: [Solved] wlan1 sometimes does not exist after boot
Post by: Rich on February 20, 2022, 01:09:07 PM
Hi GNUser
Thank you for the update and congratulations on your success.
Thread has been marked as solved.
Title: Re: [Solved] wlan1 sometimes does not exist after boot
Post by: CentralWare on February 21, 2022, 03:40:19 AM
@GNUser: The concept of a wall-powered laptop not being able to power a radio (wifi) sounds rather odd, considering how much the average radio draws versus something like the CPU fan, which is likely to draw quite a bit more than something plugged into USB.  Since you have introduced a powered USB hub and seemingly have a working platform, you've added two new things to the mix: fresh copper pads (the USB sockets the radio plugs into) and Vcc (a secondary power supply).

The radio has four pins inside the connector, Vcc (5v "plus"), Ground, and the two pins in the middle are Data.  I'm betting one or both of the outside pins are oxidized, making a poor connection with the laptop's USB pins, which are also possible to have the same symptoms.

Title: Re: [Solved] wlan1 sometimes does not exist after boot
Post by: Rich on February 21, 2022, 09:32:58 AM
Hi centralware
@GNUser: The concept of a wall-powered laptop not being able to power a radio (wifi) sounds rather odd, ...
I guess you missed this part:
... The laptop is old and always has the wireless adapter as well as two other USB devices plugged in. ...

Quote
... Since you have introduced a powered USB hub and seemingly have a working platform, you've added two new things to the mix: fresh copper pads (the USB sockets the radio plugs into) and Vcc (a secondary power supply). ...
Yes, but prior to adding the powered hub he did this:
... I replaced the device with a different one and now wlan1 shows up after boot 100% of the time. (Old device was Atheros, new one is Ralink ...
Title: Re: [Solved] wlan1 sometimes does not exist after boot
Post by: gadget42 on February 21, 2022, 02:05:40 PM
re: cleaning electronics/plastics/etc...

make sure you ONLY use PLASTIC SAFE contact cleaner!!!

use the non-plastic type and your plastics will NEVER be the same EVER again!

sharing is caring
Title: Re: [Solved] wlan1 sometimes does not exist after boot
Post by: CentralWare on February 22, 2022, 03:02:56 AM
@Rich:
Quote
... I replaced the device with a different one and now wlan1 shows up after boot 100% of the time. (Old device was Atheros, new one is Ralink ...
Correct; thus why I responded.  (Atheros sounds to be oxy/corroded and if it's been sitting in the same USB port for some time, this tends to be shared with the host port.)

@gadget42: I suggested iso alcohol as a starting point, not contact cleaner.  Being a 30+ year veteran engineer and Master C.E.T., I try not to advise people to use chemicals they're unfamiliar with.  If symptoms improve after my recommendation (theory realized) but aren't perfect or are intermittent, I usually suggest a technician; some of the chemicals in my truck for electronics requires PUCO/DOT licensing just to tote them around; I'm surely not going to assume someone on a forum I've never met has a clue how to use, handle, dispose of and not blow themselves up with one of these items!  Additionally, "plastic" is hardly a term that can be used considering the numerous materials that are used to manufacture jacks, edge-card connectors, sockets and other male/female devices.  These materials range from polyurethane based compounds (aka: Thermo-Plastics) to ABS and Nylon; all of which would react differently to certain acidic and/or corrosive chemicals, thus the suggestion around Iso Alcohol - it's readily available, a "reasonably good" cleaning agent, dries quickly, low electronics risk factor and save for being flammable, you don't hear about people exploding/detonating anything due to iso fumes.
Title: Re: [Solved] wlan1 sometimes does not exist after boot
Post by: Rich on February 22, 2022, 09:01:40 AM
Hi centralware
... (Atheros sounds to be oxy/corroded ...
My mistake. I misread what you wrote. I thought you were refering to the laptops USB port.  :-[
Title: Re: [Solved] wlan1 sometimes does not exist after boot
Post by: gadget42 on February 22, 2022, 11:32:14 AM
most folks are familiar with walmart and they carry one of our favorites:
https://www.walmart.com/ip/CRC-Electronic-Cleaner-Quick-Dry-for-Sensitive-Electronics-11-oz/16817418
Title: Re: [Solved] wlan1 sometimes does not exist after boot
Post by: CentralWare on February 23, 2022, 01:34:44 PM
@gadget42: I've used that can once on an old dial-style am/fm radio; it could just be the scenario at hand, but it seemed to have left a white powdery residue when it dried; thus we've avoided it since.  Any similar results on your end?
@Rich: The sad truth to electronics (physics with metals in general, too) is when two different metals make contact over a period of time, the composition tends to lead to a chemical reaction between the metals.  For example, back in the day when all homes and businesses were piped with copper water lines...  many people used (much cheaper) steel and aluminum/tin straps to bolt the plumbing to the structure - which on the date of the installation looks just as professional, but because of the different metals being pressed against one another for long periods of time, it causes a special type of break-down.
See: https://www.google.com/search?q=galvanic+corrosion
Now the funny part with electronics (such as USB ports, PCI, etc.) is people talk about how gold pads on cards make for better conductivity - which is true...  however, if the partnering side is not also gold (most are copper) you run into the same situation.
In the Op's case, there's a very good chance the WiFi PCB is "coated" (oxidized) and if it's true, the female pins within the laptop are also subject to the same residue.  When you make a clean connection (new USB hub, especially if self powered) you're taking pins 1 and 4 out of the equation.  Remove the power from the hub and you're likely to start seeing problems.  (A USB Port voltage meter would be a good way to prove the situation as to whether or not there's ample juice to power the WiFi device; wiggle the meter in the USB socket and it may even black out if connectivity is that bad.) From a technician's perspective, both the device and the laptop are burnished/cleaned, tested for proper feed voltage and ground and then burn-tested to ensure the problem no longer exists. (Granted, in today's day, most techs working on an old XP laptop would instead respond with "...it's old.  Get a real machine!"  Sad to imagine what they think about older people instead of tech.
Title: Re: [Solved] wlan1 sometimes does not exist after boot
Post by: gadget42 on February 23, 2022, 02:15:20 PM
@centralware: it will sometimes haze any residual flux left over from soldering(a cotton swap and a little extra flushing usually gets rid of that). other times it will flush out old/caked/dried-out lubricants and those can leave powder/residue/streaks/traces(again, cotton swaps and some extra flushing usually washes it away)

also regarding the "what they think about older people"...

https://en.wikipedia.org/wiki/Soylent_Green

or perhaps:

https://en.wikipedia.org/wiki/The_Obsolete_Man

sharing is caring
Title: Re: [Solved] wlan1 sometimes does not exist after boot
Post by: Rich on February 24, 2022, 12:33:52 AM
Hi centralware
Yes, I'm familiar with galvanic reactions. 25 years ago I started sailing when my friend got a sailboat. I've freed
up my share of Stainless steel screws holding Aluminum fittings. Those 2 are pretty much at the opposite ends
of the galvanic series.
Title: Re: [Solved] wlan1 sometimes does not exist after boot
Post by: CentralWare on February 24, 2022, 04:50:36 AM
@gadget: It's time to grind up the neighbors!  (Cover reads: "...It's the year 2022...")
Thanks for the 5-in-the-morning grin to both of you!
Title: Re: [Solved] wlan1 sometimes does not exist after boot
Post by: gadget42 on February 24, 2022, 09:51:39 AM
i'd rather be sailing...

speaking of sailing:
https://badnarik.org/category/sailing/

as always, YMMV(your mileage may vary)

sharing is caring