7

I have a desktop PC with Win 7 and Ubuntu 12.04 and default GRUB, also, i have a wifi USB adapter plugged which automatically connect to my personal wifi.

My problem is this:

when i boot into Win 7 the wifi works fine, then i reboot to ubuntu and the wifi doesn't work automatically. Is fixed if i plug the USB-wifi out and in again.

Weird thing is if I reboot from Ubuntu to Ubuntu (and the wifi was working) it connects automatically as it should. If i reboot from ubuntu to ubuntu and the wifi was not working it wont connect automatically.

So theres seems to be 'something' that messes up things in the very moment i boot to Windows 7 via GRUB.

¿how to fix that? i constantly change from one system to another so is quite annoying to plug the USB in and out every time.

Hardware info: USB wifi adapter: TP-Link TL-WN321G V4 using chipset: "ID 148f:2070 Ralink Technology, Corp. RT2070 Wireless Adapter" (got it from $ lsusb) it works via the driver: rt2800usb

This is a fresh install Jan 23 2013 fully up to date. I have this problem since 12.04 came out, and 12.10 wont fix it.

when the USB wifi is not working it still detects it:

$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 003: ID 046d:c52f Logitech, Inc. Wireless Mouse M305
Bus 002 Device 004: ID 4971:ce04 SimpleTech 
Bus 002 Device 005: ID 04cf:0022 Myson Century, Inc. OCZ Alchemy Series Elixir II Keyboard
Bus 002 Device 006: ID 148f:2070 Ralink Technology, Corp. RT2070 Wireless Adapter

then i unplug and plugin again:

$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 003: ID 046d:c52f Logitech, Inc. Wireless Mouse M305
Bus 002 Device 004: ID 4971:ce04 SimpleTech 
Bus 002 Device 005: ID 04cf:0022 Myson Century, Inc. OCZ Alchemy Series Elixir II Keyboard
Bus 002 Device 007: ID 148f:2070 Ralink Technology, Corp. RT2070 Wireless Adapter
    

and there is that small change.

EDIT 1:

after some reading i got additional information: (this happens when the wifi wont connect)

$ sudo ifup wlan0
[sudo] password for marcos: 
Ignoring unknown interface wlan0=wlan0.
$ iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11bg  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
      
eth0      no wireless extensions.
$ ifconfig wlan0
wlan0     Link encap:Ethernet  direcciónHW <hidden MAC address>  
          ACTIVO DIFUSIÓN MULTICAST  MTU:1500  Métrica:1
          Paquetes RX:0 errores:0 perdidos:0 overruns:0 frame:0
          Paquetes TX:0 errores:0 perdidos:0 overruns:0 carrier:0
          colisiones:0 long.colaTX:1000 
          Bytes RX:0 (0.0 B)  TX bytes:0 (0.0 B)

and this are the changes after i unplug and re-plug the USB wifi

$ iwconfig wlan0
wlan0     IEEE 802.11bg  ESSID:"Red de Lourdes"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: <hidden MAC address>   
          Bit Rate=54 Mb/s   Tx-Power=20 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=59/70  Signal level=-51 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:145  Invalid misc:96   Missed beacon:0
$ ifconfig wlan0
wlan0     Link encap:Ethernet  direcciónHW <hidden MAC address>  
          Direc. inet:<hidden IP address>  Difus.:<hidden IP address>  Másc:<hidden IP address>
          Dirección inet6: <hidden IPv6 address> Alcance:Enlace
          ACTIVO DIFUSIÓN FUNCIONANDO MULTICAST  MTU:1500  Métrica:1
          Paquetes RX:2108 errores:0 perdidos:0 overruns:0 frame:0
          Paquetes TX:2259 errores:0 perdidos:0 overruns:0 carrier:0
          colisiones:0 long.colaTX:1000 
          Bytes RX:845327 (845.3 KB)  TX bytes:395596 (395.5 KB)

Any way to make a Bash script to get the wireless to work? any other solution? is the GRUB at fault here?

3 Answers 3

2

You can activate the wlan by these commands instead of repluging:

sudo modprobe -r 8192eu
sudo modprobe 8192eu

You need change 8192eu to your own wlan name. If you don't know the name, search on google with keyword ID 148f:2070(your usb wlan's id which can be found by command lsusb).

Or you can just add the wlan name to /etc/modules:

sudo -i
echo 8192eu >> /etc/modules
exit

Then the wlan will be activated automatically when system start.

1
  • 1
    adding 'rtl8xxxu' into /etc/modules did not work for me with Edimax EW-8711UN ... wifi was always unavailable after fresh boot - found out later that the module was blacklisted by default and had to remove the default blacklist from /etc/modprobe.d/blacklist-*.conf
    – reukiodo
    Dec 2, 2021 at 15:45
1

First you need to identify the driver for your USB wifi adapter. Execute the following command to get the list of network adapters lshw -C network Following is the kind of output you might notice

  *-network:0
       description: Wireless interface
       physical id: 1
       bus info: usb@3:5
       logical name: wlx542aa25b496d
       serial: 54:2a:a2:5b:49:6d
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=rtl8xxxu driverversion=5.0.0-32-generic firmware=N/A ip=172.16.61.0 link=yes multicast=yes wireless=IEEE 802.11

Check the driver and note it down. Assume it is rtl8xxxu and you can use following commands to unplug or plug the adapter via commands

sudo modprobe -r rtl8xxxu
sudo modprobe rtl8xxxu

Since this again is manual invocation, you can add the commands in /etc/rc.local Add the following code just before exit 0

modprobe -r rtl8xxxu
sleep 1
modprobe rtl8xxxu

Int Ubuntu 18.04 the rc.local file doesn't exists, so you can create with sudo nano /etc/rc.local Add the following part which is taken from Ubuntu 16.04's stock /etc/rc.local file to automate it on system boot

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0

Then add the uplug/plug code before exit 0. You'll need to make the file executable by sudo chmod +x /etc/rc.local. Reboot and see if this works or not

1
  • adding 'modprobe rtl8xxxu' into /etc/rc.local is the only thing that allowed my Edimax EW-7811UN to work on boot (fresh or reboot) every time without fail
    – reukiodo
    Dec 1, 2021 at 6:18
0

This started happening to me after I installed Windows 10 alongside Ubuntu and I found SOLUTION on the link below that BIOS Secure Boot feature is causing the issue. No WI-FI adapter found after restarting

If you want to keep Secure Boot enabled, you can look into this article https://www.howtogeek.com/116569/htg-explains-how-windows-8s-secure-boot-feature-works-what-it-means-for-linux/ It mentions shim-signed package and how it might enable you to verify signatures... Don't know...

I disabled it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .