• Building a cluster
  • Operational System
  • UpBoard Configuration

UpBoard Configuration

Login ID: ubuntu

PASSWORD:turin

System Operational Installation

  1. Download Ubuntu 20.04.4 ISO from the Ubuntu download page, we used server edition

  1. Burn the downloaded image on a USB stick. We suggest using etcher or rufus for doing that. You can download the suggested software from:

https://etcher.io

https://rufus.ie

  1. Insert the USB installer disk in an empty USB port and proceed with a normal Ubuntu installation.

Setup UpBoard kernel

To access the upboard gpios, we need to change the default kernel to UpBoard kernel.

  1. Add the upboard repository:
sudo apt update && sudo apt upgrade
sudo add-apt-repository ppa:up-division/5.4-upboard
  1. Update the repository list
sudo apt update
  1. Remove all the generic installed kernel
sudo apt autoremove --purge linux-*generic
  1. Install the tested kernel:
sudo apt-get install linux-generic-hwe-18.04-5.4-upboard
  1. Install the updates:
sudo apt dist-upgrade -y
sudo update-grub
  1. Reboot the system
sudo reboot
  1. Test if all is done right:
uname -a

Linux upxtreme-UP-WHL01 5.4.0-1-generic #2~upboard2-Ubuntu SMP Thu Jul 25 13:35:27 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Configuring drivers

To be able to use the GPIO, PWM, SPI, I2C and UART functionality with a normal user

  1. Install the upboard-extras
sudo apt install upboard-extras
  1. Add the user that needs to access the HAT funcionality

    GPIO

    sudo usermod -a -G gpio $USER
    

    LEDs

    sudo usermod -a -G LEDS $USER
    

    SPI

    sudo usermod -a -G SPI $USER
    

    I2C

    sudo usermod -a -G i2c $USER
    

    UART

    sudo usermod -a -G dialout $USER
    
  2. Reboot the system to apply the permission changes

sudo reboot

Installing RPi.GPIO library

To have access to GPIO with python, install the RPi.GPIO lib for upboard

  1. This package provides a class to control the GPIO on a Raspberry Pi, ported to work on the UP board hardware, Download the GitHub
sudo apt install python3-pip
git clone https://github.com/emutex/RPi.GPIO.git
  1. Install the package
cd RPi.GPIO 
sudo python3 setup.py install
  1. Clone Blinkt repository
cd 
git clone https://github.com/pimoroni/blinkt.git
  1. Install the blinkt package
sudo pip install blinkt
  1. Run one example
python3 /home/ubuntu/blinkt/examples/rainbow.py
  1. Create a file to run like the example below:
> blink.sh
  1. Open the file and paste the code:
nano blink.sh
#! /bin/bash

python3 /home/ubuntu/blinkt/examples/rainbow.py 
chmod a+x blink.sh
  1. Create the file with this path:
sudo nano /lib/systemd/system/rainbow-leds.service
#systemctl enable rainbow-leds.service

[Unit]
Description=enableHotSpot
After=network.target

[Service]
User=root
Type=forking
ExecStart=/home/ubuntu/blink.sh
StandardOutput=journal

[Install]
WantedBy=multi-user.target
sudo systemctl enable rainbow-leds.service
sudo systemctl start rainbow-leds.service

References:

up-board/up-community

pimoroni/blinkt