Difference between revisions of "Turtlebot3 Raspberry Pi Setup 20210126"

From wikidb
Jump to: navigation, search
(Notes and Logs)
(Useful References)
 
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
= Install Background =
 +
 +
There were several attempts to get an install in which wireless functioned. It was discovered that the upgrade step in the "Install ROS Dashing Diademata" messed up wireless (Section 3.2.5 step 2).
 +
 +
'''Warning''': Do not do an upgrade at this time. "sudo apt ugrade".
 +
 
= References =
 
= References =
  
Line 21: Line 27:
 
* Select the "Restore Disk Image" menu item  
 
* Select the "Restore Disk Image" menu item  
 
* Do what makes sense
 
* Do what makes sense
 +
 +
== SD Image Backups ==
 +
 +
I created 3 image backups during the install to make recovery from missteps easier.
 +
 +
* Disk: 3TStaging01
 +
** Directory: TB3Images
 +
*** Section 3.2.4 Add Swap Space Complete: SBCSwapConfigured20210126.img
 +
*** Section 3.2.5 Install ROS Diadmata Complete: SBCROSBaseInstalled20210126.img
 +
*** Section 3.2.7 Environment Setup Complete: SBCSetupComplete20210126.img
  
 
== Useful References ==
 
== Useful References ==
Line 35: Line 51:
  
 
* https://www.maketecheasier.com/backup-hard-drive-gnome-disk-utility/ Backup Hard Drive Gnome Disk Utility]
 
* https://www.maketecheasier.com/backup-hard-drive-gnome-disk-utility/ Backup Hard Drive Gnome Disk Utility]
 +
 +
 +
also
 +
  xz SBCSetupComplete20210126.img
  
 
= Boot Up the Raspberry Pi=
 
= Boot Up the Raspberry Pi=
Line 50: Line 70:
 
* passwd: ubuntu which I changed
 
* passwd: ubuntu which I changed
  
Disable Automatic update  
+
Use the following command to bypass password rules.
 +
 
 +
    sudo passwd ubuntu
 +
 
 +
Disable Automatic update. Following my practice of saving original configuration files with the extension ".org" created warnings during install. I didn't do it here and for the netplan below.
  
 
   $ sudo nano /etc/apt/apt.conf.d/20auto-upgrades
 
   $ sudo nano /etc/apt/apt.conf.d/20auto-upgrades
Line 59: Line 83:
 
   APT::Periodic::Unattended-Upgrade "0";
 
   APT::Periodic::Unattended-Upgrade "0";
  
Configure wifi (I had trouble with the syntax and indention so it took a few tries0
+
Configure wifi (I had trouble with the syntax and indention so it took a few tries)
  
 
   $ sudo nano /etc/netplan/50-cloud-init.yaml
 
   $ sudo nano /etc/netplan/50-cloud-init.yaml
Line 91: Line 115:
 
       dhcp6: yes
 
       dhcp6: yes
 
       access-points:
 
       access-points:
         "xxx":
+
         xxx:
           password: "xxx"
+
           password: yyy
 
</pre>
 
</pre>
  
Line 99: Line 123:
 
   $ sudo netplan apply
 
   $ sudo netplan apply
 
   $ reboot
 
   $ reboot
 +
 +
My network looks like this
 +
 +
<pre>
 +
ubuntu@ubuntu:~$ ifconfig
 +
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
 +
        inet 10.0.0.186  netmask 255.255.255.0  broadcast 10.0.0.255
 +
        inet6 fe80::ba27:ebff:fe0b:5dce  prefixlen 64  scopeid 0x20<link>
 +
        ether b8:27:eb:0b:5d:ce  txqueuelen 1000  (Ethernet)
 +
        RX packets 3460  bytes 497580 (497.5 KB)
 +
        RX errors 0  dropped 1055  overruns 0  frame 0
 +
        TX packets 405  bytes 41752 (41.7 KB)
 +
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 +
 +
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
 +
        inet 127.0.0.1  netmask 255.0.0.0
 +
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
 +
        loop  txqueuelen 1000  (Local Loopback)
 +
        RX packets 108  bytes 8484 (8.4 KB)
 +
        RX errors 0  dropped 0  overruns 0  frame 0
 +
        TX packets 108  bytes 8484 (8.4 KB)
 +
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 +
 +
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
 +
        inet 10.0.0.187  netmask 255.255.255.0  broadcast 10.0.0.255
 +
        inet6 fe80::ba27:ebff:fe5e:89b  prefixlen 64  scopeid 0x20<link>
 +
        ether b8:27:eb:5e:08:9b  txqueuelen 1000  (Ethernet)
 +
        RX packets 763  bytes 50699 (50.6 KB)
 +
        RX errors 0  dropped 644  overruns 0  frame 0
 +
        TX packets 56  bytes 7298 (7.2 KB)
 +
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 +
</pre>
  
 
Prevent  boot-up if no network setup
 
Prevent  boot-up if no network setup
Line 107: Line 163:
 
Disable Suspend and Hibernate
 
Disable Suspend and Hibernate
  
   $ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
+
   $ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
        Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null.
+
        [sudo] password for eepp:
 +
        Created symlink /etc/systemd/system/sleep.target → /dev/null.
 +
        Created symlink /etc/systemd/system/suspend.target → /dev/null.
 +
        Created symlink /etc/systemd/system/hibernate.target → /dev/null.
 +
        Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null.
  
 
Enable SSH
 
Enable SSH
Line 117: Line 177:
 
   
 
   
 
   $ reboot
 
   $ reboot
 +
 +
SSH from my laptop (sisters) looks like this
 +
 +
<pre>
 +
 +
eepp@sisters:~$ ssh ubuntu@10.0.0.187
 +
 +
ubuntu@10.0.0.187's password:
 +
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-1041-raspi2 aarch64)
 +
 +
* Documentation:  https://help.ubuntu.com
 +
* Management:    https://landscape.canonical.com
 +
* Support:        https://ubuntu.com/advantage
 +
 +
  System information as of Tue Jan 26 19:31:15 UTC 2021
 +
 +
  System load:  0.08              Processes:            111
 +
  Usage of /:  10.3% of 14.30GB  Users logged in:      1
 +
  Memory usage: 16%                IP address for eth0:  10.0.0.186
 +
  Swap usage:  0%                IP address for wlan0: 10.0.0.187
 +
 +
* Introducing self-healing high availability clusters in MicroK8s.
 +
  Simple, hardened, Kubernetes for production, from RaspberryPi to DC.
 +
 +
    https://microk8s.io/high-availability
 +
 +
0 packages can be updated.
 +
0 updates are security updates.
 +
 +
New release '20.04.1 LTS' available.
 +
Run 'do-release-upgrade' to upgrade to it.
 +
 +
 +
Last login: Tue Jan 26 19:06:03 2021
 +
ubuntu@ubuntu:~$
 +
</pre>
 +
 +
I tested basic Ubuntu functionality by rebooting.
  
 
== Ops ==
 
== Ops ==
  
'''TBD''' Check this out. I did this on Sisters (Remote PC) by mistake
+
'''TBD''': I did this on Sisters (Remote PC) by mistake. I don't know how that will change things. It appears to be working fine.
  
 
   $  sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
 
   $  sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Line 144: Line 242:
 
         no label, UUID=95adf48c-622b-418f-95ee-0918a19da735
 
         no label, UUID=95adf48c-622b-418f-95ee-0918a19da735
 
         ubuntu@ubuntu:~$ sudo swapon /swapfile
 
         ubuntu@ubuntu:~$ sudo swapon /swapfile
 
'''TBD''' Missed doing this at swap creation. Now I can't. Does this mean the swap came on at boot???
 
  
 
   $ sudo swapon /swapfile
 
   $ sudo swapon /swapfile
        swapon: /swapfile: swapon failed: Device or resource busy
+
 
 
+
 
Append "/swapfile swap swap defaults 0 0" to the end of this file
 
Append "/swapfile swap swap defaults 0 0" to the end of this file
  
Line 156: Line 251:
 
  $ sudo free -h
 
  $ sudo free -h
 
                       total        used        free      shared  buff/cache  available
 
                       total        used        free      shared  buff/cache  available
         Mem:          912M        106M       618M       4.4M        187M       786M
+
         Mem:          912M        101M       584M       4.4M        226M       791M
 
         Swap:          2.0G          0B        2.0G
 
         Swap:          2.0G          0B        2.0G
 
   
 
   
Line 163: Line 258:
 
         LABEL=system-boot      /boot/firmware  vfat    defaults        0      1
 
         LABEL=system-boot      /boot/firmware  vfat    defaults        0      1
 
         /swapfile swap swap defaults 0 0
 
         /swapfile swap swap defaults 0 0
 +
 +
I tested basic Ubuntu functionality by rebooting. In particular, wlan0 still functions. I also created and SD image with the following name.
 +
 +
  SBCSwapConfigured20210126.img
  
 
= install ROS Dashing Diademata =  
 
= install ROS Dashing Diademata =  
Line 168: Line 267:
 
* Section 3.2.5
 
* Section 3.2.5
  
Update and upgrade our software
+
== Failed Install Start ==
 +
 
 +
'''Important''': The upgrade breaks wireless
 +
 
 +
Update our software
  
 
   $ sudo apt update
 
   $ sudo apt update
Line 175: Line 278:
 
   $ sudo apt upgrade
 
   $ sudo apt upgrade
 
         ...
 
         ...
 +
 +
  $ reboot
 +
 +
From sisters the Remote PC, wifi fails but ethernet works for ssh
 +
 +
  $ ssh ubuntu@10.0.0.187
 +
        ssh: connect to host 10.0.0.187 port 22: No route to host
 +
 
 +
  $ ssh ubuntu@10.0.0.186
 +
        ubuntu@10.0.0.186's password:
 +
        ...
 +
 +
  ubuntu@ubuntu:~$
 +
 +
I restored the SBCSwapConfigured20210116.img I created above.
 +
 +
== Successful Install Restart ==
 +
 +
Boot up. Do an update but not an upgrade
 +
 +
  $ sudo apt update
 +
        ...
 +
 +
  $ reboot
 +
 +
Wireless still works.
 +
 
Setup local
 
Setup local
  
Line 189: Line 319:
 
Setup sources
 
Setup sources
  
 +
  $ sudo apt update
 +
        ...
 +
 
 
   $ sudo apt install curl gnupg2 lsb-release
 
   $ sudo apt install curl gnupg2 lsb-release
 
         ...
 
         ...
+
 
 +
  $ reboot
 +
 
 +
Wireless still good
 +
 
 
   $ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
 
   $ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
 
   
 
   
Line 200: Line 337:
 
   $ sudo apt update
 
   $ sudo apt update
 
         ...
 
         ...
 +
 +
  $ reboot
 +
 +
Wireless still good
 +
 +
  $ ls /opt/
 
   
 
   
 
   $ sudo apt install ros-dashing-ros-base
 
   $ sudo apt install ros-dashing-ros-base
 
         ...
 
         ...
 +
 +
  $ ls /opt/ros/dashing/
 +
        bin  cmake  include  lib  local_setup.bash  local_setup.sh  local_setup.zsh  _order_packages.py  setup.bash  setup.sh  setup.zsh  share  src
 +
 +
  $ reboot
 +
 +
I tested basic Ubuntu functionality by rebooting. I also created and SD image with the following name.
 +
 +
  SBCROSBaseInstalled20210126.img
  
 
= Install ROS Packages =
 
= Install ROS Packages =
Line 209: Line 361:
  
 
   $ sudo apt install python3-argcomplete python3-colcon-common-extensions libboost-system-dev build-essential
 
   $ sudo apt install python3-argcomplete python3-colcon-common-extensions libboost-system-dev build-essential
 +
        ...
 +
 
 +
  $ sudo apt install ros-dashing-hls-lfcd-lds-driver
 
         ...
 
         ...
 
   
 
   
Line 216: Line 371:
 
   $ sudo apt install ros-dashing-dynamixel-sdk
 
   $ sudo apt install ros-dashing-dynamixel-sdk
 
         ...
 
         ...
+
    
   $ mkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/srcmkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/srcmkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/srcmkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/srcmkdir -p ~/turtlebot3_ws/src && cd ^C
+
+
 
   $ mkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/src
 
   $ mkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/src
 
   
 
   
 
   $ git clone -b dashing-devel https://github.com/ROBOTIS-GIT/turtlebot3.git
 
   $ git clone -b dashing-devel https://github.com/ROBOTIS-GIT/turtlebot3.git
 
         ...
 
         ...
+
   
 
   $ cd ~/turtlebot3_ws/src/turtlebot3
 
   $ cd ~/turtlebot3_ws/src/turtlebot3
 
   
 
   
Line 231: Line 384:
 
   
 
   
 
   $ echo 'source /opt/ros/dashing/setup.bash' >> ~/.bashrc
 
   $ echo 'source /opt/ros/dashing/setup.bash' >> ~/.bashrc
 +
 +
  $ source ~/.bashrc
 +
 +
  $ colcon build --symlink-install --parallel-workers 1
 +
        Starting >>> turtlebot3_description
 +
        Finished <<< turtlebot3_description [13.6s]                   
 +
        Starting >>> turtlebot3_node
 +
        [Processing: turtlebot3_node]                           
 +
        [Processing: turtlebot3_node]                                     
 +
        [Processing: turtlebot3_node]                                     
 +
        [Processing: turtlebot3_node]                                     
 +
        ...
 +
        ...                         
 +
        Summary: 6 packages finished [5min 51s]
 +
 +
  $ echo 'source ~/turtlebot3_ws/install/setup.bash' >> ~/.bashrc
 
   
 
   
 
   $ source ~/.bashrc
 
   $ source ~/.bashrc
  
'''Errors''': in Raspberry Pi console for the following but it compiled successfully
+
= Environment Setup =
 +
* Section 3.2.7
  
   $ colcon build --symlink-install --parallel-workers 1
+
   $ echo 'export ROS_DOMAIN_ID=30 #TURTLEBOT3' >> ~/.bashrc
 +
 +
  $ source ~/.bashrc
 +
 +
  $ tail ~/.bashrc
 +
        if ! shopt -oq posix; then
 +
        if [ -f /usr/share/bash-completion/bash_completion ]; then
 +
            . /usr/share/bash-completion/bash_completion
 +
        elif [ -f /etc/bash_completion ]; then
 +
          . /etc/bash_completion
 +
        fi
 +
      fi
 +
      source /opt/ros/dashing/setup.bash
 +
      source ~/turtlebot3_ws/install/setup.bash
 +
      export ROS_DOMAIN_ID=30 #TURTLEBOT3
 +
 
 +
I tested basic Ubuntu functionality by rebooting. wlan0 is still working I also created and SD image with the following name.
 +
 
 +
  SBCSetupComplete20210126.img
 +
 
 +
I also added this to burger's .bashrc
 +
  export TURTLEBOT3_MODEL=burger
 +
 
 +
I added this to sister's .bashrc
 +
  source /opt/ros/dashing/setup.bash
 +
 
 +
= Quick Cartographer Test =
 +
 
 +
Setup
 +
* TB3 off
 +
* Disconnected the HDMI, Keyboard, Ethernet cable, and AC adapter
 +
* Connected RC-100B controller with bluetooth dongles
 +
* Connected battery
 +
* Turned it on and gave it 45 seconds to boot
 +
 
 +
On Remote PC (sisters)
 +
 
 +
'''Terminal 1'''
 +
 
 +
  $ ssh ubuntu@10.0.0.187
 
         ...
 
         ...
 +
 +
  $ ros2 launch turtlebot3_bringup robot.launch.py
 
         ...
 
         ...
        Starting >>> turtlebot3_bringup
 
        Finished <<< turtlebot3_bringup [11.0s]                         
 
        Starting >>> turtlebot3
 
        Finished <<< turtlebot3 [11.2s]                         
 
                           
 
        Summary: 6 packages finished [11min 52s]
 
  
These were 18 errors on the Pi console similar to the following. They were not in the remote PC's ssh window
+
'''Terminal 2'''
  
   mmcblk0: error -22 transffering data, sector 2080384, nr 8, cmd response 0x900, card status 0,0
+
   $ ros2 run turtlebot3_teleop teleop_keyboard
 +
        ...
  
and also this one
+
'''Terminal 3'''
  
   kworker/3:1 ... blocked for more than 120 seconsd
+
   $ ros2 launch turtlebot3_cartographer cartographer.launch.py
      Tainted: G    W 4.15.0- 1077 - raspi2 #82-ubuntu
+
        ...
  
= Environment Setup =
+
Teleoped and created a good map
* Section 3.2.7
+
  
  $ echo 'export ROS_DOMAIN_ID=30 #TURTLEBOT3' >> ~/.bashrc
 
 
  $ source ~/.bashrc
 
  
 
= Who are We=
 
= Who are We=
Line 285: Line 487:
  
  
 +
 +
= My Trouble Tickets =
 +
 +
* [http://en.robotis.com/service/forum.php Robotis Forum]
 +
 +
* [http://en.robotis.com/service/forum_view.php?bbs_no=2408004 SD card errors on a TB3 SBC (Raspbery Pi) Burger]
 +
** [[SBC Turtlebot3 Setup ROS 2 Dashing 202101 Note and Log]]
 +
* [http://en.robotis.com/service/forum_view.php?bbs_no=2408013 Wifi breaks Turtlebot3 bureger RPi after upgrade step]
 +
** [[Turtlebot3 Raspberry Pi Wireless Issue 20210118]]
  
 
= Notes and Logs =
 
= Notes and Logs =
  
 
* [[SBC Turtlebot3 Setup ROS 2 Dashing 20210126 Note and Log]]
 
* [[SBC Turtlebot3 Setup ROS 2 Dashing 20210126 Note and Log]]

Latest revision as of 09:52, 22 February 2021

Install Background

There were several attempts to get an install in which wireless functioned. It was discovered that the upgrade step in the "Install ROS Dashing Diademata" messed up wireless (Section 3.2.5 step 2).

Warning: Do not do an upgrade at this time. "sudo apt ugrade".

References

Prepare micoSD Card

 $ cd TB3Install

 TB3Install$ mv ~/Downloads/ubuntu-18.04.3-preinstalled-server-arm64+raspi3.img.xz .

 TB3Install$ unxz < ubuntu-18.04.3-preinstalled-server-arm64+raspi3.img.xz > ubuntu-18.04.3-preinstalled-server-arm64+raspi3.img
  • Run the Disks application
    • To find it go to the "Show Applications" icon in the bottom left corner of the desktop.
    • Search for "Disks"
  • In the upper right corner of the Disks app window is a "hamburger" menu (3 horizontal lines).
  • Select the "Restore Disk Image" menu item
  • Do what makes sense

SD Image Backups

I created 3 image backups during the install to make recovery from missteps easier.

  • Disk: 3TStaging01
    • Directory: TB3Images
      • Section 3.2.4 Add Swap Space Complete: SBCSwapConfigured20210126.img
      • Section 3.2.5 Install ROS Diadmata Complete: SBCROSBaseInstalled20210126.img
      • Section 3.2.7 Environment Setup Complete: SBCSetupComplete20210126.img

Useful References

 If for some reason the tar solutions don’t work (perhaps because you’re using the OS X built-ins), try this: 
   unxz < file.tar.xz > file.tar

 which is equivalent to:
   xz -dc < file.tar.xz > file.tar

 Then use tar to untar the file.


also

  xz SBCSetupComplete20210126.img

Boot Up the Raspberry Pi

  • Section 3.2.2

Configure the Raspberry Pi

  • Section 3.2.3
  • I believe this is what I did but I couldn't capture my keystrokes

Log into the Pi

  • username: ubuntu
  • passwd: ubuntu which I changed

Use the following command to bypass password rules.

   sudo passwd ubuntu

Disable Automatic update. Following my practice of saving original configuration files with the extension ".org" created warnings during install. I didn't do it here and for the netplan below.

 $ sudo nano /etc/apt/apt.conf.d/20auto-upgrades

Change the update settings

 APT::Periodic::Update-Package-Lists "0";
 APT::Periodic::Unattended-Upgrade "0";

Configure wifi (I had trouble with the syntax and indention so it took a few tries)

 $ sudo nano /etc/netplan/50-cloud-init.yaml
$ cat /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    version: 2
    ethernets:
        eth0:
            dhcp4: true
            match:
                macaddress: b8:27:eb:0b:5d:ce
            set-name: eth0
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: yes
      dhcp6: yes
      optional: true
  wifis:
    wlan0:
      dhcp4: yes
      dhcp6: yes
      access-points:
        xxx:
          password: yyy

Apply configuration

 $ sudo netplan apply
 $ reboot

My network looks like this

ubuntu@ubuntu:~$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.186  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 fe80::ba27:ebff:fe0b:5dce  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:0b:5d:ce  txqueuelen 1000  (Ethernet)
        RX packets 3460  bytes 497580 (497.5 KB)
        RX errors 0  dropped 1055  overruns 0  frame 0
        TX packets 405  bytes 41752 (41.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 108  bytes 8484 (8.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 108  bytes 8484 (8.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.187  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 fe80::ba27:ebff:fe5e:89b  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:5e:08:9b  txqueuelen 1000  (Ethernet)
        RX packets 763  bytes 50699 (50.6 KB)
        RX errors 0  dropped 644  overruns 0  frame 0
        TX packets 56  bytes 7298 (7.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Prevent boot-up if no network setup

 $ systemctl mask systemd-networkd-wait-online.service
        unit sleep.target does not exist, proceeding anyway

Disable Suspend and Hibernate

 $  sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
       [sudo] password for eepp: 
       Created symlink /etc/systemd/system/sleep.target → /dev/null.
       Created symlink /etc/systemd/system/suspend.target → /dev/null.
       Created symlink /etc/systemd/system/hibernate.target → /dev/null.
       Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null.

Enable SSH

 $ sudo apt install ssh

 $ sudo systemctl enable --now ssh

 $ reboot

SSH from my laptop (sisters) looks like this


eepp@sisters:~$ ssh ubuntu@10.0.0.187

ubuntu@10.0.0.187's password: 
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-1041-raspi2 aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Tue Jan 26 19:31:15 UTC 2021

  System load:  0.08               Processes:            111
  Usage of /:   10.3% of 14.30GB   Users logged in:      1
  Memory usage: 16%                IP address for eth0:  10.0.0.186
  Swap usage:   0%                 IP address for wlan0: 10.0.0.187

 * Introducing self-healing high availability clusters in MicroK8s.
   Simple, hardened, Kubernetes for production, from RaspberryPi to DC.

     https://microk8s.io/high-availability

0 packages can be updated.
0 updates are security updates.

New release '20.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


Last login: Tue Jan 26 19:06:03 2021
ubuntu@ubuntu:~$ 

I tested basic Ubuntu functionality by rebooting.

Ops

TBD: I did this on Sisters (Remote PC) by mistake. I don't know how that will change things. It appears to be working fine.

 $  sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
       [sudo] password for eepp: 
       Created symlink /etc/systemd/system/sleep.target → /dev/null.
       Created symlink /etc/systemd/system/suspend.target → /dev/null.
       Created symlink /etc/systemd/system/hibernate.target → /dev/null.
       Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null.

Add Swap Space

  • Section 3.2.4
 $ sudo swapoff /swapfile
     swapoff: /swapfile: swapoff failed: No such file or directory
 
 $ sudo fallocate -l 2G /swapfile
 
 $ sudo chmod 600 /swapfile

 $ sudo mkswap /swapfile
        Setting up swapspace version 1, size = 2 GiB (2147479552 bytes)
        no label, UUID=95adf48c-622b-418f-95ee-0918a19da735
        ubuntu@ubuntu:~$ sudo swapon /swapfile
 $ sudo swapon /swapfile
  

Append "/swapfile swap swap defaults 0 0" to the end of this file

$ sudo nano /etc/fstab
 
$ sudo free -h
                     total        used        free      shared  buff/cache   available
       Mem:           912M        101M        584M        4.4M        226M        791M
       Swap:          2.0G          0B        2.0G

$ cat /etc/fstab 
       LABEL=writable	/	 ext4	defaults	0 0
       LABEL=system-boot       /boot/firmware  vfat    defaults        0       1
       /swapfile swap swap defaults 0 0

I tested basic Ubuntu functionality by rebooting. In particular, wlan0 still functions. I also created and SD image with the following name.

 SBCSwapConfigured20210126.img

install ROS Dashing Diademata

  • Section 3.2.5

Failed Install Start

Important: The upgrade breaks wireless

Update our software

 $ sudo apt update
       ...

 $ sudo apt upgrade
       ...

 $ reboot

From sisters the Remote PC, wifi fails but ethernet works for ssh

 $ ssh ubuntu@10.0.0.187
       ssh: connect to host 10.0.0.187 port 22: No route to host
 
 $ ssh ubuntu@10.0.0.186
       ubuntu@10.0.0.186's password: 
       ...

 ubuntu@ubuntu:~$ 

I restored the SBCSwapConfigured20210116.img I created above.

Successful Install Restart

Boot up. Do an update but not an upgrade

 $ sudo apt update
       ...

 $ reboot

Wireless still works.

Setup local

 $ sudo locale-gen en_US en_US.UTF-8
        Generating locales (this might take a while)...
          en_US.ISO-8859-1... done
         en_US.UTF-8... done
       Generation complete.

 $ sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8

 $ export LANG=en_US.UTF-8

Setup sources

 $ sudo apt update
       ...
 
 $ sudo apt install curl gnupg2 lsb-release
       ...
 
 $ reboot

Wireless still good

 $ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

 $ sudo sh -c 'echo "deb [arch=amd64,arm64] http://packages.ros.org/ros2/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'

Install ROS 2 packages

 $ sudo apt update
       ...

 $ reboot

Wireless still good

 $ ls /opt/

 $ sudo apt install ros-dashing-ros-base
       ...

 $ ls /opt/ros/dashing/
       bin  cmake  include  lib  local_setup.bash  local_setup.sh  local_setup.zsh  _order_packages.py  setup.bash  setup.sh  setup.zsh  share  src

 $ reboot

I tested basic Ubuntu functionality by rebooting. I also created and SD image with the following name.

 SBCROSBaseInstalled20210126.img

Install ROS Packages

  • Section 3.2.6
 $ sudo apt install python3-argcomplete python3-colcon-common-extensions libboost-system-dev build-essential
       ...
 
 $ sudo apt install ros-dashing-hls-lfcd-lds-driver
       ...

 $ sudo apt install ros-dashing-turtlebot3-msgs
       ...

 $ sudo apt install ros-dashing-dynamixel-sdk
       ...
 
 $ mkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/src

 $ git clone -b dashing-devel https://github.com/ROBOTIS-GIT/turtlebot3.git
       ...
   
 $ cd ~/turtlebot3_ws/src/turtlebot3

 $ rm -r turtlebot3_cartographer turtlebot3_navigation2

 $ cd ~/turtlebot3_ws/

 $ echo 'source /opt/ros/dashing/setup.bash' >> ~/.bashrc

 $ source ~/.bashrc

 $ colcon build --symlink-install --parallel-workers 1
       Starting >>> turtlebot3_description
       Finished <<< turtlebot3_description [13.6s]                    
       Starting >>> turtlebot3_node
       [Processing: turtlebot3_node]                             
       [Processing: turtlebot3_node]                                      
       [Processing: turtlebot3_node]                                       
       [Processing: turtlebot3_node]                                       
       ...
       ...                           
       Summary: 6 packages finished [5min 51s]

 $ echo 'source ~/turtlebot3_ws/install/setup.bash' >> ~/.bashrc

 $ source ~/.bashrc

Environment Setup

  • Section 3.2.7
 $ echo 'export ROS_DOMAIN_ID=30 #TURTLEBOT3' >> ~/.bashrc

 $ source ~/.bashrc

 $ tail ~/.bashrc 
       if ! shopt -oq posix; then
       if [ -f /usr/share/bash-completion/bash_completion ]; then
           . /usr/share/bash-completion/bash_completion
       elif [ -f /etc/bash_completion ]; then
         . /etc/bash_completion
       fi
     fi
     source /opt/ros/dashing/setup.bash
     source ~/turtlebot3_ws/install/setup.bash
     export ROS_DOMAIN_ID=30 #TURTLEBOT3

I tested basic Ubuntu functionality by rebooting. wlan0 is still working I also created and SD image with the following name.

 SBCSetupComplete20210126.img

I also added this to burger's .bashrc

 export TURTLEBOT3_MODEL=burger

I added this to sister's .bashrc

 source /opt/ros/dashing/setup.bash

Quick Cartographer Test

Setup

  • TB3 off
  • Disconnected the HDMI, Keyboard, Ethernet cable, and AC adapter
  • Connected RC-100B controller with bluetooth dongles
  • Connected battery
  • Turned it on and gave it 45 seconds to boot

On Remote PC (sisters)

Terminal 1

 $ ssh ubuntu@10.0.0.187
       ...

 $ ros2 launch turtlebot3_bringup robot.launch.py
       ...

Terminal 2

 $ ros2 run turtlebot3_teleop teleop_keyboard
       ...

Terminal 3

 $ ros2 launch turtlebot3_cartographer cartographer.launch.py
       ...

Teleoped and created a good map


Who are We

 $ cat /proc/device-tree/model 
       Raspberry Pi 3 Model B Plus Rev 1.3

SD Storage

I saved a backup image of the Pi SD card on the remote PC. it takes about 17% of the PC's storage

I checked how much of the Pi SD's 16GB storage is use. It looks like about 37%. See below

 $ df
       Filesystem     1K-blocks    Used Available Use% Mounted on
       udev              450572       0    450572   0% /dev
       tmpfs              93404    4512     88892   5% /run
       /dev/mmcblk0p2  15021764 5240780   9130784  37% /
       tmpfs             467000       0    467000   0% /dev/shm
       tmpfs               5120       0      5120   0% /run/lock
       tmpfs             467000       0    467000   0% /sys/fs/cgroup
       /dev/mmcblk0p1    258095  107443    150652  42% /boot/firmware
       tmpfs              93400       0     93400   0% /run/user/1000


My Trouble Tickets

Notes and Logs