Dmpack
Sensor network middleware in Fortran 2018, for deformation monitoring and geodetic control measurements in the IoT (client and server).
Install / Use
/learn @dabamos/DmpackREADME
Deformation Monitoring Package (DMPACK)
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

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:
- AsciiDoctor, Pygments, and pygments.rb
- FORD
Program Overview
The following programs are based on the DMPACK library.
| Name | Description | |--------------------------------|---------------------------------------------------------------------| | dmapi | FastCGI-based HTTP-RPC API service. | | dmbackup | Creates online backups of DMPACK databases. | | dmbeat | Sends status messages (heartbeats) periodically to RPC service. | | dmbot | XMPP chat bot that answers to commands from authorised users. | | dmcamera | Captures images from USB webcam or IP camera. | | dmdb | Stores observations received from message queue in database. | | dmdbctl | Command-line interface to observation databases. | | dmdwd | Reads weather reports from DWD open data API. | | dmexport | Exports database records to file. | | dmfeed | Creates Atom feeds in XML format from log messages. | | dmfs | Reads sensor values from file system (file, named pipe, OWFS). | | dmgrc | Generates log messages from GeoCOM return codes. | | dmimport | Imports CSV file into database. | | dminfo | Prints system and database information as key–value pairs. | | dminit | Creates and initialises DMPACK databases. | | dmlog | Sends log messages to logger through message queue. | | dmlogger | Stores log messages received from message queue in database. | | dmlua | Runs Lua script to handle observations received from message queue. | | dmmb | Sensor control program for Modbus RTU/TCP. | | dmmbctl | Command-line utility for read and write access to Modbus registers. | | dmpipe | Reads sensor values from sub-process. | | dmplot | Generates plots from observations in database. | | dmrecv | Receives logs and observations from message queue. | | dmreport | Creates reports of plots and log messages in HTML or PDF format. | | dmsend | Sends observations and logs to message queue. | | dmserial | Reads sensor values from serial port. | | dmsync | Synchronises local databases with RPC API (from client to server). | | dmsystem | Monitors system parameters (free disk space, load average, …). | | dmupload | Transfers captured camera images to RPC service. | | dmuuid | Generates UUIDv4 identifiers. | | dmved | Reads status of MPPT charger or battery monitor (VE.Direct). | | dmweb | CGI-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
| Name | Description |
|----------------|------------------------|
| libdmpack.a | DMPACK static library. |
| libdmpack.so | DMPACK 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:
| Module | Libraries | Linker Libraries |
|-----------------|---------------------|---------------------------------------------------|
| dm_config | Lua 5.4 | pkg-config --libs lua-5.4 |
| dm_crypto | libcrypto | -lcrypto |
| dm_db | SQLite 3 | pkg-config --libs sqlite3 |
| dm_dwd_api | libcurl | pkg-config --libs libcurl |
| dm_fcgi | FastCGI | -lfcgi |
| dm_ftp | libcurl | pkg-config --libs libcurl |
| dm_hdf5 | HDF5 | pkg-config --libs hdf5_fortran |
| dm_im
Related Skills
tmux
350.8kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
diffs
350.8kUse the diffs tool to produce real, shareable diffs (viewer URL, file artifact, or both) instead of manual edit summaries.
terraform-provider-genesyscloud
Terraform Provider Genesyscloud
blogwatcher
350.8kMonitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
