Wireless Config - northern-bites/nbites GitHub Wiki

The robots (Nao V4s only) connect to wireless networks using wpa_supplicant, a wireless connection daemon that replaces the Nao's default ConnMan interface.

Most of the configuration of wpa_supplicant is done by three files on the robot:

  • wpa_supplicant.conf (found in /etc/wpa_supplicant/) handles which networks the robot may connect to, and authentication for those networks.
  • utwireless (found in /etc/init.d/) handles wireless connection details, such as netmask, gateway, and static IP.
  • utwired (found in /etc/init.d) handles the same stuff as utwireless, but for wired connections.

utwireless

If the venue you're at uses DHCP, you won't need to mess with any IPs, netmasks or gateways. After the line sleep 1 in the start() method, utwireless needs only to have the line dhclient wlan0 - this will tell the wireless daemon to accept a dynamically assigned IP.

If you need to use static IPs, configure the lines after sleep 1 to look like this:

ifconfig wlan0 <IP> netmask <netmask>

route add -net default gw "<gateway>"

where <IP> is your static IP, <netmask> is usually either 255.255.255.0 or 255.255.0.0, and <gateway> is the IP of the default gateway (make sure to keep the quotes on this one).

Once done making your changes, you will need to restart the wireless daemon for you changes to take effect. Either restart the robot (not just naoqi), or become root and run /etc/init.d/utwireless restart. If you messed something up on a previous try, the system may be unable to restart the daemon, so delete the suggested file in /var/run and try again.

utwired

If we are at competition and want to use direct computer-to-head connections, the start function should be:

start() {
ifconfig eth0 11.0.1.5 netmask 255.255.255.0
route add -net default gw 11.0.1.1
ifconfig eth0 up
}

If we are in the lab and want to use DHCP, the start function should be:

start() {
dhclient eth0 ifconfig eth0 up
}

The rest of the file should be ok! ##wpa_supplicant.conf

It is now unnecessary to change this file manually, simply use the script change_ssid.sh in /util/scripts. The script takes the arguments of the robot you wish to change the wireless networks settings of (or all for every connected robot the script can find), the SSID to set as preferred, and optionally the password for that network.

Example: ./change_ssid.sh mal ROBOTICS roboticspassword

A robot restart is unnecessary, the changes should take place in under 30 seconds automatically.

⚠️ **GitHub.com Fallback** ⚠️