{"id":34280283,"url":"https://github.com/nwaldispuehl/sensor-samplor","last_synced_at":"2026-04-18T21:35:07.403Z","repository":{"id":24388977,"uuid":"27788922","full_name":"nwaldispuehl/sensor-samplor","owner":"nwaldispuehl","description":"Generic data sampling software written in Java. The default implementation is for a DHT22 temperature/humidity sensor on a Raspberry Pi.","archived":false,"fork":false,"pushed_at":"2022-06-23T09:01:38.000Z","size":510,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-04-07T05:46:05.886Z","etag":null,"topics":["am2302","data-logging","dht22","hazelcast","humidity","java","raspberry-pi","sensor-network","sensor-node","temperature"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nwaldispuehl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-09T21:48:26.000Z","updated_at":"2022-06-23T09:01:42.000Z","dependencies_parsed_at":"2022-08-22T23:40:15.842Z","dependency_job_id":null,"html_url":"https://github.com/nwaldispuehl/sensor-samplor","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/nwaldispuehl/sensor-samplor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwaldispuehl%2Fsensor-samplor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwaldispuehl%2Fsensor-samplor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwaldispuehl%2Fsensor-samplor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwaldispuehl%2Fsensor-samplor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nwaldispuehl","download_url":"https://codeload.github.com/nwaldispuehl/sensor-samplor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwaldispuehl%2Fsensor-samplor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27772609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-16T02:00:10.477Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["am2302","data-logging","dht22","hazelcast","humidity","java","raspberry-pi","sensor-network","sensor-node","temperature"],"created_at":"2025-12-16T22:57:26.935Z","updated_at":"2025-12-16T22:57:27.483Z","avatar_url":"https://github.com/nwaldispuehl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sensor Samplor\n\n_A generic data sampling software for data logging and sensor networks._\n\n[![Build Status](https://travis-ci.org/nwaldispuehl/sensor-samplor.svg?branch=master)](https://travis-ci.org/nwaldispuehl/sensor-samplor)\n\n![Raspberry Pi with AM2302 sensor](https://github.com/nwaldispuehl/sensor-samplor/wiki/img/raspberry_pi_with_am2302_sensor.jpg)\n\n##### Table of Contents\n* [Introduction](#introduction)\n* [Manuals](#manuals)\n* [Basic use cases](#basic_use_cases)\n * [A temperature data logger](#data_logger_usecase)\n * [A sensor network](#sensor_network_usecase)\n\n\n\u003ca name='introduction' /\u003e\n\n## Introduction\n\nThis software provides a distributed communication bus based on [Hazelcast](http://hazelcast.org/) (a distributed data grid) with attached *Sensors* sending samples into the bus and *Receivers* reacting on such sensor events.\nEvery started instance of the **SensorSamplor** is considered a single *Node* in a cluster. Such node is configured to use a number of sensors and/or receivers.\nUsually in a sensor network, there are sensing nodes which only perform sensor measurements and few nodes which do not sense anything but only receive, that is, aggregate and store the measurements sent over the bus.\n\nThe default use case is to measure temperature with a DHT22/AM2302 temperature/humidity sensor on a [Raspberry Pi](http://www.raspberrypi.org/). The software can be run on a wide variety of platforms using any thinkable sensor however. The platform needs to support [Java 7](https://www.java.com/).\n\n\u003ca name='manuals' /\u003e\n\n## Manuals\n\nMore information on how to install and use the software can be found in the [wiki](https://github.com/nwaldispuehl/sensor-samplor/wiki):\n* [Prepare RaspberryPi as temperature sensor node](https://github.com/nwaldispuehl/sensor-samplor/wiki/Prepare-RaspberryPi-as-temperature-sensor-node)\n* [Install the SensorSamplor on Raspberry Pi](https://github.com/nwaldispuehl/sensor-samplor/wiki/Install-the-SensorSamplor-on-Raspberry-Pi)\n* [Configure SensorSamplor](https://github.com/nwaldispuehl/sensor-samplor/wiki/Configure-SensorSamplor)\n\n\n\u003ca name='basic_use_cases' /\u003e\n\n## Basic use cases\n\nThe following use cases demonstrate frequent usage patterns of the software.\n\n\u003ca name='data_logger_usecase' /\u003e\n\n### Use case 1: A temperature data logger\n\nThe software can certainly be used stand-alone when we only want to log sensor data for later use. After having installed the software and the driver on a Raspberry Pi with attached sensor (see below for instructions) we want it to measure temperature (and humidity) on a regular basis and store the samples in a log file. After some weeks we will collect the Pi and analyze the logs on some other system.\n\n#### Configuration\n\nThe following configuration items are relevant for this use case.\n\nFirst, we set a speaking name for our little node. Certainly this could be left on the default value, but naming the nodes is good practice:\n\n    sensorsamplor.sensor_platform_identifier = workshop_temperature_logger\n\nWe only put the ```temperature``` sensor into the list of active sensors. This is a string which is declared in the respective sensor plugin:\n\n    sensorsamplor.active_sensors = temperature\n\nThen we set the measurement timing with a [cron expression](http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger); one sample every minute:\n\n    sensorsamplor.measurement_cron_expression = 0 * * * * ?\n\nAs receiver we set the ```logfile``` plugin:\n\n    sensorsamplor.active_receivers = logfile\n\nThe specific sensor used here asks for an additional property which we set as follows:\n\n    sensorsamplor.sensor.temperature.gpio_data_pin = 4\n\nThe same holds for the logfile receiver; it has to be configured with a path, so it knows where to write the files to:\n\n    sensorsamplor.receiver.logfile.logging_directory = /var/log/sensor-samplor/\n\n#### Output\n\nThe software then starts to measure the temperature and - on every measurement - produces an entry in a log file:\n\n    $ ls -l /var/log/sensor-samplor\n\n    ...\n    sensor.log.temperature.2014-12-26\n    sensor.log.temperature.2014-12-27\n    sensor.log.temperature.2014-12-28\n    sensor.log.temperature.2014-12-29\n    ...\n\nThese logs then look as follows. The log file pattern is\n\n    ```TIMESTAMP -- NODE IDENTIFIER -- SENSOR TYPE -- SAMPLE UUID -- DATA PAYLOAD```\n\nand the contents of an actual log file thus is like this:\n\n    $ cat /var/log/sensor-samplor/sensor.log.temperature.2014-12-27\n\n    ...\n    2014-12-27:18:06:00 +0100 -- workshop_temperature_logger -- temperature -- d38727db-cb75-4f10-b6cc-c6b12e9e7aea -- {\"humidity\":55.0,\"temperature\":20.2}\n    2014-12-27:18:07:00 +0100 -- workshop_temperature_logger -- temperature -- 988b4031-30de-4697-aa6e-c4bf26fcf9f7 -- {\"humidity\":55.0,\"temperature\":20.2}\n    2014-12-27:18:08:00 +0100 -- workshop_temperature_logger -- temperature -- a0c0f0c4-07ab-4fe7-b719-5186f84763f9 -- {\"humidity\":55.3,\"temperature\":20.3}\n    ...\n\nThese can now be processed.\n\n\u003ca name='sensor_network_usecase' /\u003e\n\n### Use case 2: A small sensor network\n\nTo have multiple nodes collecting sensor readings (also temperature in this case) we configure two Raspberry Pi computers as sensor nodes and a personal computer as some sort of sensor live ticker. We again assume the software has been installed on all three systems and temperature sensors as well as drivers were set up on the two Raspberry Pi computers. Furthermore all nodes are connected to the same computer network.\n\n#### Configuration\n\nThe three nodes have to be configured as follows. All properties not shown here can be left on their respective default values.\n\nNote that:\n* we configure no receivers on the sensor nodes, and no sensors on the live ticker system.\n* we set the measurement time interval to one minute.\n* the bus configuration must be the same on all nodes which should be part of the same cluster.\n* we assume that all of these nodes are in the same network subnet, and their network interface addresses are either 10.100.10.*, or 192.168.1.*.\n\n##### Node 1\n\n    sensorsamplor.sensor_platform_identifier = node_1\n    sensorsamplor.active_sensors = temperature\n    sensorsamplor.active_receivers =\n    sensorsamplor.measurement_cron_expression = 0 * * * * ?\n\n    sensorsamplor.bus.name = SensorSamplorBus\n    sensorsamplor.bus.username = myUsername\n    sensorsamplor.bus.password = myPassword\n    sensorsamplor.bus.interfaces = 10.100.10.*, 192.168.1.*\n\n    sensorsamplor.sensor.temperature.gpio_data_pin = 4\n\n##### Node 2\n\n    sensorsamplor.sensor_platform_identifier = node_2\n    sensorsamplor.active_sensors = temperature\n    sensorsamplor.active_receivers =\n    sensorsamplor.measurement_cron_expression = 0 * * * * ?\n\n    sensorsamplor.bus.name = SensorSamplorBus\n    sensorsamplor.bus.username = myUsername\n    sensorsamplor.bus.password = myPassword\n    sensorsamplor.bus.interfaces = 10.100.10.*, 192.168.1.*\n\n    sensorsamplor.sensor.temperature.gpio_data_pin = 4\n\n##### Personal Computer\n\n    sensorsamplor.sensor_platform_identifier = sensor_live_ticker\n    sensorsamplor.active_sensors =\n    sensorsamplor.active_receivers = console\n\n    sensorsamplor.bus.name = SensorSamplorBus\n    sensorsamplor.bus.username = myUsername\n    sensorsamplor.bus.password = myPassword\n    sensorsamplor.bus.interfaces = 10.100.10.*, 192.168.1.*\n\n#### Output\n\nOn the personal computer, when the software is running on all nodes, the following output is written to the console:\n\n    ...\n    2014-12-27:18:45:00 +0100 -- node_1 -- temperature -- 9cc4d10d-d856-40ac-97d5-87d91b698163 -- {\"humidity\":25.2,\"temperature\":24.0}\n    2014-12-27:18:45:00 +0100 -- node_2 -- temperature -- 5023d8ef-369b-49d9-8cde-f2980ca1aae8 -- {\"humidity\":42.6,\"temperature\":21.1}\n    2014-12-27:18:46:00 +0100 -- node_1 -- temperature -- d90dc5ce-2e27-44f2-a575-9f7323fb5dd4 -- {\"humidity\":25.6,\"temperature\":24.2}\n    2014-12-27:18:46:00 +0100 -- node_2 -- temperature -- 81cb7f69-200d-4fcb-9943-d0db578a0aa6 -- {\"humidity\":42.6,\"temperature\":21.1}\n    2014-12-27:18:47:00 +0100 -- node_1 -- temperature -- 0a41690a-9180-476a-b3c4-934a6562c89f -- {\"humidity\":25.7,\"temperature\":24.1}\n    2014-12-27:18:47:00 +0100 -- node_2 -- temperature -- 1c13d32c-f092-4a2c-9007-dd733066fe0e -- {\"humidity\":42.6,\"temperature\":21.2}\n    ...\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwaldispuehl%2Fsensor-samplor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnwaldispuehl%2Fsensor-samplor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwaldispuehl%2Fsensor-samplor/lists"}