To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 51020d7a authored by beuchatp's avatar beuchatp

Updated wiki with instructions relating to installation, IP addresses, and...

Updated wiki with instructions relating to installation, IP addresses, and network configuration for Raspberry Pi
parent 2089f248
# Table of Content
The wiki is split into the following sections
- [Installation and Setup](install_and_setup/README.md)
- [ROS structure](ros_structure.md)
- [Workflow for students](workflow_for_students.md)
- [FAQs](faq.md)
- [ROS structure](ros_structure/README.md)
- [Workflow for students](workflow_for_students/workflow_for_students.md)
- [FAQs](faq/faq.md)
# Installation ToC:
- [Installation](installation.md)
- [Installation on a computer already running Ubuntu](installation_on_ubuntu.md)
- [Installation of Ubuntu on a RaspberryPi](installation_of_ubuntu_on_raspberry_pi.md)
- [Network configuration of a RaspberryPi](network_configuration_of_raspberry_pi.md)
- [Installation of the ``dfall-system`` on a RaspberryPi](installation_of_dfall_on_raspberry_pi.md)
- [IP address and internet access for on a RaspberryPi](ip_address_and_internet_access_for_raspberry_pi.md)
# Setup ToC:
......
# Raspberry Pi Installation
## Install ROS
Download the appropriate installation script
```
dfall_install_ros_melodic_ubuntu18_raspberry_pi.sh
```
Change the permissions of the file to make it executable using the command
```
chmod +x dfall_install_ros_melodic_ubuntu18_raspberry_pi.sh
```
Run the installation script using the command
```
./dfall_install_ros_melodic_ubuntu18_raspberry_pi.sh
```
## Install the apache web server
```
sudo apt install apache2
```
## Install php
```
sudo apt install php
```
## Permanently Disable IPv6
Taken from: https://www.configserverfirewall.com/ubuntu-linux/ubuntu-disable-ipv6/
Open the ``/etc/sysctl.conf`` file for editing:
```
sudo nano /etc/sysctl.conf
```
Add the following lines at the end of the ``sysctl.conf`` file:
```
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
```
To make the change take effect, enter the command:
```
sysctl -p
```
Then, enter the following command to check the IPv6 status:
```
less /proc/sys/net/ipv6/conf/all/disable_ipv6
```
If the output is 1 then IPv6 is disabled, otherwise, if the output 0 then IPv6 is enabled.
To re enable IPv6 addresses, simply remove the above changes made to the ``sysctl.conf`` file and then enter the ``sysctl -p`` command.
## Clone the ``dfall-system`` repository
Create a shared folder
```
cd /home
sudo mkdir www-share
sudo chmod 777 www-share
cd www-share
sudo -u www-data mkdir dfall
sudo -u www-data chmod 775 dfall
```
Clone the repository:
<br>
NOTE: very important here is that the repository is cloned as ``the www-data`` user.
```
cd /home/www-share/dfall
sudo -u www-data git clone https://gitlab.ethz.ch/dfall/dfall-system
```
Add the necessary line to the ``/etc/sudoers`` file that allows the ``www-data`` user to execute ``git pull`` commands:
```
www-data ALL=(www-data) /usr/bin/git pull
```
Add the ``www-data`` user to the ``plugdev`` group
<br>
NOTE: this is the group nominated in the ``udev rules`` for the CrazyRadio (see the ``install`` folder. This allows a CrazyRadio node that is launched by the web interface to access the CrazyRadio USB dongle.
```
sudo usermod -a -G plugdev www-data
```
To confirm the group allocation, view the ``group`` file using the command:
```
less /etc/group
```
If you need to remove a user from a group, then use the command:
```
deluser www-data plugdev
```
where the syntax here is: ``deluser <username> <groupname>``
## Copy across the 99.crazy.rules
## Make the ``www-data`` user the owner of the ``/var/www/`` folder
This is required so that the web interface can be update by calling a php script that deletes all the contents of the ``/var/www/`` folder and copies the web interface files from the ``dfall-system`` repository that was cloned to above the location ``/home/www-share/dfall``.
Enter the following commands:
```
sudo chown -R www-data /var/www
sudo chgrp -R www-data /var/www
sudo chmod -R g+w /var/www
```
## Copy across the website
Enter the following command:
```
sudo -u www-data cp -R /home/www-share/dfall/dfall-system/web_interface/html/* /var/www/html/
```
## Useful commands
The apache web server can be ``{stop,start,restart,reload}`` using the ``systemctl`` command as follows:
```
sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl restart apache2.service
sudo systemctl reload apache2.service
```
# Installation
On this page:
- [For student and teacher](#for-stuent-and-teacher)
- [Vicon Datastream SDK installation](#vicon-datastream-sdk-installation)
- [Additional steps for teacher](#additional-steps-for-teacher)
- [Steps for adding a Crazyflie to the system](#steps-for-adding-a-crazyflie-to-the-system)
## For Student and Teacher
### Install Script
......@@ -103,7 +110,7 @@ If you follow the steps above, then the ``<catkin workspace>`` should be ``~/dfa
If you are not sure at any point you can check out the ``dfall_install.sh`` script.
### Vicon Datastream SDK Installation
## Vicon Datastream SDK Installation
A Vicon motion capture system can be used to provide position and attitude measurements of the Crazyflie and close the feedback loop. The software provided by Vicon is propriety and hence is not included in this piece of Open Source software. In order to make the position and attitude data accessible over the network, the piece of software called the Datastream SDK needs to be downloaded and placed in the correct folder. Complete the following steps to achieve this:
......
# Raspberry Pi Installation
## SETUP THE ETHERNET NETWORK CONNECTION
The networking is handled by ``netplan`` and hence network specifications are contained in the ``/etc/netplan`` folder. As installed, this folder should contain only one file named ``50-clound-init.yaml``, and the contents of the file should look something like:
```
network:
version: 2
ethernets:
eth0:
dhcp4: true
match:
macaddress: xx:xx:xx:xx:xx:xx
set-name: eth0
```
You should change this file depending on the network to which the RaspberryPi will be connected. Examples are provided below for common setup options.
After you have edited the file, using for example ``sudo nano /etc/netplan/50-clound-init.yaml``, then you can make the changes active by first validating the changes using the command:
```
sudo netplan try
```
This should return a message informing you whether the new configuration is valid or not. If the configuration is not valid, then the system reverts to the previous settings, and the likely cause of the error is a typing mistake.
Once validated, apply the changes using the following command:
```
sudo netplan apply
```
### Configuration when using a desktop environment
If using a desktop environment, then you specify that the ``network-manager`` provided by the desktop is in charge of managing connections by editing the ``50-clound-init.yaml`` file to be the following:
```
network:
version: 2
renderer: NetworkManager
```
Don't forget to ``try`` and ``apply`` the changes as described above.
### Configuration for a fixed IP address
If you did not install a desktop environment, i.e., you are running "headless" Ubuntu, then you can set a fixed IP address by editing the ``50-clound-init.yaml`` file to be the following:
```
network:
version: 2
ethernets:
eth0:
dhcp4: false
addresses: [10.42.0.11/24]
gateway4: 10.42.0.0
nameservers:
addresses: [8.8.8.8,8.8.4.4]
```
The address ``10.42.0.11/24`` should be replaced by the IP address and netmask you desire. The ``/24`` specifies the most comment netmask of ``255.255.255.0``. It is also possible to leave out the ``gateway4`` and ``nameservers`` specifications if the defaults are appropriate.
If the RaspberryPi is plugged into a home router then you should choose the fixed IP address to match the domain of the router. For example, if IP addresses on your home network take the form ``192.168.1.xxx`` where ``xxx`` is a number that addresses each device on the network. In this case it is important to specify the ``gateway4`` as the address of the router, typically with a ``1`` at the end and hence ``192.168.1.1`` in this example. It is also important to add the router's address to the ``nameservers: addresses``. For this example, the ``50-clound-init.yaml`` would look something like the following:
set a fixed IP address by editing the ``50-clound-init.yaml`` file to be the following:
```
network:
version: 2
ethernets:
eth0:
dhcp4: false
addresses: [192.168.1.11/24]
gateway4: 192.168.1.1
nameservers:
addresses: [192.168.1.1,8.8.8.8,8.8.4.4]
```
Don't forget to ``try`` and ``apply`` the changes as described above.
### Configuration for a dynamic IP address
To set the RaspberryPi to obtain an IP address dynamically from the host to which it is connected, then edit the ``50-clound-init.yaml`` file to be the following:
```
network:
version: 2
ethernets:
eth0:
dhcp4: true
```
The challenge when using this configuration is to find the IP address of the RaspberryPi once it is connected to the network.
Don't forget to ``try`` and ``apply`` the changes as described above.
### Useful commands for debugging network discrepancies
The following are some useful commands for checking the current connection status:
```
ifconfig
```
```
nmcli c show
```
# ROS Structure ToC:
- [Structure of ROS nodes and messaging](ros_structure.md)
- [Namespace conventions used for ROS nodes and messaging](namespace_conventions.md)
......@@ -38,4 +38,4 @@ NOTE:
## Launching nodes
To be filled in
\ No newline at end of file
To be filled in
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment