Skip to content

TDM Edge Gateway Installation

Massimo Gaggero edited this page Jan 21, 2019 · 2 revisions

TDM Edge Gateway Installation

REQUIREMENTS

The installation requirements are:

  • A PC with a Linux distribution and a SD/microSD card reader;
  • root’ privileges;
  • SD/microSD adapter;
  • WiFi connection.

The current Edge Gateway version is composed by:

  • A Raspberry Pi 3;
  • power supply 220V/5V able to deliver at least 2.5A;
  • class 10 microSD (min 8GB, suggested 16GB);

The described installation procedure allow to:

  • Install the customized operating system on the Edge Gateway;
  • configure the local WiFi;
  • install EDGE microservices;
  • configure the TDM software and start services

Moreover an example of connection between the Edge system and a temperature/humidity sensor ( HTD21D) is shown.

INSTALLATION OF THE OPERATING SYSTEM

Note: The power supply of the Raspberry Pi 3 must be able to deliver al least 2.5A to avoid malfunctioning and filesystem corruption.

Note: The procedure here described is partially based on the installation of Archh Linux to the ARMv7 architecture (available at: https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-3).

To complete successfully the installation, the commands have to be typed on a Linux console as ‘root’ user or with administrator privileges. A ‘sudo’ shell can be used as well. To start a ‘sudo’ shell type:

sudo -s

and insert the user password.

WARNING: the following instructions will erase all filesystems on microSD. Every file will be deleted. Pay close attention to the names of the devices to which the commands are directed.

Replace sdX with the name of the SD device as shown on the display. The command fdisk -l can be used before and after the insertion of the SD card to find out the right device ID.

  1. Insert the microSD to the SD card reader (use the adapter if needed);
  2. before partitioning the microSD check if the operating system mounted some existing partition on the SD. To do it, take a look at the mount command output. If one or more partition with sdX suffix is present (for instance sdX1) unmount by typing:
umount /dev/sdX{partition_number}
  1. Create partitions on the microSD by using the fdisk command:
fdisk /dev/sdX
  1. At fdisk prompt, remove old partitions and create a new one:

a. Type o + ENTER. All the partitions will be erased

b. Type p + ENTER to list the partition. The output should be empty.

c. Type n + ENTER, then p to select primary partition, 1 to specify the first partition on the device. Accept the default first sector pressing ENTER and type +100M to specify the last sector. If required, press y to remove the vfat or ext4 signature from the first partition.

d. Type t + ENTER, then c to set the first partition type to W95 FAT32 (LBA).

e. Type n + ENTER, then p to select primary partition, 2 to specify the second partition on the device. Press twice ENTER to accept the default values of first and last sector. If required, press y to remove the vfat or ext4 signature from the first partition.

f. Type w + ENTER to write out the partition table and quit fdisk.

  1. Creation and mount of the FAT filesystem:
cd /tmp/
mkfs.vfat /dev/sdX1
mkdir boot
mount /dev/sdX1 boot
  1. Creation and mount of the ext4 filesystem:
mkfs.ext4 /dev/sdX2
mkdir root
mount /dev/sdX2 root
  1. Download and extraction of the root filesystem (to preserve file permissions, run the command as root user instead of using the sudo command):
wget --content-disposition https://space.crs4.it/s/ywvVDh3tuOBWCZ2/download
tar -xpf TDM-Arm-image-latest.tar.gz -C root
sync
The ‘*tar*’ command could issue error messages:
  • tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
  • tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'

On some system it is a common behavior and can be ignored.

  1. Move startup files to the first partition:
mv root/boot/* boot
  1. Unmount both partitions:
umount boot root

If the previous commands were issued from a ‘sudo’ shell, exit by pressing CTRL+D or typing:

exit
  1. Reboot the Edge Gateway