@openrfid/mqtt 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -0
- package/package.json +6 -5
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="https://raw.githubusercontent.com/rfidsoftwares/openrfid-simulator/main/assets/logo.svg" alt="OpenRFID Simulator Logo" width="180" />
|
|
4
|
+
|
|
5
|
+
# `@openrfid/mqtt`
|
|
6
|
+
|
|
7
|
+
### MQTT IoT Broker Publisher & Telemetry Protocol Plugin for OpenRFID Simulator
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@openrfid/mqtt)
|
|
10
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
[](https://rfidsoftwares.com)
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 🚀 Overview
|
|
18
|
+
|
|
19
|
+
`@openrfid/mqtt` is an IoT protocol plugin for **OpenRFID Simulator**. It connects virtual simulated RFID readers to local or cloud MQTT brokers (e.g. EMQX, Mosquitto, AWS IoT Core, HiveMQ), publishing real-time tag scan telemetry and health diagnostics to structured MQTT topics (`openrfid/readers/{readerId}/tags`).
|
|
20
|
+
|
|
21
|
+
Developed & Maintained by **[RFID Software India Private Limited](https://rfidsoftwares.com)**.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 📦 Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# npm
|
|
29
|
+
npm install @openrfid/mqtt
|
|
30
|
+
|
|
31
|
+
# pnpm
|
|
32
|
+
pnpm add @openrfid/mqtt
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 💻 Code Example
|
|
38
|
+
|
|
39
|
+
### 1. Register MQTT Publisher Plugin
|
|
40
|
+
```typescript
|
|
41
|
+
import { SimulationEngine } from '@openrfid/simulator';
|
|
42
|
+
import { MqttPlugin } from '@openrfid/mqtt';
|
|
43
|
+
|
|
44
|
+
const engine = new SimulationEngine();
|
|
45
|
+
|
|
46
|
+
// Configure MQTT Plugin
|
|
47
|
+
const mqttPlugin = new MqttPlugin({
|
|
48
|
+
brokerUrl: 'mqtt://localhost:1883',
|
|
49
|
+
topicPrefix: 'openrfid/telemetry',
|
|
50
|
+
clientId: 'openrfid-sim-01',
|
|
51
|
+
qos: 1
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Register plugin into simulation lifecycle
|
|
55
|
+
await engine.pluginManager.registerPlugin(mqttPlugin);
|
|
56
|
+
await engine.start();
|
|
57
|
+
|
|
58
|
+
console.log('MQTT Plugin publishing tag telemetry to mqtt://localhost:1883');
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 📡 MQTT Topic Structure & JSON Payload
|
|
64
|
+
|
|
65
|
+
### Published Topic: `openrfid/telemetry/readers/{readerId}/tags`
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"epc": "E28011700000020C3C9101AB",
|
|
70
|
+
"readerId": "GATE-WAREHOUSE-01",
|
|
71
|
+
"antennaPort": 1,
|
|
72
|
+
"rssi": -58.5,
|
|
73
|
+
"readCount": 14,
|
|
74
|
+
"timestamp": 1721473200000
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 🌐 Monorepo Ecosystem
|
|
81
|
+
|
|
82
|
+
| Package | Description |
|
|
83
|
+
| :--- | :--- |
|
|
84
|
+
| [`@openrfid/plugin-api`](https://www.npmjs.com/package/@openrfid/plugin-api) | Plugin lifecycle interfaces & sandbox manager |
|
|
85
|
+
| [`@openrfid/simulator`](https://www.npmjs.com/package/@openrfid/simulator) | High-throughput inventory simulation engine |
|
|
86
|
+
| [`@openrfid/websocket`](https://www.npmjs.com/package/@openrfid/websocket) | WebSocket real-time tag stream broadcaster |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 📄 License & Corporate Support
|
|
91
|
+
|
|
92
|
+
Licensed under the **MIT License**.
|
|
93
|
+
Brought to you by **RFID Software India Private Limited**.
|
|
94
|
+
For enterprise RFID middleware, hardware drivers, or custom protocol plugins, visit **[rfidsoftwares.com](https://rfidsoftwares.com)**.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrfid/mqtt",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "MQTT client and telemetry publisher plugin for OpenRFID Simulator.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -13,18 +13,19 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
-
"dist"
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
17
18
|
],
|
|
18
19
|
"dependencies": {
|
|
19
20
|
"mqtt": "^5.3.5",
|
|
20
|
-
"@openrfid/
|
|
21
|
-
"@openrfid/
|
|
21
|
+
"@openrfid/core": "1.0.0",
|
|
22
|
+
"@openrfid/plugin-api": "1.0.0"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"tsup": "^8.0.2",
|
|
25
26
|
"typescript": "^5.4.5",
|
|
26
27
|
"vitest": "^1.5.0",
|
|
27
|
-
"@openrfid/simulator": "
|
|
28
|
+
"@openrfid/simulator": "1.0.0"
|
|
28
29
|
},
|
|
29
30
|
"publishConfig": {
|
|
30
31
|
"access": "public"
|