Skip to content

Datalogger setup log

vaclavstepan edited this page Jun 15, 2016 · 19 revisions

Goal

Setup for data acquisition from GPS, humidity, altimet, NB. Machine reachable at adsb.local.

Steps

Packages

apt-get install ntp ntpdate gpsd gpsd-clients udhcpd lighttpd pyserial

Disabled GUI and set time zone

update-rc.d -f lightdm remove
echo Etc/UTC >/etc/timezone
sudo dpkg-reconfigure --frontend noninteractive tzdata

GPSd setup

dpkg-reconfigure gpsd Autostart yes, usb automatically no, device /dev/ttyS2, options -n, sock keep default.

Alternative way for time sync from GPS: Chrony

Previously, ntp was used for time synchronization. But this clashes with the gpsd as it attempts to open the ttyS2 concurrently. One option is to use two outputs (ttyACM0 for the USB readout and ntp daemon and ttyS2 for gpsd).

Chrony takes about one minute to synchronize, this is the chrony.conf used:

refclock SHM 0 refid GPS poll 2 trust
makestep 0.1 -1
keyfile /etc/chrony/chrony.keys
commandkey 1
driftfile /var/lib/chrony/chrony.drift
# log tracking measurements statistics
# logdir /var/log/chrony
dumponexit
dumpdir /var/lib/chrony
local stratum 10
logchange 0.5
rtconutc

Data store

Data shall be stored to SD card. 32 GB SD card with ext4 mounted at /data, bound to /dev/mmcblk1p1 in fstab.

DHCP server setup

IP set in nm-connection-manager to 192.168.0.5 static, gw 192.168.0.1, so the network would be accessible.

Edited /etc/default/udhcpd to enable the daemon start.

Modified /etc/udhcpd.conf to:

start		192.168.0.20	#default: 192.168.0.20
end		192.168.0.40	#default: 192.168.0.254
interface	eth1		#default: eth0
option	domain	local
option	lease	864000		# 10 days of seconds

Basic web server setup

First we'll try lighttpd. The setup was modified to include:

server.document-root        = "/data"
server.dir-listing          = "enable"

LCD display status info

Todo

Dashboard

https://plot.ly/python/dashboard/