3

I'm running Ubuntu 14.04 on my HP 15-P234TX laptop. Every time I close the lid or suspend it the wireless stops working until I reboot the whole thing. I can't click on the enable wifi as it says "wifi is disabled by hardware switch". As far as I can tell I don't have a switch anywhere on the case. I've tried running rfkill list all and get the following

rfkill list all

1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: yes

rfkill unblock all has no effect

__

lspci -knn | grep Net -A2

08:00.0 Network controller [0280]: Intel Corporation Wireless 3160 [8086:08b3] (
rev 83)
Subsystem: Intel Corporation Dual Band Wireless-AC 3160 [8086:0070]
Kernel driver in use: iwlwifi

How do I fix this?

6
  • Please edit your question to add the exact model number of your HP Pavilion. Welcome to askubuntu.
    – chili555
    Jun 4, 2015 at 14:05
  • Did you try to unblock it using sudo rfkill unblock all command? Does it work?
    – Pilot6
    Jun 5, 2015 at 6:32
  • And also please edit your question and add output of lspci -knn | grep Net -A2 terminal command.
    – Pilot6
    Jun 5, 2015 at 6:33
  • I tried sudo rfkill unblock all and it seems to have no effect
    – Snowflake
    Jun 5, 2015 at 6:37
  • most likely it IS a hardware lock. A keyboard lock would be the 1st suspect (Fn F2 or so?)
    – Rinzwind
    Feb 22, 2016 at 18:32

1 Answer 1

1

This systemd script which reloads the WiFi kernel module when resuming from suspend. It comes from this answer: Wifi available networks not showing up suddenly:

This script is written for iwlwifi` which is the common Intel driver name. If your's is different change that name below:

#!/bin/sh

# NAME: /lib/systemd/system-sleep/iwlwifi-reset
# DESC: Resets Intel WiFi which can be flakey after a long suspend.
# DATE: Apr 1, 2017. Modified August 30, 2017.

MYNAME=$0

exit

restart_wifi() {
    /usr/bin/logger $MYNAME 'restart_wifi BEGIN'
    /sbin/modprobe -v -r iwldvm # This removes iwlwifi too
    /sbin/modprobe -v iwlwifi   # This starts iwldvm too
#    systemctl restart NetworkManager.service
    /usr/bin/logger 'systemctl restart NetworkManager.service (SUPPRESSED)'
    /usr/bin/logger $MYNAME 'restart_wifi END'
}

/usr/bin/logger $MYNAME 'case=[' ${1}' ]'
case "${1}/${2}" in
    hibernate|suspend|pre*)
      ;;
    resume|thaw|post*)
      restart_wifi;;
esac

NOTE: Sometimes simply resetting network manager is all that is needed. In that case un-comment the line above by removing #. Then comment out the two lines above it by putting # at the beginning of those two lines.

You'll need to create this script, called iwlwifi-reset, with sudo powers and save it into the directory /lib/systemd/system-sleep. Then mark it executable using:

chmod a+x /lib/systemd/system-sleep/iwlwifi-reset

You must log in to answer this question.

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