Skip to content

Commit

Permalink
Cleanup of #381 (#382)
Browse files Browse the repository at this point in the history
pattacini authored Jan 2, 2025
1 parent d6c13db commit bcdf82d
Showing 7 changed files with 21 additions and 471 deletions.
Original file line number Diff line number Diff line change
@@ -28,13 +28,13 @@ How to run:
- Check the README file for further instructions
- launch as `sudo` the `start.sh` file
```
git clone https://github.com/icub-tech-iit/iCubOS-playbook.git
git clone https://github.com/icub-tech-iit/icubos-playbook.git
cd iCubOS-playbook/
cd icubos-playbook/
sudo ./start.sh
```
A reboot is recommended in order to load the Lowlatency kernel instead of the Generic.
A reboot is recommended in order to load the `Lowlatency` kernel instead of the `Generic`.

Once the installation is completed follow the [Networking](https://icub-tech-iit.github.io/documentation/icub_operating_systems/icubos/networking/#external-network-configurations) chapter of the guide to configure the network using netplan or your favourite network manager system.
Once the installation is completed follow the [Networking](https://icub-tech-iit.github.io/documentation/icub_operating_systems/icubos/networking/#external-network-configurations) chapter of the guide to configure the network using netplan or your favorite network manager system.
4 changes: 4 additions & 0 deletions docs/icub_operating_systems/icubos/installation-from-image.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# The OS on icub-head - Installation from pre-built image

!!! warning

The instructions for installing a pre-built images are currently outdated. Please, refer to the other modes of installation.

This method uses a pre-built disk image to install the icub-head, this image is a 1:1 copy of a working system: once the image is written on the icub-head disk (**erasing any data currently on the disk!**) you get a working system, with only a few customiztion required.
If you prefer to install the system from scratch, please check the [_appropriate guide_](installation-from-scratch.md).

103 changes: 0 additions & 103 deletions docs/icub_operating_systems/icubos/installation-from-scratch-22.04.md

This file was deleted.

103 changes: 3 additions & 100 deletions docs/icub_operating_systems/icubos/installation-from-scratch.md
Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@ Since iCubOS is based on the Ubuntu server, we will install the latter from the

## Latest versions

The latest version is based on Ubuntu Server 20.04.1
The latest version is based on Ubuntu Server 22.04

## Create the USB installer

The first step is to download the **official Ubuntu 20.04 LTS Server install media** from the [release page](https://releases.ubuntu.com/focal). Search for `ubuntu-20.04.x-live-server-amd64.iso`.
The first step is to download the **official Ubuntu 22.04 LTS Server install media** from the [release page](https://releases.ubuntu.com/jammy). Search for `ubuntu-22.04.x-live-server-amd64.iso`.

Then, please create the USB installer using a USB memory and a tool like [Balena Etcher](https://www.balena.io/etcher/).

@@ -52,7 +52,7 @@ Install the system by choosing the default options, except for the following ste

Install the following packages
```
nfs-common python-tk libopencv-dev ntpdate vim ssh cmake-curses-gui iperf libportaudio2 portaudio19-dev linux-sound-base alsa-base alsa-utils gdb meld bmon libi2c-dev expect libgfortran10-dev qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings
nfs-common python-tk libopencv-dev ntpdate vim ssh cmake-curses-gui iperf libportaudio2 portaudio19-dev linux-sound-base alsa-base alsa-utils gdb meld bmon libi2c-dev expect libgfortran-10-dev qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings
```

### Low Latency kernel
@@ -98,103 +98,6 @@ sudo systemctl disable gdm
net.core.rmem_max=8388608
```

### NTP

Edit the file `/etc/default/ntpdate` by changing the following lines
```
NTPDATE_USE_NTP_CONF="no"
...
NTPSERVERS="10.0.0.1 ntp.ubuntu.com"
```

### IMU Bosch

#### Installation

To use the IMU Bosch BNO055 through the i2c bus these additional steps are required:

1. Install libraries for i2c:
`sudo apt install libi2c-dev i2c-tools`

2. Unzip [kempld-drivers.30.tar.gz](https://github.com/icub-tech-iit/icub-os-files/blob/master/drivers/imu-bosch/kempld-drivers.30.tar.gz)

3. Compile the custom kernel modules:
```
cd kempld-drivers.30/kempld-modules-{ver}
make
sudo make install
```
{ver} is the Linux version (see uname -r). Ignore ssl errors during installation.

4. Load the required kernel module(the best should be add them at the startup):
```
sudo insmod kempld-core.ko
sudo insmod i2c-kempld.ko
```

5. Finally add `icub` user to `i2c` group:
```
usermod -a -G i2c icub
```

#### Test the configuration of i2c and BNO055

To test the installation with the [python script BNO055](https://github.com/icub-tech-iit/icub-os-files/blob/master/drivers/imu-bosch/BNO055.zip):
```
python BNO055.py
```

Note that to make it work you might change the script at line 195:
```
# Open I2C bus
self._bus = smbus.SMBus(1)
```

specifying the right number: instead of 1, specify the correct number that can be found through:

```
i2cdetect -l
```
Another possible troubleshooting could be to change in the script BNO055.py (line 187) the default address from 0x28 to 0x29

### Fixed USB resource names

In order to get a fixed device name for some USB resources such as IMU and USB2SERIAL, you have to create the following UDEV rules

- IMU BOSCH: add the file `/etc/udev/rules.d/88-bosch-i2c-imu.rules` as follows
```
# iCub Bosch i2c IMU
SUBSYSTEM=="i2c-dev", ATTRS{name}=="i2c-kempld", SYMLINK+="bosch-i2c-imu", MODE="0660", GROUP="i2c"
```

- USB to Serial interface: add the file `/etc/udev/rules.d/99-usb-serial.rules` as follows
```
# tty Xsens
SUBSYSTEM=="tty", ATTRS{idVendor}=="2639", SYMLINK+="ttyXsens", MODE="0660", GROUP="tty"
```

## Further installation steps and configuration

### Mount via SSH

On the icub-head, graphics-based tools have not been installed (except the ones required for firmware interfaces) and it is better not to install them. Anyway, using graphic tools (like editors, file managers, etc..) is very useful and sometimes essential. Instead of running remotely a tool and displaying it locally (like we did in old PC104), we can mount locally the icub-head filesystem via SSH and run locally all the tools we need.
In order to mount locally the icub-head filesystem on your client:

1. install the sshfs package
```
sudo apt-get install sshfs
```
2. create a mount point for the remote filesystem (eg.) `mkdir /home/icub/icub-head_fs`
3. mount the remote `/usr/local/src/robot` via SSH
```
sudo sshfs -o allow_other icub@10.0.0.2:/usr/local/src/robot/ /home/icub/icub-head_fs
```

If you already set the passwordless SSH login, you can skip the password:
```
sudo sshfs -o allow_other,IdentityFile=/home/icub/.ssh/id_rsa icub@10.0.0.2:/usr/local/src/robot/ /home/icub/icub-head_fs
```

## Customize the system

What now you need to do is to customize the installation with your hardware and environment (see the "_Required configuration_" paragraph in [_Networking_](networking.md), [_Bluetooth_](bluetooth.md), [_User Environment_](user-env.md) chapters as well as [_Further Tasks_ chapter](further-tasks.md) )
106 changes: 0 additions & 106 deletions docs/icub_operating_systems/other-machines/generic-machine-22.04.md

This file was deleted.

164 changes: 9 additions & 155 deletions docs/icub_operating_systems/other-machines/generic-machine.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ This page contains instructions on how to prepare a machine to work in the iCub

## Operating System

You can choose both a Debian or Ubuntu Linux, the currently suggested OS is [Ubuntu 20.04 (Focal Fossa)](http://releases.ubuntu.com/20.04/).
You can choose both a Debian or Ubuntu Linux, the currently suggested OS is [Ubuntu 22.04 (Jammy Jellyfish)](http://releases.ubuntu.com/22.04/).

## User account

@@ -24,14 +24,6 @@ If you want to change the default password simply execute (*this works only if y

`sudo su - `

### Creation of the iCub user

You need to create the icub user. For nfs (see later) to work this user has to have the uid 1000 and guid 1000. In LINUX starting procedure, is asks to create the first user. By default uid is set at 1000. To make sure it is done do :

```
id -u icub
id -g icub
```

Add the icub user to the sudoers group, as follows

@@ -62,9 +54,9 @@ You have two options:
- Dynamic DHCP IP address

### Configuration methods
Usually, if you have a Desktop installed on your machine it's better to use the default desktop network tool (eg. in Ubuntu 20.04 the tool is [Network Manager](https://help.ubuntu.com/community/NetworkManager) ).
Usually, if you have a Desktop installed on your machine it's better to use the default desktop network tool (eg. in Ubuntu 22.04 the tool is [Network Manager](https://help.ubuntu.com/community/NetworkManager) ) or using its cli UI `nmtui` very powerfull and easy to use even when conneted via `ssh`.

Otherwise, you can configure the network interfaces using the command line configuration files (eg. in Ubuntu 20.40 you have to deal with [NETPLAN](https://netplan.io/) )
Otherwise, you can configure the network interfaces using the command line configuration files (eg. in Ubuntu 22.04 you have to deal with [NETPLAN](https://netplan.io/) )

### the HOSTS file
Please check that the file `/etc/hosts` looks as follows:
@@ -76,27 +68,6 @@ Please check that the file `/etc/hosts` looks as follows:

where **MACHINE_HOSTNAME** is the hostname of you machine, that should match the file `/etc/hostname`

## Mount remote NFS shares

!!! note
Skip this step in case of [iCub Console Server](icub-server-laptop.md) or [iCub Dedicated Server](icub-server-from-scratch.md)

To mount the remote NFS shares, edit `/etc/fstab`, by adding the following lines

```
NFS_SERVER_IP:/exports/code /usr/local/src/robot nfs _netdev,auto,bg 0 0
NFS_SERVER_IP:/exports/local_yarp    /home/icub/.local/share/yarp nfs _netdev,auto,bg 0 0
```
and replace **NFS_SERVER_IP** with the appropriate value for your network. As example, in case of a machine in an environment with the icub server the above configuration will be

` 10.0.0.1:/exports/code /usr/local/src/robot nfs soft,retry=1,timeo=60,_netdev,auto,bg 0 0`
` 10.0.0.1:/exports/local_yarp    /home/icub/.local/share/yarp nfs _netdev,auto,bg 0 0`

Then create the two above mountpoints as follows

` mkdir -p /home/icub/.local/share/yarp`

` mkdir -p /usr/local/src/robot`

## NTP configuration

@@ -105,139 +76,22 @@ Then create the two above mountpoints as follows

You should configure this machine as an NTP client and then configure the NTP service to point to `icub-srv` as an NTP server.

You can use several different packages to install an NTP client, but we recommend using `ntpdate` and removing the package `ntp`, as in the following.

1. Remove `ntp` package if installed

`sudo apt purge ntp`

2. Install `ntpdate` package

`sudo apt install ntpdate`

3. edit `ntpdate` configurations
You can use several different packages to install an NTP client, but we recommend using `systemd-timesyncd` and removing the package `ntp`, if present.

`sudo vim /etc/default/ntpdate`
To configure `timesyncd` the only thing needed is to edit the file `/etc/systemd/timesyncd.conf` adding the line `NTP=10.0.0.1` or your current NTP server IP address.

by changing the following lines
Not mandatory but recommanded add also in the same file the line `FallbackNTP=ntp.ubuntu.com` this will be our backup NTP server.

`NTPDATE_USE_NTP_CONF=no`

`NTPSERVERS="10.0.0.1 ntp.ubuntu.com"`
Finally restart `timesyncd`service

`sudo systemctl restart systemd-timesyncd`

## iCub user environment variables

!!! warning "in case of iCub dedicated server"
Skip this step in case of [iCub Dedicated Server](icub-server-from-scratch.md)

Please see [this section](../icubos/user-env.md)

## iCub bashrc customization

There are several customizations you need to apply to the file `~/.bashrc_iCub`:

- The YARP_ROBOT_NAME - you must insert your robot name, in the following line and remove comment

`#export YARP_ROBOT_NAME=`

- The build path - the folder name where you object are created by cmake, in the following line

`#export OBJ_SUBDIR="build" `

# _Optional_ - Configure remote desktop

!!! warning "in case of iCub dedicated server"
Skip this step in case of [iCub Dedicated Server](icub-server-from-scratch.md)

If you want to setup a VNC remote desktop, execute from a graphical session the following command

` vino-preferences`

If you get this error _The authentication mechanism requested can not be provided by the computer_ please launch the following command, from a shell terminal

` gsettings set org.gnome.Vino enabled true`

# _Optional_ - Disable the screen power off

!!! warning "in case of iCub dedicated server"
Skip this step in case of [iCub Dedicated Server](icub-server-from-scratch.md)

Using the gnome3 control panel, it is not possible to avoid the system has to be idle for the monitor to be turned off, the maximum time is "1 hour", "never" is not possible. From the command line execute the following commands

`gsettings set org.gnome.settings-daemon.plugins.power sleep-display-ac 0`

`gsettings set org.gnome.settings-daemon.plugins.power sleep-display-battery 0`

`gsettings set org.gnome.desktop.session idle-delay 0`

## _Optional_ - install nVidia video drivers

!!! warning "in case of iCub dedicated server"
Skip this step in case of [iCub Dedicated Server](icub-server-from-scratch.md)

1. Check if you have nVidia hardware

`sudo ubuntu-drivers devices`

and check the command output. In case of nVidia hardware you should see somthing like the following example

```
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
vendor : NVIDIA Corporation
modalias : pci:v000010DEd00000DDAsv000017AAsd000021D1bc03sc00i00
model : GF106GLM [Quadro 2000M]
driver : xserver-xorg-video-nouveau - distro free builtin
driver : nvidia-304-updates - distro non-free
driver : nvidia-304 - distro non-free
driver : nvidia-331 - distro non-free recommended
driver : nvidia-331-updates - distro non-free
```

The above example is showing that there are several different nVidia driver versions available, you should choose the **recommended** one (the `nvidia-331` in above example )

2. Install the appropriate nVidia driver, as follows (for the example above)

`sudo apt install nvidia-331`

3. Reboot

For further details, please read [this guide](https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia)

## _Optional_ - Fix the the .local domains resolution problems

!!! warning "in case of iCub dedicated server"
Skip this step in case of [iCub Dedicated Server](icub-server-from-scratch.md)

Edit `/etc/nsswitch` replacing the following line

` hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4`

with

` hosts:          files dns`

## _Optional_ - how to fix ssh lag on connect

In case of lag in SSH connections, disable DNS lookup on ssh server, edit the file `/etc/ssh/sshd_config` adding the following line

`UseDNS no`

## _Optional_ - how to fix the \"nobody:nobody\" NFS mount issue

!!! warning "in case of iCub server"
This skip is valid only for machines were you mount a NFS repository, so you must skip it in case of [iCub Console Server](icub-server-laptop.md) or [iCub Dedicated Server](icub-server-from-scratch.md)

If the NFS mounts shows NOBODY as UID and GUID, this mean that the client and the server are not in the same domain, check the file

` /etc/idmap.conf`

Usually it is derived from the domain name mentioned in

` /etc/resolv.conf`

so both, server and client must match.
see [_User Environment_](../icubos/user-env.md) chapter

## Customize the system

4 changes: 1 addition & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -228,10 +228,9 @@ nav:
- Introduction: icub_operating_systems/icubos/icubos.md
- BIOS Tweaks: icub_operating_systems/icubos/bios.md
- Installation:
- Installation from pre-built image: icub_operating_systems/icubos/installation-from-image.md
- Installation from scratch: icub_operating_systems/icubos/installation-from-scratch.md
- Installation from scratch-22.04: icub_operating_systems/icubos/installation-from-scratch-22.04.md
- Installation from Ansible playbook: icub_operating_systems/icubos/installation-from-ansible-playbook.md
- Installation from pre-built image: icub_operating_systems/icubos/installation-from-image.md
- Networking: icub_operating_systems/icubos/networking.md
- Bluetooth: icub_operating_systems/icubos/bluetooth.md
- User environment: icub_operating_systems/icubos/user-env.md
@@ -243,7 +242,6 @@ nav:
- Details: icub_operating_systems/pc104/the-icub-live-details.md
- The OS on other machines (not on robot):
- Generic iCub environment machines: icub_operating_systems/other-machines/generic-machine.md
- Generic iCub environment machines-22.04: icub_operating_systems/other-machines/generic-machine-22.04.md
- The iCub Server:
- The iCub Dedicated Server:
- Summary: icub_operating_systems/other-machines/icub-server-os.md

0 comments on commit bcdf82d

Please sign in to comment.