Network card doesn't get auto detected when OS reboot

I’ve noticed this issue since I installed EnOS. I have a USB-connected WiFi network card or a dongle. Card gets detected and gets powered on when I do a shutdown and boot or in other words a cold boot. But when I do an EnOS restart card doesn’t get detected. But when I remove the card and insert it, EnOS detects the card and starts working flawlessly until I do a reboot.

This is the details of my card,

sinux at sinux-pch in ~
↪ ethtool -i wlan0
driver: mt7601u
version: 5.10.54-1-lts
firmware-version: N/A
expansion-rom-version: 
bus-info: 1-9.2:1.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

While searching I found another thread with the same issue but I think that person described the issue wrongly.

This is the link to the old post.

He’s describing the same issue but he’s saying WiFi drops. It’s not the connection it’s the card not getting loaded or powered on when rebooted. When a shutdown and boot happens it works without any issue. Actually, it works better than my LAN.

I’m also sorry if I’m double posting, I didn’t want to necrobump the post, and that post is still open.

Can you post the output of:
inxi -Na

Network:   Device-1: Intel Ethernet I219-V vendor: ASUSTeK driver: e1000e v: kernel port: f040 bus-ID: 00:1f.6 
           chip-ID: 8086:15b8 class-ID: 0200 
           Device-2: Ralink MT7601U Wireless Adapter type: USB driver: mt7601u bus-ID: 1-9.2:10 chip-ID: 148f:7601 
           class-ID: 0000 serial: 1.0

Device-1 is my onboard LAN which has not issues. Second is my USB WiFi dongle that fails to get detected when rebooted.

Okay i see it’s another one of those Ralink chips.

Edit:
Unfortunately that chip doesn’t have support much for it anymore.

Yes my friend. It’s not a new chip, it’s old but it supports monitor mode (you know what I mean :stuck_out_tongue: ). It’s strange why it works when rebooted or reinserted after a reboot but not after an actual reboot.

Not sure if you can install from here?

https://www.mediatek.com/products/broadbandWifi/mt7601u

I’ll give it a try tomorrow. And update here. Thank you friend. But according to the Arch wiki kernal has inbuilt support since 2014 for this chipset.

You are probably right I just wanted you to check if it’s older or same driver version. There is a driver in the AUR which is the dkms version. Not sure it’s any better or worse.

I’ll use the driver from the site you post and then will try DKM’s if the first option fails.

You can try with a startup script that does

ifconfig wlan0 disable
sleep 5s
ifconfig wlan0 enable

P.S. See if it works after reboot by manually typing in terminal

You can also try to disable power save with sudo iwconfig wlan0 power off

@s4ndm4n

Check out this post i remember from earlier same wifi chip.

I tried @Dev0ut suggestion which didn’t work. Because the USB dongle is not detected. Below is the output.

sinux at sinux-pch in ~
↪ ifconfig wlan0 disable
disable: Unknown host
ifconfig: `--help' gives usage information.
sinux at sinux-pch in ~
↪ sudo ifconfig wlan0 disable
[sudo] password for sinux: 
disable: Unknown host
ifconfig: `--help' gives usage information.
sinux at sinux-pch in ~
↪ sudo ifconfig wlan0 enable
enable: Unknown host
ifconfig: `--help' gives usage information.

I’ve to try the drivers and see but I’m kind of scared because AUR seems to have caused an issue and don’t know if compiling from source would end up my wifi disabled.

This is the latest i can find. It is in the AUR. It’s dated 2020

https://aur.archlinux.org/packages/mt7601u-dkms-git/

Curious, btw can you post iwconfig output after the issue occurs?

Also, try to add to GRUB_CMDLINE_LINUX_DEFAULT usbcore.autosuspend=-1

I had totally forgotten about that parameter. :slightly_smiling_face:

I find here documentation: https://www.kernel.org/doc/Documentation/usb/power-management.txt

1 Like

@Dev0ut
If you read through which i just quickly skimmed it say’s.

The USB specification states that all USB devices must support power
management. Nevertheless, the sad fact is that many devices do not
support it very well. You can suspend them all right, but when you
try to resume them they disconnect themselves from the USB bus or
they stop working entirely. This seems to be especially prevalent
among printers and scanners, but plenty of other types of device have
the same deficiency.

For this reason, by default the kernel disables autosuspend (the
power/control attribute is initialized to “on”) for all devices other
than hubs. Hubs, at least, appear to be reasonably well-behaved in this regard.

Oh, so it’s already disabled and would be redundant, right?

Good to know :smiley:

Well that’s just what the documentation say’s and i only skimmed it real quick. It’s quite a few pages so i didn’t read it all only what i picked up on quickly with a glance.

@Dev0ut
He could check modinfo usbcore & lsmod?

Do you think that it’s worth trying that parameter?

If a driver knows that its device has proper suspend/resume support,
it can enable autosuspend all by itself.  For example, the video
driver for a laptop's webcam might do this (in recent kernels they
do), since these devices are rarely used and so should normally be
autosuspended.

From what I’ve understood the driver might force it