{"id":18521390,"url":"https://github.com/thingsboard/sparkplug-emulator","last_synced_at":"2025-10-14T15:08:47.412Z","repository":{"id":135836678,"uuid":"610116128","full_name":"thingsboard/sparkplug-emulator","owner":"thingsboard","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-15T17:45:46.000Z","size":58873,"stargazers_count":6,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-15T18:56:36.974Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thingsboard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license-header-template.txt","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":"2023-03-06T05:51:30.000Z","updated_at":"2025-06-15T17:45:50.000Z","dependencies_parsed_at":"2025-04-09T09:34:49.019Z","dependency_job_id":"dd35eefc-0ca1-4081-bf24-68c79dd2887a","html_url":"https://github.com/thingsboard/sparkplug-emulator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thingsboard/sparkplug-emulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsboard%2Fsparkplug-emulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsboard%2Fsparkplug-emulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsboard%2Fsparkplug-emulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsboard%2Fsparkplug-emulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thingsboard","download_url":"https://codeload.github.com/thingsboard/sparkplug-emulator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsboard%2Fsparkplug-emulator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019294,"owners_count":26086709,"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-10-14T02:00:06.444Z","response_time":60,"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":[],"created_at":"2024-11-06T17:25:39.052Z","updated_at":"2025-10-14T15:08:47.405Z","avatar_url":"https://github.com/thingsboard.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Simple Sparkplug EoN Node Emulator\n\nThis emulator is designed for demonstration purposes to connect sample clients to [Thingsboard](https://thingsboard.io) via the [MQTT Sparkplug API](https://thingsboard.io/docs/reference/mqtt-sparkplug-api/).\n\n---\n\n## 🐳 Running he Emulator as a Docker Container\n\n\n```bash\ndocker run -e SPARKPLUG_SERVER_URL='tcp://thingsboard.cloud:1883' \\\n  -e SPARKPLUG_CLIENT_MQTT_USERNAME='YOUR_THINGSBOARD_DEVICE_TOKEN' \\\n  thingsboard/tb-sparkplug-emulator:latest\n```\n\n\u003e **Note:** Do not use `localhost` inside a Docker container — it refers to the container itself. Use your actual IP address (e.g., `192.168.x.x`) or `host.docker.internal` (on macOS/Windows). On Linux, consider using `--network host`.\n\n- localhost -\u003e Address = 192.168.28.74; Port = 1883, YOUR_THINGSBOARD_DEVICE_TOKEN = n03suscyeul0o1dn6b09.\n\n```bash\ndocker run -e SPARKPLUG_SERVER_URL='tcp://t192.168.28.74:1883' \\\n  -e SPARKPLUG_CLIENT_MQTT_USERNAME='n03suscyeul0o1dn6b09' \\\n  thingsboard/tb-sparkplug-emulator:latest\n```\n\n---\n\n## Available Environment Variables\n\n| Variable                             | Description                                                   | Default Value                    |\n|:-------------------------------------|:--------------------------------------------------------------|:---------------------------------|\n| `SPARKPLUG_SERVER_URL`               | MQTT broker URL                                               | `tcp://demo.thingsboard.io:1883` |\n| `SPARKPLUG_CLIENT_GROUP_ID`          | Sparkplug Group ID                                            | `Sparkplug Group 1`              |\n| `SPARKPLUG_CLIENT_NODE_ID`           | Sparkplug Node ID                                             | `Sparkplug Node 1`               |\n| `SPARKPLUG_CLIENT_MQTT_CLIENT_ID`    | Sparkplug MQTT Client ID                                      | `Sparkplug Node 1`               |\n| `SPARKPLUG_CLIENT_MQTT_USERNAME`     | MQTT client username (for authentication)                     | —                                |\n| `SPARKPLUG_CLIENT_MQTT_PASSWORD`     | MQTT client password                                          | —                                |\n| `SPARKPLUG_PUBLISH_INTERVAL`         | Interval for publishing metrics in milliseconds               | `10000`                          |\n| `SPARKPLUG_CLIENT_CONFIG_FILE_PATH`  | Alternative path for configuration file                       | —                                |\n| `SPARKPLUG_CLIENT_METRICS_FILE_PATH` | Alternative path for metrics descriptor file                  | —                                |\n\n---\n\n## Metrics\n\nThe default Sparkplug metrics descriptor is located here:\n\n[Metrics.json](https://github.com/thingsboard/sparkplug-emulator/blob/main/src/main/resources/Metrics.json)\n\nThis file contains a simple JSON structure describing the device ID and a list of metrics.  \nThe special `node` flag in the first JSON object defines metrics for the EoN Node itself.  \nYou can supply your own metrics file using the environment variable `SPARKPLUG_CLIENT_METRICS_FILE_PATH`.\n\n---\n\n## Building from Sources\n\n```bash\nmvn clean install\n```\n\nor\n\n```bash\nmvn clean package -DskipTests\n```\n\n---\n\n## Running as a Plain Java Application\n\n### Configuring Sparkplug Emulator with Environment Variables\n\nSet environment variables:\n\n```bash\nexport SPARKPLUG_SERVER_URL=tcp://demo.thingsboard.io:1883\nexport SPARKPLUG_CLIENT_MQTT_USERNAME=YOUR_THINGSBOARD_DEVICE_TOKEN\n```\n\n### Running the application\n- \n- version can vary\n\n```bash\njava -jar sparkplug-{version}-jar-with-dependencies.jar\n```\n\nor\n\n```bash\njava -jar sparkplug-3.0.1-jar-with-dependencies.jar\n```\n\n---\n\n### Example running with a local MQTT broker:\n\n```bash\nSPARKPLUG_SERVER_URL=tcp://localhost:1883 \\\nSPARKPLUG_CLIENT_MQTT_USERNAME=n03suscyeul0o1dn6b09 \\\njava -jar sparkplug-3.0.1-jar-with-dependencies.jar\n```\n\nor\n\n```bash\nexport SPARKPLUG_SERVER_URL=tcp://localhost:1883\nexport SPARKPLUG_CLIENT_MQTT_USERNAME=n03suscyeul0o1dn6b09\njava -jar sparkplug-3.0.1-jar-with-dependencies.jar\n```\n\n---\n\n### Running again with Docker\n\n```bash\ndocker run -e SPARKPLUG_SERVER_URL='tcp://demo.thingsboard.io:1883' \\\n  -e SPARKPLUG_CLIENT_MQTT_USERNAME='YOUR_THINGSBOARD_DEVICE_TOKEN' \\\n  thingsboard/tb-sparkplug-emulator:latest\n```\n\n---\n\nFor more detailed information, see the [Thingsboard Sparkplug API documentation](https://thingsboard.io/docs/reference/mqtt-sparkplug-api/).\n\n---\n\nIf you need, I can help add clarifications or improvements.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingsboard%2Fsparkplug-emulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthingsboard%2Fsparkplug-emulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingsboard%2Fsparkplug-emulator/lists"}