Score:0

Losing my mind over headless Ubuntu 20.04.2 WiFi - many times ssh and ping report host down

im flag

My robot is running Ubuntu 20.04.2 64-bit Server headless on Raspberry Pi 3B+

Sometimes my robot boots and all appears to be going well. It centers the servo, writes the battery voltage into its life.log, but ssh and ping will report host down. "arp -a" from my Mac will report:

(10.0.0.11) at (incomplete) on en0 ifscope [ethernet] 

and ssh and ping do not succeed. Sometimes I have to cold boot many, many times before ssh will let me in.

Sometimes my robot boots, and ssh will succeed, but ping and ROS2 Dynamic Discovery will not work.

Since my robot is headless, I used cloud-init to set the WiFi SSID/pswd before the first boot. Cloud-init copies the content of a file named network-config to the file /etc/netplan/50-cloud-init.yaml and brings up the networking.

I used "cloud-init" to originally setup networking headless from the start by editing the file network-config on the boot partition:

wifis:
  wlan0:
    dhcp4: true
    optional: true           <-- true tells OS: finish boot, don't wait on networking 
    access-points:
      "your_SSID":
        password: "your_netpswd"
      "another_SSID":
        password: "another_netpswd"
  • I have tried setting the optional flag false for wifi0, but no difference.

  • Ubuntu Firewall ufw is disabled

  • Xfinity router has reserved IP for this MAC address

  • Xfinity router "firewall" only blocks Wan-to-Lan IDENT(113)

  • I am located in USA

My robot: 1

Any ideas what to try?

Nmath avatar
ng flag
If it works sporadically it's probably not a problem with settings. My guess is that it is losing wifi signal. Is the raspi inside an enclosure? If it's surrounded by metal, it's a faraday cage!
waltinator avatar
it flag
Look at the logs! `sudo -b 0 -u NetworkManager`. Read `man journalctl`.
cc flag
Check for other (loud) APs with the command sudo iwlist scan . Change channel if necessary.
Alan McDonley avatar
im flag
Thanks @ubfan1, there were not close or strong APs, but since the xFinity router itself has a bunch of services with hidden SSIDs hiding on the same channel as my private WiFi bands, I am trying an external 2.4GHz WiFi router serving all my 2.4GHz computers, so that there is only one thing on the channel, and I have control. So far no problems but it is too early to declare victory.
Alan McDonley avatar
im flag
@waltinator Thanks - I'm trying to figure out how to use journalctl --since and --until to grab the log when it doesn't work to compare with the log when it does. Definitely lots of up/down, reconfiguring and details to try to understand the workings of netplan and cloud-init. NetworkManager is not active.
waltinator avatar
it flag
I have `journalctl` hints, including an alias to have `date` output the right format for `--since` and `--until` in my AskUbuntu profile. Click on my username to see my profile.
Score:0
im flag

Currently, ROSbot Dave

has successfully booted up with full ssh, ping, arp, and ROS2 dynamic discovery Data Distribution System DDS working

  • 12 out of 12 attempts
  • since the change of 2.4GHz band WiFi access point
    • from the xFinity Technicolor CGM4331COM XB7 router
    • to my ancient DLink DIR-825 (last firmware released was 2013).

While I can say robot Carl and my DeskPi have had fitful connections with the xFinity router(s), neither has shown the “cannot remote in” (ssh) issue that ROSbot Dave exhibited, nor did I attempt distributed data messaging across the network when robot Carl was trying out ROS (1).

Carl has always been a Raspberry Pi 3B based GoPiGo3, but DeskPi was in fact using the exact Raspberry Pi 3B+ (plus) board that GoPiGo3 ROSbot Dave is running, except DeskPi has always run Raspbian/PiOS.

All these tests seem to point the finger at Ubuntu 20.04.2 on RaspberryPi 3B+ (or at least my particular Ubuntu configuration on this particular 3B+) having unreliable ICMP, ARP, or UDP handling during the DHCP link establishment phase with the xFinity router configured with a reserved IPv4 address for the board’s WiFi MAC address.

I don’t know enough to be able to diagnose this deeper, and having found a solution that enables me to progress with my ROS2 learning (through migrating the “Hands On ROS for Robotic Programming” exercises), I am leaving this mystery of the universe unsolved.

I do have a new WiFi 6 router on order, (that has ongoing firmware update support), to minimize the chance my network will become a crypto-bot or participant in the next distributed denial of service attack on internet democracy.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.