Any views expressed within media held on this service are those of the contributors, should not be taken as approved or endorsed by the University, and do not necessarily reflect the views of the University in respect of any particular issue.

Piccolo3 spectral systems

Piccolo3 spectral systems

Mac Arthur A.(1,2), Hagdorn, M.(1), Taylor R.(3), and Robinson I. (4). (1) GeoSciences, U. of Edinburgh, (2) LEO/IPL U. of Valencia, (3) Physics, U. of Edinburgh, (4) Rutherford Appleton Laboratories

Piccolo3 System User Guide. Section 05. Useful terminal commands incl. fresh OS build

Note if the Piccolo is named (i.e. piccolo3-20  when supplied) that name can be used to access the system when a computer is connected to the RPi directly by an Ethernet cable using Link-Local. The Piccolos are also provided with a fixed IP address 192.168.5.254 and this can be used to connect directly. However, if the Piccolo it is being accessed over a network the network may assign an IP address. It is the user’s responsibility to determine how to connect over a network as each institute may have different approaches and preferences. It is also individual, users responsibility to change the password provided and set up security access if the piccolos are online over open networks.

To update piccolo bundles copy bundle to a convenient location (say /home/) and : sudo dpkg -i piccolo2-*-bundle_*_amd64.deb . If dependency problem errors are reported run : sudo apt-get install -f. Then run: sudo dpkg -i piccolo2-*-bundle_*_amd64.deb again. Note computer with Player bundle will need to be connected to the internet to get dependency updates.

To find the IP address of all computers (including the Piccolo’s RPis) connected on a network use: avahi-browse -ar

To ssh to the piccolo on a local network: ssh pi@I

To run Piccolo Player GUI (now obsolete): piccolo2-player -u http://IP:8080 # IP can either be the ip address or piccolo name

To view the piccolo log file on a monitor as the system runs: tail -f /var/log/piccolo.log

To check the current working directory type: pwd

To copy the log file off the RPi and onto a networked computer: sudo scp pi@*.local:/var/log/piccolo.log  /localComputer/

To initiate the trigger software so that it ‘listens’ for the trigger command (2ms pulse) from a DJI UAV ssh to the piccolo and type: sudo nohup piccolo2-triggered & # you may need to cd /tmp if the trigger is not in the home/pi dir

To copy data off the Piccolosudo scp -r pi@*.local:/mnt/piccolo2_data/ /localComputer/

To routinely syncronise data on your storage location with the Piccolo: rsync -avv pi@IP:/mnt/piccolo2_data/ localComputer/data-directory/

To give R/W access to the data once copied of the piccolo it may be necessary to run: sudo chown -R username /localComputer/piccolo2_data/

To list blocks use: lsblk and will see root for SD card (normally mmcblk0 ) and the blocks( boot sector and Piccolo OS sector).

To list usb devices attached to Piccolo3/RPi ssh to piccolo3 through terminal and use lsusb. For two OO QEPros attached and defined on piccolo.config there should be Bus 001 Device 005: ID 2457:4004  and
Bus 001 Device 006: ID 2457:4004 or similar listed as well as other ‘named’ devices.

i.e. Bus 001 Device 004: ID 0951:1666 Kingston Technology DataTraveler 100 G3/G4/SE9 G2
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
or similar

Note If dd is used to image one piccolo OS onto a larger SD card sudo raspi-config -expand-rootfs should be used to resize the rootfs partition

To change Raspberry Pi password use passwd in terminal without sudo and will be prompted for current password i.e “raspberry” with user name “pi” as supplied  by Raspberry Pi Org. Then input the password you wish to use and will be prompted to input again (repeat) to check and set. Then sudo reboot

Set ssh connection to enabled sudo systemctl enable ssh

To list serial number of attached spectrometers  ssh to piccolo3-* Make yourself boss sudo bash. cd to  /opt/venv/piccolo3-server/bin/ . Then activate the virtual env . activate  Stop server  systemctl stop piccolo3-server  and run the script piccolo3-list-spec. The attached spectrometer serial numbers should be listed. The piccolo.config should have exactly these serial numbers for the piccolo3 to run.

To transfer an image of Raspian or the Piccolo operating system to an SD card to build the Piccolo OS if /dev/mmcblk0 is the location and id of the card  sudo dd bs=4M if=/locationOfImage/2017-07-05-raspbian-jessie.img of=/dev/mmcblk0. Note ‘if’ is the in file ‘of’ is the out file

To reboot piccolo server  in terminal type: sudo reboot Note enough time needs to be taken for the piccolo to initiate and connect to the spectrometers before it can be accessed via ssh or player.

To shut down the piccolo in a terminal type: sudo poweroff Note this powers down the RPi It cannot then be restarted remotely. It will need the power supply turned off and turned back on to restart the system

To enable ssh on a new Jessie build: systemctl enable ssh followed by: systemctl start ssh

To enable the memory stick with the piccolo.config to mount on a new build:  pico /etc/piccolo.cfg then edit mount = True and url = http://0.0.0.0:8080

To set laptop time to UTC: sudo timedatectl to check what zone is currently set; then sudo timedatectl set-timezone UTC ; then check again.

If  checking the status of piccolo3-server or piccolo3-web is required use systemctl status piccolo3-server or systemctl status piccolo3-web as appropriate
If restarting piccolo3-server or piccolo3-web is required use systemctl enable piccolo3-server or systemctl enable piccolo3-web as appropriate
————————————————————————————————————————————————————————————————-

To build a fresh install of piccolo3 OS from a laptop terminal image  the latest raspian lite to an SD card then use piccolo3/rpi3 terminal to  set a new password; enable and start ssh; then build the Piccolo3 OS as below:

#this section rewritten 2023/11/13 to build piccolo3 OS from debs provided by TeamPiccolo. Note users should be familiar with Raspberry Pi operation 
# and set up and use of Linux terminal commands. 

# Memory stick attached to piccolo3 needs to be formatted and in the form of a generic example of piccolo.config. This can be seem at #https://github.com/TeamPiccolo/piccolo3-server/blob/master/pdata/piccolo.config
# and piccolo.config needs to be in dir piccolo3_data on that stick

# To build piccolo3 with desktop functionally to control and visualise from monitor attached tp RPi3 or from remote location from TeamPiccolo supplied *.debs
# Download 2022-09-22-raspios-buster-armhf-lite.img from 
# https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2022-09-26/2022-09-22-raspios-buster-armhf-lite.img.xz download and unpack.
# image buster lite OS to a new or reformatted 8gb SD (industrial grade is best) N.B. This process will wipe all previous data from SD card
sudo dd bs=4M if=/your location/2022-09-22-raspios-buster-armhf-lite.img of=/dev/mmcblk0 

# create dir on SD for piccolo3 package
sudo mkdir /your RPi/home/pi/packages

# copy piccolo3 *.debs (provided by TeamPiccolo) to SD card
sudo scp -r /your location/piccolo3-server-bundle_0.2-4_armhf.deb /media/amacarth/rootfs/home/pi/packages/

# insert SD card into RPi3 with piccolo control board attached, correctly formatted memory stick attached, combined keyboard&mouse attached and appropriate spectrometers attached and running.
# log onto RPi3 using standard Raspberry PI user and password
#open RPi3 config interface
sudo raspi-config

# configure wi-fi to your own settings for country, SSID (network wi-fi id) & password (passphrase), change RPi password and hostname to your own choice. Note user name will remanin pi and on reboot you should see pi@your hostname: at the command line prompt.
# reboot
# update & upgrade RPi OS then reboot
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo reboot

# install lite weight desktop environment with chromium browser so that piccolo3 can be controlled & visualised via an HDMI monitor attached to RPi3
sudo apt install xserver-xorg
sudo apt install mate-desktop-environment-core
sudo apt install lightdm

# reboot to desktop Input username (pi) and your password
sudo reboot

#install chromium browser
Applications>system tools> Mate terminal
sudo apt install chromium-browser

# check and note ip address
hostname -I
sudo reboot

# install python3 dependencies
sudo apt install python3-numpy python3-psutil python3-configobj python3-daemon python3-tz python3-gpiozero python3-dateutil python3-lockfile python3-bitarray python3-scipy python3-sqlalchemy python python3-usb

# install piccolo3 debs
cd packages/
sudo dpkg -i piccolo3-server-bundle_0.2-4_armhf.deb

# set up ssh for remote connection
sudo systemctl enable ssh
sudo systemctl start ssh
#edit piccolo.cfg note /etc/ is a dir in the OS root. If you are in /home/pi then
sudo nano ../../etc/piccolo.cfg

# the contents should show the following
[coap]
address = ::
port = 5683
[daemon]
daemon = False
[datadir]
mount = True
datadir = piccolo3_data
device = /dev/sda1

#exit and save
# activte and start piccolo3 server; web, trigger and reboot architecture and 
sudo systemctl enable piccolo3-server piccolo3-web piccolo3-triggered piccolo3-reboot
sudo systemctl start piccolo3-server
sudo systemctl start piccolo3-web

# check piccolo system operating
tail -f /var/log/piccolo.log

# restart
sudo reboot
#open chromium browser and input RPi3/piccolo ip address 
ip address:8000

#or
hostname:8000

#browser should connect to piccolo3 control interface
#check operation by taking measurement
# observe operation
tail -f /var/log/piccolo.log

# note to access from terminal remotely use
ssh pi@ip address

# or
ssh pi@hostname

# to turn off piccolo3 use either terminal and power down
sudo poweroff
Note you should add your unique piccolo3-your id to /etc/hostname
Also edit /etc/hosts to have:

127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.1.1 piccolo3-your id

————————————————————————————————————————————————————————————————————————————

Note a script to build the Piccolo3 OS, after raspian base has been installed, can be downloaded from Github. See /piccolo3-build-scripts. There are also scripts to enable system time from a GPS attached to the Piccolo3/RPi GPIO and to build Kiosk. N.B. these scripts  still have to be tested by AM

————————————————————————————————————————————————————————————————————————————–

The Piccolo systems sometimes hangs when writing data to the memory stick. This ‘hang’ may be due to corrupted sectors on the stick caused by not unmounting the stick correctly (other possible causes are being investigated 20180815). Not using sudo poweroff to shut down the Piccolo, or general ware and tear. It may be possible to repair sectors using sudo fsck.msdos -aw /dev/sda1 (if /dev/sda1 is the mount point of the stick). N.B health warning This may irretrievably corrupt the stick and cause all data on it to be lost!! Back up first!! Memory sticks are a ‘consumable’ and should be replaced periodically.

css.php

Report this page

To report inappropriate content on this page, please use the form below. Upon receiving your report, we will be in touch as per the Take Down Policy of the service.

Please note that personal data collected through this form is used and stored for the purposes of processing this report and communication with you.

If you are unable to report a concern about content via this form please contact the Service Owner.

Please enter an email address you wish to be contacted on. Please describe the unacceptable content in sufficient detail to allow us to locate it, and why you consider it to be unacceptable.
By submitting this report, you accept that it is accurate and that fraudulent or nuisance complaints may result in action by the University.

  Cancel