{"id":24382929,"url":"https://github.com/reelyactive/barnacles-sparkplug","last_synced_at":"2026-02-10T19:36:28.521Z","repository":{"id":272510993,"uuid":"916637870","full_name":"reelyactive/barnacles-sparkplug","owner":"reelyactive","description":"Distribute ambient IoT sensor data from Pareto Anywhere open source middleware via Eclipse Sparkplug (MQTT). We believe in an open Internet of Things.","archived":false,"fork":false,"pushed_at":"2026-02-03T02:02:20.000Z","size":142,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-03T16:24:44.971Z","etag":null,"topics":["dynamb","iot","mqtt","pareto-anywhere","sparkplug"],"latest_commit_sha":null,"homepage":"https://www.reelyactive.com/pareto/anywhere/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reelyactive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-14T13:45:26.000Z","updated_at":"2026-02-03T02:02:24.000Z","dependencies_parsed_at":"2025-01-14T22:33:37.503Z","dependency_job_id":"03b1d379-d6de-4b89-a50e-c61da8f83161","html_url":"https://github.com/reelyactive/barnacles-sparkplug","commit_stats":null,"previous_names":["reelyactive/barnacles-sparkplug"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reelyactive/barnacles-sparkplug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fbarnacles-sparkplug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fbarnacles-sparkplug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fbarnacles-sparkplug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fbarnacles-sparkplug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reelyactive","download_url":"https://codeload.github.com/reelyactive/barnacles-sparkplug/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fbarnacles-sparkplug/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29313158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T17:48:59.043Z","status":"ssl_error","status_checked_at":"2026-02-10T17:45:37.240Z","response_time":65,"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":["dynamb","iot","mqtt","pareto-anywhere","sparkplug"],"created_at":"2025-01-19T10:10:57.787Z","updated_at":"2026-02-10T19:36:28.513Z","avatar_url":"https://github.com/reelyactive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"barnacles-sparkplug\n===================\n\n__barnacles-sparkplug__ distributes ambient IoT sensor data via MQTT observing the Eclipse Sparkplug specification.\n\n![Overview of barnacles-sparkplug](https://reelyactive.github.io/barnacles-sparkplug/images/overview.png)\n\n__barnacles-sparkplug__ ingests a real-time stream of _dynamb_ objects from [barnacles](https://github.com/reelyactive/barnacles/) which it publishes via MQTT as Sparkplug B payloads.  It couples seamlessly with reelyActive's [Pareto Anywhere](https://www.reelyactive.com/pareto/anywhere/) open source IoT middleware.\n\n__barnacles-sparkplug__ is a lightweight [Node.js package](https://www.npmjs.com/package/barnacles-sparkplug) that can run on resource-constrained edge devices as well as on powerful cloud servers and anything in between.\n\n\nPareto Anywhere integration\n---------------------------\n\nA common application of __barnacles-sparkplug__ is to publish IoT data from [pareto-anywhere](https://github.com/reelyactive/pareto-anywhere) as Sparkplug B payloads via MQTT.  Simply follow our [Create a Pareto Anywhere startup script](https://reelyactive.github.io/diy/pareto-anywhere-startup-script/) tutorial using the script below:\n\n```javascript\n#!/usr/bin/env node\n\nconst ParetoAnywhere = require('../lib/paretoanywhere.js');\n\n// Edit the options to customise the server\nconst BARNACLES_SPARKPLUG_OPTIONS = {};\n\n// ----- Exit gracefully if the optional dependency is not found -----\nlet BarnaclesSparkplug;\ntry {\n  BarnaclesSparkplug = require('barnacles-sparkplug');\n}\ncatch(err) {\n  console.log('This script requires barnacles-sparkplug.  Install with:');\n  console.log('\\r\\n    \"npm install barnacles-sparkplug\"\\r\\n');\n  return console.log('and then run this script again.');\n}\n// -------------------------------------------------------------------\n\nlet pa = new ParetoAnywhere();\npa.barnacles.addInterface(BarnaclesSparkplug, BARNACLES_SPARKPLUG_OPTIONS);\n```\n\n\nQuick Start\n-----------\n\nClone this repository, then from its root folder, install dependencies with `npm install`.  Start the Sparkplug client with the following command:\n\n    npm start\n\nIf a MQTT broker is running on localhost, the client should connect (without authentication) and publish a NBIRTH message.  For convenience, a script to subscribe to Sparkplug messages (topic: spBv1.0/#) on localhost and print these to the console is provided, and can be started with the following command:\n\n    npm run subscribe\n\nWhen both programs are run simultaneously, the latter will echo all Sparkplug messages to the console, starting with the NBIRTH message which will have the following format:\n\n    Topic: spBv1.0/iot/NBIRTH/paretoanywhere\n    {\n      timestamp: Long { low: 1735707600, high: 404, unsigned: true },\n      metrics: [],\n      seq: Long { low: 0, high: 0, unsigned: true }\n    }\n\n\nSimulated Data\n--------------\n\nThe following simulated devices/sensors are supported for interface testing.\n\n### Minew S1\n\nTo simulate a [Minew S1](https://www.minew.com/product/s1-ble-temperature-and-humidity-sensor/) temperature/humidity sensor, start __barnacles-sparkplug__ with the following command:\n\n    npm run minew-s1\n\nSimulated sensor `c30000000051` will expose the following metrics:\n\n| name              | type   |\n|:------------------|:-------|\n| temperature       | Double |\n| relativeHumidity  | Double |\n| batteryPercentage | Double |\n\n\nSupported dynamb properties\n---------------------------\n\n__barnacles-sparkplug__ converts standard [dynamb](https://reelyactive.github.io/diy/cheatsheet/#dynamb) properties into the following Protobuf data types:\n\n| Property                     | Data Type          | Conversion              | \n|:-----------------------------|:-------------------|:------------------------|\n| acceleration                 | DataSet of Double  | 1, 2 or 3-column (xyz)  |\n| amperage                     | Double             | none                    |\n| ammoniaConcentration         | Double             | none                    |\n| angleOfRotation              | Double             | none                    |\n| angularVelocity              | Double             | none                    |\n| amperages                    | DataSet of Double  | Multi-column (0..n)     |\n| batteryPercentage            | Double             | none                    |\n| batteryVoltage               | Double             | none                    |\n| carbonDioxideConcentration   | Double             | none                    |\n| carbonMonoxideConcentration  | Double             | none                    |\n| count                        | UInt32             | none                    |\n| counts                       | DataSet of UInt32  | Multi-column (0..n)     |\n| distance                     | Double             | none                    |\n| duration                     | Double             | none                    |\n| durations                    | DataSet of Double  | Multi-column (0..n)     |\n| elevation                    | Double             | none                    |\n| energy                       | Double             | none                    |\n| heading                      | Double             | none                    |\n| heartRate                    | Double             | none                    |\n| illuminance                  | Double             | none                    |\n| isButtonPressed              | Boolean            | Logical OR (if many)    |\n| isButtonPressedCycle         | UInt32             | none                    |\n| isCarbonMonoxideDetected     | Boolean            | Logical OR (if many)    |\n| isCarbonMonoxideDetectedCycle | UInt32            | none                    |\n| isContactDetected            | Boolean            | Logical OR (if many)    |\n| isContactDetectedCycle       | UInt32             | none                    |\n| isGasDetected                | Boolean            | Logical OR (if many)    |\n| isGasDetectedCycle           | UInt32             | none                    |\n| isHealthy                    | Boolean            | none                    |\n| isInputDetected              | Boolean            | Logical OR (if many)    |\n| isInputDetectedCycle         | UInt32             | none                    |\n| isLightDetected              | Boolean            | Logical OR (if many)    |\n| isLightDetectedCycle         | UInt32             | none                    |\n| isLiquidDetected             | Boolean            | Logical OR (if many)    |\n| isLiquidDetectedCycle        | UInt32             | none                    |\n| isMotionDetected             | Boolean            | Logical OR (if many)    |\n| isMotionDetectedCycle        | UInt32             | none                    |\n| isOccupancyDetected          | Boolean            | Logical OR (if many)    |\n| isOccupancyDetectedCycle     | UInt32             | none                    |\n| isSmokeDetected              | Boolean            | Logical OR (if many)    |\n| isSmokeDetectedCycle         | UInt32             | none                    |\n| isTamperDetected             | Boolean            | Logical OR (if many)    |\n| isTamperDetectedCycle        | UInt32             | none                    |\n| levelPercentage              | Double             | none                    |\n| luminousFlux                 | Double             | none                    |\n| magneticField                | DataSet of Double  | 1, 2 or 3-column (xyz)  |\n| methaneConcentration         | Double             | none                    |\n| nitrogenDioxideConcentration | Double             | none                    |\n| nitrogenOxidesIndex          | UInt32             | none                    |\n| numberOfOccupants            | UInt32             | none                    |\n| numberOfOccupantsCycle       | UInt32             | none                    |\n| numberOfReceivedDevices      | UInt32             | none                    |\n| numberOfStrongestReceivedDevices | UInt32         | none                    |\n| passageCounts                | DataSet of UInt32  | 1 or 2-column           |\n| passageCountsCycle           | UInt32             | none                    |\n| pH                           | Double             | none                    |\n| pm1.0                        | Double             | none                    |\n| pm2.5                        | Double             | none                    |\n| pm10                         | Double             | none                    |\n| power                        | Double             | none                    |\n| pressure                     | Double             | none                    |\n| pressures                    | DataSet of Double  | Multi-column (0..n)     |\n| relativeHumidity             | Double             | none                    |\n| speed                        | Double             | none                    |\n| temperature                  | Double             | none                    |\n| temperatures                 | DataSet of Double  | Multi-column (0..n)     |\n| txCount                      | UInt32             | none                    |\n| txCycle                      | UInt32             | none                    |\n| uptime                       | UInt32             | none                    |\n| velocityOverall              | DataSet of Double  | 1, 2 or 3-column (xyz)  |\n| volatileOrganicCompoundsConcentration | Double    | none                    |\n| voltage                      | Double             | none                    |\n| voltages                     | DataSet of Double  | Multi-column (0..n)     |\n\n\nIntegrations\n------------\n\nThe [Eclipse Sparkplug](https://sparkplug.eclipse.org/) specification \"ensures open and interoperable IIoT\" enabling __barnacles-sparkplug__, and hence [Pareto Anywhere](https://www.reelyactive.com/pareto/anywhere/), to integrate seamlessly with the following platforms.\n\n### ThingsBoard\n\n__barnacles-sparkplug__ will automatically publish data to the MQTT broker of a [ThingsBoard](https://thingsboard.io/) instance running on localhost (on port 1883).  Configure the [MQTT Sparkplug API](https://thingsboard.io/docs/reference/mqtt-sparkplug-api/) with a device profile that uses MQTT ClientId `ParetoAnywhereEdgeNode` to receive the data in ThingsBoard.\n\nFor advanced integrations with ThingsBoard, configure the __barnacles-sparkplug__ options, listed below.\n\n\nOptions\n-------\n\n__barnacles-sparkplug__ supports the following options:\n\n| Property    | Default                  | Description                       | \n|:------------|:-------------------------|:----------------------------------|\n| url         | \"mqtt://localhost\"       | Local MQTT broker                 |\n| groupId     | \"iot\"                    | See Sparkplug specification       |\n| edgeNodeId  | \"paretoanywhere\"         | See Sparkplug specification       |\n| clientId    | \"ParetoAnywhereEdgeNode\" | Unique id of MQTT client          |\n| username    | null                     | Optional for MQTT authentication  |\n| password    | null                     | Optional for MQTT authentication  |\n| deviceTimeoutMilliseconds | 60000      | Activity timeout for DDEATH       |\n| reconnectMilliseconds | 15000          | For initial MQTT connection error |\n| printErrors | false                    | Print MQTT errors?                |\n\n\nAcknowledgements\n----------------\n\n__barnacles-sparkplug__ is based on the [sparkplug-client](https://www.npmjs.com/package/sparkplug-client) open source Node.js package of the [Eclipse Tahu](https://github.com/eclipse-tahu/tahu/) project which is licensed under the [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-2.0/) (EPL-2.0), and which we invite you to consider supporting at [sparkplug.eclipse.org](https://sparkplug.eclipse.org/).\n\n\nContributing\n------------\n\nDiscover [how to contribute](CONTRIBUTING.md) to this open source project which upholds a standard [code of conduct](CODE_OF_CONDUCT.md).\n\n\nSecurity\n--------\n\nConsult our [security policy](SECURITY.md) for best practices using this open source software and to report vulnerabilities.\n\n\nLicense\n-------\n\nMIT License\n\nCopyright (c) 2025-2026 [reelyActive](https://www.reelyactive.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fbarnacles-sparkplug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freelyactive%2Fbarnacles-sparkplug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fbarnacles-sparkplug/lists"}