Network connection to Nao running Ubuntu20.04

We’ve done the following.

We’ve connected NAO to Wi-Fi router via Ethernet cable and using administrator interface of router we’ve found its IP address [IP_address].

Then we’ve connected to the robot via nao@[IP_address], using login-password nao:nao, but we have the problem with Wi-Fi driver on robot. What should we do to install NAO Wi-Fi driver correctly on Ubuntu 20.04?

What’s the exact problem with the Wi-Fi driver? Did you succesfully ssh into the robot? Is there an error message?

Quoting a response from Aaron (Team Nao Devils),

Both logins root:root and nao:nao should work in my initial version of the image. (Password authentication for root via SSH may be disabled by default.)
However, without an error message, it is hard to help. Wifi should work out of the box, but it needs configuration of cause.

We’ve configured etc/wpa_supplicant.conf (see Screenshot 1). How should we configure etc/network/interfaces, if its basic configuration is at it shown on Screenshot 2. At the moment the IP address of the robot is 192.168.0.194.

Connect throw ssh to nao

//temp
ssh nao@192.168.0.194

cd /etc

sudo apt install vim

sudo chmod 777 wpa_supplicant.conf

vim wpa_supplicant.conf

network={

  • ssid=“SPL”*
  • psk=“spl_admin”*
    }

I believe netplan is used to configure networking in recent Ubuntu versions, rather than manually configuring wpa_supplicant. Some code related to this (although you have to modify it) seems to be included in the NaoDevils’ NaoImage you downloaded in Install Ubuntu20.04 on NAO.

Below is the method from NaoImage’s scripts, to setup static ip addresses as the RoboCup SPL rule enforces.

Create /etc/netplan/default.yaml with

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      optional: true
      addresses:
        - 192.168.101.30/24
      dhcp4: false #eth0
      dhcp6: false #eth0
  wifis:
    wlan0:
      optional: true
      access-points:
        "SPL_5GHz":
          password: "Nao?!Nao?!"
      addresses:
        - 10.0.12.30/16
      dhcp4: false
      dhcp6: false

where you should replace SPL_5GHz with your wifi’s ssid, and Nao?!Nao?! with your wifi’s password.

The robot’s id is indicated by the 30 in 192.168.101.30 and 10.0.12.30. Each robot should have a different number.

The team’s id is indicated by the 12 in 10.0.12.30. SPL GameController’s teams.cfg has a list of team ids. The team id 12 corresponds to NaoDevils. You must change this to your team’s id.

And then run the following to apply the changes:

netplan apply

i don’t know about naoimage/netplan, but on debian i use:

/etc/network/interfaces:

iface spl inet static
  address 172.18.19.201
  netmask 255.255.0.0
auto wlan3
iface wlan3 inet manual
  wpa-driver nl80211,wext
  wpa-roam /etc/wpa_supplicant.conf

and add id_str="spl" in wpa_supplicant.conf’s network block.

Quoting a response from Aaron (Team Nao Devils),

Ubuntu does not use /etc/network/interfaces anymore by default, so configuring netplan as described by @ijnek is the way to go

@semendyaevsergey Did you get this working?

According to the instruction we made netplan settings. We’ve run “netplan apply” and the robot stopped responding. We’ve reinstalled Ubuntu 20.04 and after making netplan settings we’ve decided to check with “sudo netplan --debug generate” and we had as on screenshot. We again tried “netplan apply” but had the same no responding. After rebooting robot and checking its IP via router we had the following - see on screenshot. Router sees its MAC address but the IP address as on screenshot.


2

Just to make sure, did you try pinging, or trying to ssh into the new IP address? If the IP addresses have changed, I assume the terminal session will stop responding.

Also, there’s the option of using sudo netplan –d apply if you haven’t tried it yet.

Yes, we have successfully ssh to new IP address.
There was some mistake with extra spaces in our netplan file, we’ve fixed this mistake.
Then we did the following.

  1. sudo netplan apply
  2. reboot robot, pressing chest button
  3. via admin page of wi-fi router we’ve found new IP address (now IP address in IPv6 format). We have: fd01::2a24:ffff:fe46:23e2
  4. ssh nao@fd01::2a24:ffff:fe46:23e2
  5. this ssh was successful

Then we are trying to install ROS2.
Is that OK that we are doing it via IPv6?

With previous netplan settings robot has no connection to the internet.
We’ve changed netplan adding to dhcp4 “true” value.


After that we did with installation of ROS2 Base Install with instruction:
https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html

We’ve succesfully installed ROS2!

Great that you’ve got it working.
You can use IPv6 or IPv4 in your lab, but at competition, in an SPL game you will need to use IPv4 according to SPL rules.

Hmmm… but something is wrong.
After setting up netplan for another robot with different address (10.0.48.28/16) we see the same IP address for it - 192.168.0.5.
Why is it so? What should we change?
ifconfig shows this:

It seems like the changes are being applied for wlan0 correctly (as it has the right ip address), but not for eth0

Did you try rebooting the robot after netplan apply? if not, it may be worth trying.

In your previous post, you said you set dhcp4 to true to make it work, but that seems a bit strange too…

We’ve solved the problem.

Our wi-fi router had address 192.168.0.1, but in netplan config robot had in wlan0 addresses 10.0.[team_number].[robot_number]/16. We’ve configured router to have the address 10.0.0.1 and now it correctly corresponds to 10.0.[team_number].[robot_number]/16. So, first two numbers of wi-fi router address and robot’s wlan0 addresses must be the same (in our case 10.0…), and dhcp4 must be false so that router doesn’t assign address dynamically.

If we need to download something from the internet on robot we switch dhcp4 to true, if not - to false.

After that we’ve installed ROS2 and NAO LoLA according to Installation — Nao Lola documentation
Then we will try to do next steps.