{"id":15722857,"url":"https://github.com/soerenschneider/serial-sensor-reader","last_synced_at":"2026-02-16T01:11:57.117Z","repository":{"id":38359718,"uuid":"236053435","full_name":"soerenschneider/serial-sensor-reader","owner":"soerenschneider","description":"Reads an analog sensor via ttyusb","archived":false,"fork":false,"pushed_at":"2025-02-18T21:58:01.000Z","size":269,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-21T22:29:27.984Z","etag":null,"topics":["analog-sensor","mqtt","sensor","ttyusb"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soerenschneider.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-01-24T17:50:36.000Z","updated_at":"2023-07-18T09:11:02.000Z","dependencies_parsed_at":"2025-06-11T08:09:07.785Z","dependency_job_id":"9f3988f6-c780-45c1-b8aa-c246fa18c4bc","html_url":"https://github.com/soerenschneider/serial-sensor-reader","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/soerenschneider/serial-sensor-reader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soerenschneider%2Fserial-sensor-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soerenschneider%2Fserial-sensor-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soerenschneider%2Fserial-sensor-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soerenschneider%2Fserial-sensor-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soerenschneider","download_url":"https://codeload.github.com/soerenschneider/serial-sensor-reader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soerenschneider%2Fserial-sensor-reader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29496943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T00:16:34.147Z","status":"ssl_error","status_checked_at":"2026-02-16T00:15:26.759Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["analog-sensor","mqtt","sensor","ttyusb"],"created_at":"2024-10-03T22:09:30.815Z","updated_at":"2026-02-16T01:11:57.100Z","avatar_url":"https://github.com/soerenschneider.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serial-sensor-reader\n\nReads sensor data over a serial connection, e.g. an Arduino and publishes the \nread sensor data via MQTT. Also, vital metrics are exposed via Prometheus server.\n\n## installation\n\nTo build it on your local machine just check out the repository and invoke\n```\nmake build\n``` \n\nTo cross-compile for Raspberry PIs devices, just use the raspberry target:\n```\nmake raspberry\n```\n\n## usage\n\n```\nusage: serial sensor data reader [-h|--help] -m|--mqtt-host \"\u003cvalue\u003e\"\n                                 [-t|--mqtt-topic \"\u003cvalue\u003e\"]\n                                 [-s|--serial-device \"\u003cvalue\u003e\"] [-b|--baud-rate\n                                 \u003cinteger\u003e] [--loglevel (INFO|DEBUG|WARN)]\n                                 [--prometheus-address \"\u003cvalue\u003e\"]\n                                 -n|--sensor-name \"\u003cvalue\u003e\"\n                                 -l|--sensor-location \"\u003cvalue\u003e\"\n\n                                 reads data from a serial sensor and publishes\n                                 it via mqtt\n\nArguments:\n\n  -h  --help                Print help information\n  -m  --mqtt-host           uri of the mqtt broker. Example:\n                            mqtt://remote-host:1883\n  -t  --mqtt-topic          MQTT topic to send the data to. Default:\n                            sensors/light/%s\n  -s  --serial-device       The serial device to read sensor data from.\n                            Default: /dev/ttyUSB0\n  -b  --baud-rate           The baud rate to use for the serial communication.\n                            Default: 9600\n      --loglevel            Debugging loglevel to use. Default: INFO\n      --prometheus-address  Address to use. Default: :9191\n  -n  --sensor-name         A descriptive name of the sensor that is read\n  -l  --sensor-location     The location of the sensor\n```\n\n## example\n\n```\n ./build/serial-sensor-reader -m mqtt://localhost:1883 -t sensors/photo/wohnzimmer -n photoresistor -l wohnzimmer --loglevel DEBUG\nINFO[2020-01-22T19:02:41+01:00] Started using configuration:                 \nINFO[2020-01-22T19:02:41+01:00] mqttUri=mqtt://localhost:1883                \nINFO[2020-01-22T19:02:41+01:00] mqttTopic=sensors/photoresistor/wohnzimmer           \nINFO[2020-01-22T19:02:41+01:00] sensorName=light                             \nINFO[2020-01-22T19:02:41+01:00] sensorLocation=wohnzimmer                    \nINFO[2020-01-22T19:02:41+01:00] serialDevice=/dev/ttyUSB0                    \nINFO[2020-01-22T19:02:41+01:00] baudRate=9600                                \nINFO[2020-01-22T19:02:41+01:00] loglevel=DEBUG                               \nINFO[2020-01-22T19:02:41+01:00] prometheusAddress=:9191                      \nINFO[2020-01-22T19:02:41+01:00]                                              \nINFO[2020-01-22T19:02:41+01:00] Creating mqtt backend...                     \nINFO[2020-01-22T19:02:41+01:00] Mqtt backend initialized                     \nINFO[2020-01-22T19:02:41+01:00] Starting to read from serial device /dev/ttyUSB0 with baudrate 9600 \nINFO[2020-01-22T19:02:41+01:00] (Re-)connected to MQTT broker localhost:1883... \nDEBU[2020-01-22T19:02:42+01:00] Read value 901                               \nDEBU[2020-01-22T19:02:42+01:00] Publishing message to topic sensors/photo/wohnzimmer \nDEBU[2020-01-22T19:02:43+01:00] Read value 901                               \nDEBU[2020-01-22T19:02:43+01:00] Publishing message to topic sensors/photo/wohnzimmer \n^CINFO[2020-01-22T19:02:44+01:00] Received SIGTERM, quitting gracefully        \nINFO[2020-01-22T19:02:44+01:00] Stopped reading from serial device           \nINFO[2020-01-22T19:02:44+01:00] Disconnected from mqtt                       \nINFO[2020-01-22T19:02:44+01:00] Closed channel, bye \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoerenschneider%2Fserial-sensor-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoerenschneider%2Fserial-sensor-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoerenschneider%2Fserial-sensor-reader/lists"}