This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Thread Border Router 1.0.0 won't connect to wifi

I am using the Thread Border Router 1.0.0 on a Raspberry Pi 3B+

I have not been able to connect the RaspPi to our wifi network.

I tried this method first, as described here. Our network is hidden and does not appear in the list returned by iwlist wlan0 scan. I know the SSID and password and used that.

wifi_connect mynetwork mypassword

The network settings remain unchanged and the BorderRouter-AP was still present, and even after rebooting the RaspPi.

pi@raspberrypi:~ $ ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.42.0.1 netmask 255.255.255.0 broadcast 10.42.0.255
inet6 fe80::ba27:ebff:fec1:2c66 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:c1:2c:66 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 3 overruns 0 frame 0
TX packets 2893 bytes 738594 (721.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

I also tried the method described here. I modified /etc/wpa_supplicant/wpa_supplicant.conf as described in the "Hidden Networks" section.

Again, the network setting remain unchanged and the BorderRouter-AP was still present, and even after rebooting the RaspPi.

I also tried using raspi-config as to set the country code, network SSID, and network password. (I noticed that this method had not effect on the /etc/wpa_supplicant/wpa_supplicant.conf file.)  Still no wifi.

Here is what's in /etc/wpa_supplicant/wpa_supplicant.conf

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
  ssid="myssid"
  scan_ssid=1
  psk="mypassword"
  key_mgmt=WPA_PSK
}

What's wrong?

Mary

Parents
  • Hello Mary,

    I have struggled with the same same thing. I don't remember the details of it right now (And I don't have my RPi set up at the moment). Basically, there is a script in the image for our border router which overruns the network settings on boot. 

    I have not found a nice workaround for this, other than to configure the network settings after every RPi power reset using the method described under "Thread Border Router Wi-Fi usage and configuration" on this page.

    You can either connect via ssh (e.g. using Putty) after connecting to the network that the RPi set up, or by connecting a screen to the RPi's HDMI port, and using a keyboard connected to the RPi.

     

    Best regards,

    Edvin

  • I have tried that method as described in "Thread Border Router Wi-Fi usage and configuration, as mentioned in my original post. 

    The wifi does not connect to the specified network.

    Does it matter that the network is 'Hidden'?  

    Where is the script? 

    Mary

  • Hello Mary,

    Sorry I didn't give a more thorough explanation yesterday. I was on my way out of the office, and wanted to give you at least some hints before I left, but I didn't have time to find the details.

     

    First, I don't know how familiar you are with Raspbian, so I am sorry if this is a bit much details. 

     

    To connect to a wifi network with your RPi you must either use a monitor and a keyboard connected to it, or you can connect to it via the wifi network that is set up by the RPi, and use Putty + ssh to access the OS on the RPi.

     

    I looked at this today. If you connect the RPi to a monitor and a keyboard, you will see when the RPi boots up, in the log that is printed in the startup procedure: "My IP address is 10.42.0.1".

     

    This is from a script called ap-helper, located in /etc/NetworkManager/dispatcher.d/ap-helper on the RPi.

    I may be repeating myself now, but you need either a keyboard connected directly to the Pi, or connect to the RPi's network, and use Putty and SSH to access the RPi. If you use Putty and ssh, you need to do this in one go, because you will not be able to connect to it after changing the ap-helper file. If this is changed, and you have a reboot, you must re-program the bin file to the SD card on the RPi.

     

    I am not too familiar with RPi and the booting process, but I have managed to disable this.

    What I did was that I opened this file:

    "sudo nano /etc/NetworkManager/dispatcher.d/ap-helper"

    Then, at the very bottom:

    case ${ACTION} in
    up)
        handle_action_up
        ;;
    down)
        handle_action_down
        ;;
    *)
        log "Unsupported action: '${ACTION}'"
        ;;
    esac

     

    I changed this to:

    case ${ACTION} in
    up)
    #    handle_action_up
        ;;
    down)
    #    handle_action_down
        ;;
    *)
        log "Unsupported action: '${ACTION}'"
        ;;
    esac

    (when using the nano editor, press ctrl+X to exit file, then press "y" to confirm save, and hit enter to save with the same name.

    This way, the start_dnsmasq() function is never called, where the RPi sets up the WiFi network that you can connect to with your computer (which is the part that overrides the wpa_supplicant.conf  settings).

     

    After this is changed, you can change your wpa_supplicant.conf file. Write:

    "sudo nano /etc/wpa_supplicant/wpa_supplicant.conf"

     

    Then you must enter your network settings:

    network={
        ssid="yourHiddenSSID"
        psk="Your_wifi_password"
    }

    With a hidden network, use the scan_ssid variable as well:

    network={
        ssid="yourHiddenSSID"
        scan_ssid=1
        psk="Your_wifi_password"
    }

    Save the file, and type "sudo reboot", and the RPi should reboot, and automatically connect to the Network that you specified in wpa_supplicant.conf.

    Try this, and see if it works for you as well, and let me know if it doesn't, or if anything is unclear.


    Best regards,
    Edvin
  • Sorry, but that did not work.

    ap-helper

    #!/bin/sh
    #
    #  Copyright (c) 2017, The OpenThread Authors.
    #  All rights reserved.
    #
    #  Redistribution and use in source and binary forms, with or without
    #  modification, are permitted provided that the following conditions are met:
    #  1. Redistributions of source code must retain the above copyright
    #     notice, this list of conditions and the following disclaimer.
    #  2. Redistributions in binary form must reproduce the above copyright
    #     notice, this list of conditions and the following disclaimer in the
    #     documentation and/or other materials provided with the distribution.
    #  3. Neither the name of the copyright holder nor the
    #     names of its contributors may be used to endorse or promote products
    #     derived from this software without specific prior written permission.
    #
    #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    #  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    #  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    #  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
    #  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    #  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    #  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    #  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    #  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    #  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    #  POSSIBILITY OF SUCH DAMAGE.
    #
    
    NAME="ap-helper"
    
    IFNAME=$1
    ACTION=$2
    
    AP_CONN="BorderRouter-AP"
    
    DHCP_START="10.42.0.2"
    DHCP_END="10.42.0.8"
    
    ROUTER_IP="10.42.0.1"
    
    DNS1=${ROUTER_IP}
    DNS2="8.8.8.8"
    
    
    log()
    {
        logger -t "${NAME}[${$}]" $*
    }
    
    disable_accept_ra()
    {
        log "Disable accepting Router Advertisements on the interface: '${IFNAME}'"
        sysctl -w net.ipv6.conf.${IFNAME}.accept_ra=1
    }
    
    start_dnsmasq()
    {
        log "Starting 'dnsmasq' on the interface: '${IFNAME}'"
        /usr/sbin/dnsmasq -i ${IFNAME} -a ${ROUTER_IP} -b -z -K -F${DHCP_START},${DHCP_END},24h -p0 -O3,${ROUTER_IP} -O6,${DNS1},${DNS2}
    }
    
    kill_dnsmasq()
    {
        local DNSMASQ_PID=`pidof dnsmasq`
    
        if [ -n ${DNSMASQ_PID} ]; then
            log "Killing 'dnsmasq' process with PID: '${DNSMASQ_PID}'"
            kill -9 ${DNSMASQ_PID}
        else
            log "'dnsmasq' is not running"
        fi
    }
    
    release_dhcpcd()
    {
        log "Releasing 'dhcpcd' on the interface: '${IFNAME}'"
        /sbin/dhcpcd -6 -k ${IFNAME}
    }
    
    handle_action_up()
    {
        case ${IFNAME} in
        wlan*)
            if [ ${CONNECTION_ID} = ${AP_CONN} ]; then
                release_dhcpcd
                disable_accept_ra
                start_dnsmasq
            fi
            ;;
        *)
            ;;
        esac
    }
    
    handle_action_down()
    {
        case ${IFNAME} in
        wlan*)
            if [ ${CONNECTION_ID} = ${AP_CONN} ]; then
                kill_dnsmasq
            fi
            ;;
        *)
            log "Skipping action: '${ACTION}' on the interface: '${IFNAME}'"
            ;;
        esac
    }
    
    
    case ${ACTION} in
    up)
    #    handle_action_up
        ;;
    down)
    #    handle_action_down
        ;;
    *)
        log "Unsupported action: '${ACTION}'"
        ;;
    esac
    

    wpa_supplicant.conf

    country=US
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    network={
      ssid="myssid"
      scan_ssid=1
      psk="mypassword"
    }
    

    I reboot or power cycle and the Border-AP access point is still active.

    ifconfig wlan0

    wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 10.42.0.1  netmask 255.255.255.0  broadcast 10.42.0.255
            inet6 fe80::ba27:ebff:fec1:2c66  prefixlen 64  scopeid 0x20<link>
            ether b8:27:eb:c1:2c:66  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 1648  bytes 416445 (406.6 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    

    Mary

  • Hello Mary,

    You are right. I tried with a fresh download of the image, and indeed, it doesn't work. I have no idea what I might have changed that made it work earlier. I will contact the Thread team who made the RPi img.

    Unfortunately, the guy who worked with it is not in the office today. I will let you know as soon as I know how to disable it.

     

    Have you tried to use the wifi_connect command on the RPi?

     

    In my case, it works with:

    "wifi_connect Wifi_Name Password"

    But I have no hidden networks around to test this on. Can you try it? The disadvantage with this is that this have to be done every power reset.

     

    Best regards,

    Edvin

  • Yes, that was the first thing I tried.  It does not connect.

Reply Children
Related