I have a problem with RPi and WiFi channel changing. As I discovered these days - RPi determines channel only during boot procces. And this is an issue. If I log in to my AP (mikrotik) and change frequency to any another - RPi always disapear and does not appear anymore untill one of bellow items becomes true:

  1. Restoring frequency/channel that was actual on RPi boot time
  2. RPi reboot.


RPi: 2 model B

OS: Raspbian Jessie

WiFi: 2.4Ghz 801.11n with SSID hidden

I want to fix this issue and make able autoreestablishing WiFi connection without rebooting RPi, because I use "Channel: auto" on my AP and don't want to disable the feature.

Please help me to fix.

---------------- Additional info ---------------------

cat /etc/network/interfaces | egrep -v "^\#"

source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev


   proto=WPA2          # can be RSN (for WPA2) or WPA (for WPA1)
   key_mgmt=WPA-PSK    # can be WPA-PSK or WPA_EAP (for enterprise networks)
   pairwise=CCMP       # can be CCMP( for WPA2) or TKIP (for WPA1), or both
   auth_alg=OPEN       # can be OPEN, LEAP and SHARED
  • In my experience on Raspbian Stretch the RPi follows the AP fine on a frequency change with some delay depending on the scanning interval configured. To me it sounds like this could be related to the fact that the SSID is hidden. Could you post the content of the files /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf?
    – oh.dae.su
    Commented Jul 11, 2018 at 9:59
  • *not including passwords!
    – Wilf
    Commented Jul 11, 2018 at 12:46
  • Sure, added to initial message
    – Hitchman
    Commented Jul 11, 2018 at 17:58
  • Thanks for the update. I don't see anything suspicious in those files. Would be interesting to see, if you have the same problem with a not hidden AP.
    – oh.dae.su
    Commented Jul 11, 2018 at 19:08

3 Answers 3


Looks like the Pi is having re-connection issues. There is a similar thread on automatically reconnecting to wifi here which should solve the problem by forcing the wifi adapter to reconnect to the router if it looses a connection


"RPi determines channel only during boot procces" is not true!

Any problem is due to the network configuration (which you have not specified). If connection is lost the OS should attempt to re-connect if correctly configured.

You are using a doubly obsolete unsupported OS. The current Raspbian have much improved networking, which avoid most of the difficulties Wheezy had.

Install Stretch - this has vastly more robust networking!

  • Reconnection works for me only when channel is unchanged. As I wrote before - RPi appears again after channel changings when frequency restored. So this is reconnection too and it works. But my problem happened only when WiFi channel is changed. What details regarding network config would you like? Hidden SSID + DHCP. Nothing interesting.
    – Hitchman
    Commented Jul 11, 2018 at 7:46
  • And sorry - Debian Jessie installed, not Wheezy
    – Hitchman
    Commented Jul 11, 2018 at 8:00
  • Can you gibe some pointers to understand the available network configurations?
    – ffleandro
    Commented Aug 21, 2019 at 21:16

So.. I wasted a couple of hours to troubleshoot an issue.

I definitely see that raspbian does not "see" new frequency when it changes.

At the moment when AP switched to the new frequency I see that RPi seats on old one yet.

I checked it several times with iwconfig and wpa_cli -i wlan0 status.

I did some kind of workaround.

Wrote a script and added it to cron. Now RPi successfully reconnects even if channel switched.

Hope this will be helpful for somebody





count=$(ping -c $PACKETS -W 2 -n -B -s 0 -i 1 -l 1 -q $IP | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')

if [ $count == 0 ]; then
  echo "Connectivity test failed. Let's try to reconnect to WiFi AP."

  echo "[$(date)] Connectivity test failed. Let's try to reconnect to WiFi AP." >> $LOGFILE

  /sbin/wpa_cli -i wlan0 reconfigure
  echo "Connectivity test passed. Packet(s) received: $count."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.