how to restart an usb wifi stick

Thank you first for reading this post and answering it if you can.

I use a ZyAir 1201 usb wifi stick, but this device crashes from time to time, probably due to its firmware or kernel module. When it occurs, I get the following log message:

usb 5-3: wlan0: TX timeout, shooting down urb 

In order to let it work again, I need to physically remove it and replug it straight afterwards and reinitialize the tcp/ip parameters.

How can I do the same thing, but using software resources, such as the /sys/bus/usb pseudo-filesystem or maybe an external tool ?

I can remove it by using:

echo 1 > /sys/class/net/wlan0/device/remove

but how to reinitialize it ?

It is possible to reset the USB bus as outlined here

http://www.roman10.net/how-to-reset-usb-device-in-linux/
That will cause udev to re-detect the device (following the uevent reported by the kernel) and handle accordingly.

Thx for the tip, but it doesn’t work. The crash seems deeper. I’d need to switch off the power of the wifi stick, before switching it up again.

Well, then you’ll have to go through the process of physically removing and inserting again I guess.

I also tried

udevadm trigger

, and this Resetting the USB Bus under linux - ClearChain, but no way.

So you guessed right, but that’s what I wanted to avoid. Thx anyway for the help :wink:

[QUOTE=skylendar;2706311]I also tried

udevadm trigger

, and this Resetting the USB Bus under linux - ClearChain, but no way.

So you guessed right, but that’s what I wanted to avoid. Thx anyway for the help :wink:

Yes, I’ve used these in the past (just in the course of experimentation rather than necessity), and they’ve worked nicely for me eg have the notifier pop up again after a storage device plugged in, or have a 3G stick re-initialised. So, I though it was worth a shot, but resetting the bus isn’t the same as power-cycling, so your device obviously requires that to bring it back to a particular state.

On 2015-04-22 22:26, skylendar wrote:
>
> deano_ferrari;2706305 Wrote:
>> Well, then you’ll have to go through the process of physically removing
>> and inserting again I guess.

> So you guessed right, but that’s what I wanted to avoid. Thx anyway for
> the help :wink:

If the thing has a cable, open it up, identify the + wire, and insert a
n.c. push button…


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Gracias por el consejo, but I need a pure software solution, so that I can be off when my wifi goes amok.

On 2015-04-23 15:16, skylendar wrote:

>> If the thing has a cable, open it up, identify the + wire, and insert a
>> n.c. push button…

> Gracias por el consejo, but I need a pure software solution, so that I
> can be off when my wifi goes amok.

LOL.

There are gadgets for tinkerers. Possibly you get a switch via USB to
control a light or a motor. Could be used for this. But they are not
really cheap.

Easier would be getting a different wifi stick, one that really works in
Linux.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

MMh, already got a ralink based wifi usb stuff, but they are so numb that I prefer my old zyair