Announcement

Collapse
No announcement yet.

Raspberry Pi networking - Wifi "roaming"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Raspberry Pi networking - Wifi "roaming"

    I've recently configured my Raspberry Pi's, including Z-Net, to utilize wifi roaming capability. For me, the main advantage is that the wireless interface is only enabled when the wired interface is disconnected. Also, the wireless interface quickly recovers from temporary loss of connection such as a router reboot.

    This method utilizes the ifplugd service. For the Z-Net, this was present in the v1 units and absent in the v2. Check for existence of /usr/sbin/ifplugd to determine if it is present. To install, perform the following:

    Code:
    sudo apt-get -q update
    sudo apt-get -q -y install ifplugd
    Then edit the file /etc/default/ifplugd and change two lines:
    Code:
    INTERFACES="auto"
    HOTPLUG_INTERFACES="all"
    The attached ifplugd_install.sh performs these steps.

    Next, change /etc/network/interfaces as follows.
    Code:
    # interfaces(5) file used by ifup(8) and ifdown(8)
    
    # Please note that this file is written to be used with dhcpcd
    # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
    
    # Include files from /etc/network/interfaces.d:
    source-directory /etc/network/interfaces.d
    
    auto lo
    iface lo inet loopback
    
    iface default inet dhcp
    
    allow-hotplug wlan0
    iface wlan0 inet manual
        wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
    Note that the wpa-roam keyword is used in place of wpa-conf, and that the inet method is now manual vs. dhcp or static. Note that this is for a DHCP configuration.

    /etc/wpa_supplicant/wpa_supplicant.conf looks like this:
    Code:
    country=US
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    
    network={
        ssid="yourSSID"
        psk="yourWifiPassword"
    }
    Don't forget (like Homeseer did) to set the permissions to protect your password!
    Code:
    sudo chmod 600 /etc/wpa_supplicant/wpa_supplicant.conf
    Attached Files
Working...
X