Score:0

Is there any way to reload a modprobe module once every certain period of time?

cn flag

Link USB wireless adapter which disconnects every 30 minutes, and the only way to make it work again is by reloading its module ath9k_htc by running command rmmod ath9k_htc and then modprobe ath9k_htc

Is there any way to make the module reload itself every half hour?!!!

David avatar
cn flag
Instead of a re start every 30 mins maybe ask why it is doing this disconnect.
zakaria oussete  avatar
cn flag
I've already done that I looked up the whole internet seeking for a fix but this is the only way out sadly :(
cn flag
But you did not ask us about that? :-) Why not make a new topic about trying to find a fix for the disconnecting. There is likely an error notice somewhere. Just got to track that down and someone will know something about it. We have some brilliant wireless gurus here on AU.
Score:3
cn flag

Create a cron job to check the connectivity every 1 min.

sudo vi /etc/crontab 

then add the following line

* * * * * root /usr/bin/ping -c2 8.8.8.8 || /usr/sbin/modprobe -r ath9k_htc && sleep 0.5 && /usr/sbin/modprobe ath9k_htc
zakaria oussete  avatar
cn flag
Thanks for fast replaying but please can you tell me what 0.5 stand for ?!!
cn flag
0.5 means half a second.
Score:0
cn flag

Your wireless may be dropping because of power management; that is, the feature where the card partially powers down to save battery power during periods of inactivity and then, ideally, powers back up seamlessly when activity resumes. Let's disable power saving to see if it helps. From the terminal:

sudo sed -i 's/3/2/' /etc/NetworkManager/conf.d/*

Your wireless may be dropping because the channel to which it was connected has suddenly changed.

Please check the settings in the router. WPA2-AES is preferred; not any WPA and WPA2 mixed mode and certainly not TKIP. Second, if your router is capable of N speeds, you may have better connectivity with a channel width of 20 MHz in the 2.4 GHz band instead of automatic 20/40 MHz, although it is likely to affect N speeds. I recommend a fixed channel, either 1, 6 or 11, rather than automatic channel selection. Also, be certain the router is not set to use N speeds only; auto B, G and N is preferred.

Your wireless may be dropping because there are two wireless access points with the same name and password. This is typical when you have a 2.4 gHz segment and a 5 gHz segment of the same router. Your wireless may be roaming, looking for a better connection. If this is the case, I suggest that you rename the access points; something like myrouter2.4 and myrouter5.

After making these changes, reboot the router.

Next, I recommend that your regulatory domain be set explicitly. Check yours:

sudo iw reg get

If you get 00, that is a one-size-maybe-fits-all setting. Find yours here: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 Then set it temporarily:

sudo iw reg set IS

Of course, substitute your country code if not Iceland. Set it permanently:

sudo nano /etc/default/crda

Change the last line to read:

REGDOMAIN=IS

Proofread carefully, save and close the text editor.

Is there any improvement?

ru flag
You've been around long enough to know that constantly posting the exact same answer raises a few questions and autoflags the moderators for "duplicate post" concerns. Is there a reason you're posting this answer to multiple different posts, instead of simply suggesting duplicate closes or such? Also, OP is asking a different question to what you're answering.
chili555 avatar
cn flag
OP has an X-Y problem. He wants to reload the driver module to get the wireless to reconnect. As was pointed out above, the question should be, how can we stop the dropping in the first place. In many cases, it is solvable by tweaks in the router. Going forward, I will suggest duplicates. Thanks. @ThomasWard
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.