Deformation Monitoring Package (DMPACK)

May 27, 2026 · View on GitHub

Language License Version Build

DMPACK is a free software package for IoT-based automatic deformation monitoring and distributed control measurements in engineering geodesy and geotechnics. The project is the successor of OpenADMS and in active development.

The library and the accompanying programs are written in Fortran 2018, with some smaller parts in Lua 5.4. At the moment, DMPACK runs on 64-bit Linux and FreeBSD only.

Overview

DMPACK is a scientific monitoring system and sensor network middleware developed for automated control measurements of buildings, infrastructure, terrain, geodetic nets, and other objects.

The software runs on sensor nodes, usually IoT gateways, industrial embedded systems, or single-board computers, and obtains observation data from arbitrary sensors, like robotic total stations, digital levels, inclinometers, weather stations, or GNSS receivers.

The raw sensor data is then processed, stored, and optionally transmitted to a server. The software package may be used to monitor objects like:

  • bridges, tunnels, dams
  • motorways, railways
  • construction sites, mining areas
  • landslides, cliffs, glaciers
  • churches, monasteries, and other heritage buildings

DMPACK is built around the relational SQLite database for time series and log storage on client and server. The server component is optional. It is possible to run DMPACK on clients only, without data distribution. The client-side inter-process communication is based on POSIX message queues and POSIX semaphores.

System Architecture

Schema

Features

DMPACK includes modules for:

  • sensor control (RS-232/422/485, TTL/UART, Modbus RTU/TCP, 1-Wire, sub-process, file system)
  • SQLite database access
  • message passing with POSIX message queues
  • process synchronisation with POSIX semaphores
  • data serialisation (ASCII, CSV, GeoJSON, HDF5, JSON, JSON Lines, Namelist)
  • server-side web applications (CGI, FastCGI)
  • HTTP-based remote procedure call API
  • concurrent data synchronisation between client and server
  • FTP file transfer
  • client status messages (heartbeats)
  • distributed logging
  • Leica GeoCOM API in Fortran
  • Deutscher Wetterdienst (DWD) API
  • MPPT and solar battery monitoring (VE.Direct)
  • camera access (RTSP, V4L2)
  • time series plotting
  • Lua scripting
  • MQTT and XMPP connectivity
  • report generation (HTML5, PDF)
  • Atom XML web feeds
  • e-mail (SMTP)
  • compression (deflate, zstd)
  • regular expression matching

Requirements

DMPACK has the following requirements:

  • Linux or FreeBSD operating system
  • 64-bit platform (x86-64, AArch64)
  • Fortran 2018 and ANSI C compiler (GNU, LLVM, Intel)

Third-party dependencies have to be present to build and run the software of this package:

  • FastCGI
  • Gnuplot
  • HDF5
  • LAPACK
  • libcurl
  • libmodbus
  • libstrophe
  • Lua 5.4
  • PCRE2
  • SQLite 3
  • zlib
  • zstd

On Linux, development headers are required for compilation. It is recommended to additionally install:

  • FFmpeg
  • Ghostscript
  • GNU roff
  • GraphicsMagick

To generate the man pages, the user guide, and the source code documentation, you will need furthermore:

Program Overview

The following programs are based on the DMPACK library.

NameDescription
dmapiFastCGI-based HTTP-RPC API service.
dmbackupCreates online backups of DMPACK databases.
dmbeatSends status messages (heartbeats) periodically to RPC service.
dmbotXMPP chat bot that answers to commands from authorised users.
dmcameraCaptures images from USB webcam or IP camera.
dmdbStores observations received from message queue in database.
dmdbctlCommand-line interface to observation databases.
dmdwdReads weather reports from DWD open data API.
dmexportExports database records to file.
dmfeedCreates Atom feeds in XML format from log messages.
dmfsReads sensor values from file system (file, named pipe, OWFS).
dmgrcGenerates log messages from GeoCOM return codes.
dmimportImports CSV file into database.
dminfoPrints system and database information as key–value pairs.
dminitCreates and initialises DMPACK databases.
dmlogSends log messages to logger through message queue.
dmloggerStores log messages received from message queue in database.
dmluaRuns Lua script to handle observations received from message queue.
dmmbSensor control program for Modbus RTU/TCP.
dmmbctlCommand-line utility for read and write access to Modbus registers.
dmpipeReads sensor values from sub-process.
dmplotGenerates plots from observations in database.
dmrecvReceives logs and observations from message queue.
dmreportCreates reports of plots and log messages in HTML or PDF format.
dmsendSends observations and logs to message queue.
dmserialReads sensor values from serial port.
dmsyncSynchronises local databases with RPC API (from client to server).
dmsystemMonitors system parameters (free disk space, load average, …).
dmuploadTransfers captured camera images to RPC service.
dmuuidGenerates UUIDv4 identifiers.
dmvedReads status of MPPT charger or battery monitor (VE.Direct).
dmwebCGI-based web user interface for database access (client, server).

Installation

The DMPACK library and programs have to be built from source by either executing the provided Makefile, or by using the Fortran Package Manager. See the User Guide for complete installation instructions.

Clone the DMPACK repository or download an archive of it, then execute the Makefile with build target freebsd, linux, or linux_aarch64:

$ git clone --depth 1 https://github.com/dabamos/dmpack
$ cd dmpack/
$ make [freebsd|linux|linux_aarch64]
$ make install PREFIX=/opt

On 64-bit Raspberry Pi single-board computers running Linux, select target linux_aarch64.

Library

NameDescription
libdmpack.aDMPACK static library.
libdmpack.soDMPACK shared library.

Either link your programs against static library libdmpack.a or -ldmpack if libdmpack.so is in your library search path, for example:

$ gfortran -I/opt/include/dmpack -o example example.f90 /opt/lib/libdmpack.a

The directory containing the DMPACK module files is passed through argument -I. Depending on which parts of the DMPACK library are used by third-party applications, additional shared libraries have to be linked:

ModuleLibrariesLinker Libraries
dm_configLua 5.4pkg-config --libs lua-5.4
dm_cryptolibcrypto-lcrypto
dm_dbSQLite 3pkg-config --libs sqlite3
dm_dwd_apilibcurlpkg-config --libs libcurl
dm_fcgiFastCGI-lfcgi
dm_ftplibcurlpkg-config --libs libcurl
dm_hdf5HDF5pkg-config --libs hdf5_fortran
dm_imlibstrophepkg-config --libs libstrophe expat openssl zlib
dm_laLAPACK, BLASpkg-config --libs lapack blas
dm_luaLua 5.4pkg-config --libs lua-5.4
dm_lua_apiLua 5.4pkg-config --libs lua-5.4
dm_lua_geocomLua 5.4pkg-config --libs lua-5.4
dm_maillibcurlpkg-config --libs libcurl
dm_modbuslibmodbuspkg-config --libs libmodbus
dm_mqttlibcurlpkg-config --libs libcurl
dm_mqueuePOSIX-lrt
dm_mutexPOSIX-lpthread
dm_regexPCRE2pkg-config --libs libpcre2-8
dm_rpclibcurl, zlib, zstdpkg-config --libs libcurl zlib libzstd
dm_semPOSIX-lpthread
dm_threadPOSIX-lpthread
dm_transformLAPACK, BLASpkg-config --libs lapack blas
dm_zzlib, zstdpkg-config --libs zlib libzstd
dm_zlibzlibpkg-config --libs zlib
dm_zstdzstdpkg-config --libs libzstd

Some modules use standard input/output to communicate with external programs:

ModulePackagesExpected Binary Names
dm_cameraFFmpegffmpeg
dm_ghostscriptGhostscriptgs, ps2pdf
dm_gmGraphicsMagickgm
dm_plotGnuplotgnuplot
dm_roffGNU roffgroff

Source Code Structure

PathDescription
adoc/AsciiDoc source files of man pages.
app/Source of programs based on DMPACK.
config/Example configuration files.
dist/DMPACK libraries and executables.
doc/Source code documentation generated by FORD.
guide/User Guide source and output files.
include/Fortran module files (required for linking).
lib/Fortran interface libraries (required for linking).
man/Generated man pages (includes HTML and PDF exports).
share/Example files, style sheets, scripts, and so on.
src/Source of DMPACK library modules.
test/Test programs for DMPACK modules.
vendor/Third-party dependencies.

Manual Pages

To create all DMPACK man pages from source, run:

$ make man

The output files are written to man/.

User Guide

To convert the User Guide from AsciiDoc to HTML, run:

$ make guide

The output is written to guide/guide.html.

Source Code Documentation

The source code documentation of the DMPACK library has to be created with FORD. Install the Python package with:

$ python3 -m pip install -U ford

In the DMPACK repository, run:

$ make doc

The HTML files will be written to directory doc/. Open index.html in a web browser.

Licence

ISC