User Tools

Site Tools

Translations of this page?:

en:image-c2

This is an old revision of the document!


FIXME This page is not fully translated, yet. Please help completing the translation.
(remove this paragraph once the translation is finished)

Preparing a station’s image with ODROID-C2 and SDR-widget

A prerequisite is a computer with a working operating system Ubuntu 16.04.LTS. Computer’s architecture can be either ARM or Intel. Both cases are identical to the way of connecting further hardware such as I²C.

$ sudo apt-get install build-essential cmake libusb-dev cython libudev-dev python-setuptools python-numpy python-cheetah libboost-all-dev libfftw3-dev libcfitsio-dev libjack-jackd2-dev autossh gpsd-clients buffer pv ntp libvolk1-dev git libhidapi-hidraw0 libhidapi-libusb0 libusb-1.0-doc curl python-websocket

I2C

git clone https://github.com/MLAB-project/i2c-tools.git
cd i2c-tools
make EXTRA="py-smbus"
sudo make install
cd py-smbus
sudo python setup.py install
sudo ldconfig
$ mkdir ~/repos 
$ cd ~/repos
$ git clone https://github.com/MLAB-project/pymlab
$ cd pymlab
$ sudo python setup.py develop

In case of Odroid-C2, I²C has to be made work by a correct entry into /etc/modules, as described at MLAB wiki.

station-supervisor

$ cd ~/repos
$ git clone https://github.com/MLAB-project/python-mlab-utils.git
$ cd python-mlab-utils
$ sudo python setup.py install
$ cd ~/repos
$ git clone https://github.com/MLAB-project/station-supervisor.git

SDR-Widget

Loading the firmware

To load the firmware, you need an adjusted dfu-programmer, that can be downloaded in a following way:

sudo apt-get install autotools-dev automake  
git clone https://github.com/MLAB-project/dfu-programmer-sdr-widget.git
cd dfu-programmer-sdr-widget/
./bootstrap.sh
./configure
make
sudo make install

Precompiled version of Bolidozor firmware can be downloaded from:

wget https://github.com/MLAB-project/sdr-widget/releases/download/bolidozor-v01/widget.elf

Before running the recording script, press RESET button on AVR32TQ board and release it again. Next, press BOOT button (unlabelled button, hold it pressed until the next press and release of RESET). In this way, you activate the internal boot loader MCU. Then, the firmware loading can be run by a following command from dfu-programmer-sdr-widget folder.

 sudo ./program-widget widget.elf

Checking the configuration

After a correct loading of the firmware, the sdr-widget hardware will become visible on USB and VID and PID will be set to fffe:0007. This setting will also be visible when running the configuration tool (it cannot be changed, it is fixed for a specific Bolidozor firmware version).

Konfigurace SDR-widget hardware.

System software

To read data from sdr-widget hardware, use the tools from signal-piping-tools repository.

$ cd ~/repos
$ git clone https://github.com/MLAB-project/signal-piping-tools.git
$ cd signal-piping-tools
$ make

Setting the user rights

The default user rights setting do not enable a direct communication with USB devices via libusb. User rights can be altered by creating a proper file in /etc/udev/rules.d/ , as follows:

$ sudo su
# curl https://raw.githubusercontent.com/borgestrand/sdr-widget/d4cc8700429bc1acef826f46d8e40df04e1f6e1c/etc/sdr-widget.rules > /etc/udev/rules.d/sdr-widget.rules
# exit

Now it is necessary to unplug and plug the USB device again. Then you can use libusb even from a standard user account.

radio-observer

$ cd ~/repos
$ git clone https://github.com/MLAB-project/radio-observer.git
$ cd radio-observer/
$ git submodule init
$ git submodule update
$ cd cppapp
$ make
$ cd ..
$ make

data-uploader

A programme providing a sending of recorded data can be installed following a guide at Upload system for measured data from stations.

Setting station’s time

Change the system time zone to UT.

sudo dpkg-reconfigure tzdata

Sometimes it is also necessary to generate a local setting, e.g.:

sudo locale-gen cs_CZ.UTF-8

Time synchronisation NTPd

Time synchronisation requires a daemon that handles the GPS socket for NTP (??který se stará o GPS povolit socket pro NTP).

It can be done in /etc/ntp.conf file

server 127.127.28.0 minpoll 4 prefer
fudge 127.127.28.0 time1 0.0 refid GPS

GPSd has to be at the sea time set to give data even without connected clients. It can be done during installation.

sudo dpkg-reconfigure gpsd
Start gpsd automatically on boot? Yes
Device the GPS receiver is attached to: /dev/ttyACM0
Should gpsd handle attached USB GPS receivers automatically? Yes
Options to gpsd: -b -n

Testing the synchronisation can be done following these instructions.

Getting an SD card ready

A new SD card has to be formatted to F2FS file system. In order to do it, you have to install a support for F2FS file system into your OS.

sudo apt install f2fs-tools gparted

Then you can use Gparted programme to format an SD cart to F2FS file system, which is optimised for memory media with a limited number of entries. The formatting can be done from a command line with a following command:

sudo mkfs.f2fs /dev/mmcblk1p1

Connect the formatted SD card to ~/bolidozor directory and set the file rights so that other users than root will also be granted an access.

sudo mount -t f2fs /dev/mmcblk1p1 ~/bolidozor/
sudo chgrp -R odroid bolidozor
sudo chown -R odroid bolidozor

Directories for saving the records and station’s configuration

Records and station’s settings are saved to ~/bolidozor.

mkdir -p ~/bolidozor/station/snapshots
mkdir -p ~/bolidozor/station/meteors
mkdir -p ~/bolidozor/station/data
cp ~/repos/radio-observer/Bolidozor.json ~/bolidozor/station/Bolidozor.json

The last command will copy a default configuration of radio-observeru to ~/bolidozor/station/Bolidozor.json, where a startup script awaits it. After copying, it is necessary to change a name of the station in this line. (The link contains a station named debug.)

Launching after startup

Because most stations are installed on Odroid computers, whose default user is called odroid, it is assumed that the user who runs the station software is also called odroid. Substitute the correct name for odroid if necessary.

It is also necessary to add to ’’/etc/rc.local what has to be launched after startup. All stations should launch /home/odroid/repos/station-supervisor/start.sh - this will run the station’s software. Because the station’s software should run under odroid user, the whole command should look like as follows: su odroid /home/odroid/repos/station-supervisor/start.sh If the records on Odroid should be written on an SD card, before the start.sh a /home/odroid/repos/station-supervisor/mount-sd-card.sh should also be run - it will connect the card via /home/odroid/bolidozor. The commands should be added to rc.local before exit 0, which will then remain at the end of the file. An example of /etc/rc.local'' after adjustments:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/home/odroid/repos/station-supervisor/mount-sd-card.sh

su odroid /home/odroid/repos/station-supervisor/start.sh &

exit 0

Automatic actualisations

Due to safety reasons it is recommended to let the automatic package actualisations activated. The actualisations are configured via /etc/apt/apt.conf.d/10periodic file. The following configuration has to be added to the file:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";

Next, we activate the setting by un-commenting desirable lines in /etc/apt/apt.conf.d/50unattended-upgrades file:

// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
	"${distro_id}:${distro_codename}";
	"${distro_id}:${distro_codename}-security";
	"${distro_id}:${distro_codename}-updates";
//	"${distro_id}:${distro_codename}-proposed";
//	"${distro_id}:${distro_codename}-backports";
};

A detailed guide at Ubuntu wiki

en/image-c2.1551709398.txt.gz · Last modified: 2019/03/04 14:23 by fluktuacia