Precision Pendulum Assembly: Software management

From wwwelab
Jump to navigation Jump to search

PAGE UNDER CONSTRUCTION

Software management

The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.

Operating System Installation

Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is highly recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.

Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.

When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from this link. Three versions are available:

  • The lite version contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).
  • The desktop version contains the same software as the lite version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).
  • The desktop and recommended software version contains the same software as the desktop version plus some pre-selected software and utilities.

The same software is available for installation on all versions, meaning that one can start with a lite version and later install all the software included in the desktop and recommended software version. If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the lite or desktop version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the lite version is of special interest as it doesn't package the GUI, which is only useful if you use a display.

The Raspberry Pi Foundation provides installation instructions for the Raspbian OS here.

After Installation

After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:

Using the RPi through a keyboard, mouse and display

When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. Do not connect the RPi to the internet before completing the OS configuration, as described below.

Connecting to the RPi through a ssh connection

If a keyboard, mouse and display are not available to use and interact to the RPi, it's still possible to interact with it by setting up the SSH service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be ajusted in order to be able to

To perform a inital SSH service setup on the RPi:

  • Insert the SD card into a computer, e.g. the one used to install the OS on the card.
  • After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).
  • On the smaller "drive", create an empty file called ssh. This enables the SSH service for the next boot. This setting will be made permanent later.
  • On the bigger "drive", edit the file "/etc/dhcpcd.conf". On the end of the file, there should be a section of text similar to this:
# It is possible to fall back to a static IP if DHCP fails:
# define static profile
profile static_eth0
static ip_address=123.123.123.123/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1

# fallback to static profile on eth0
interface eth0
fallback static_eth0

Edit the file so it mimics the text shown above. The line:

static ip_address=123.123.123.123/24

Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through DHCP. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.

  • The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted

The computer used to connect to the Raspberry Pi then needs it's network settings configured in order to


Operating System Configuration

After installation, the OS needs to be configured. The first task before connecting the RPi to the internet must be to create a new user and delete the default user. Since all fresh Raspbian OS installs have the same default user and password, that everyone can find on the internet, keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.

Hardware Server

Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:

  • Validate if rec-deployement directory exits, if not create by typing:
    mkdir ${home_directory}/rec-deployement 
  • Unzip HardwareServer's zip file to rec-deployment directory
    unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}
  • Start HardwareServer:
    cd ${home_directory}/rec-deployement/${hardwareServerAliasName} && ./Start${AliasName}Driver.sh
  • Video Streaming

    Next Page (Calibration)