packet-forwarder
v1.0.9
Published
Virtual LoRa packet forwarder that forwards RF packets from API to a server through a IP/UDP link, and emits RF packets that are sent by the server.
Downloads
406
Maintainers
Readme
Packet Forwarder (Node.js)
Virtual LoRa packet forwarder that forwards RF packets from API to a server through a IP/UDP link, and emits RF packets that are sent by the server. To be used for Node.js applications.
Getting Started
In LoRaWAN, you need real gateways and real devices for your real test case. However, it is simpler to using a simulated gateway and simulated devices in order to choose the best LoRaWAN Network Server that fulfills your real requirements.
Installation
npm install --save packet-forwarder
Usage
Send an uplink to remote Network Server using Packet Forwarder protocol. Fake gateway EUI, fake network server and fake message content have been used in the next usage example.
const PacketForwarder = require('packet-forwarder')
async function sendFakeUplink() {
const gateway = 'DABBCCFFFF2A79CB'
const target = 'network-server.foo-company.local'
const port = 1234
const packetForwarder = new PacketForwarder({ gateway, target, port })
const message = {
rxpk: [{
time: '2018-05-01T12:00:00Z',
tmms: null,
tmst: 1525168800,
freq: 868300000,
chan: null,
rfch: 0,
stat: 0,
modu: 'LORA',
datr: 'SF8BW125',
codr: '4/5',
rssi: -97,
lsnr: 12,
size: 16,
data: 'aGZkKQAAAAIAAAAAAAAAAA==',
}]
}
await packetForwarder.sendUplink(message)
await packetForwarder.close()
}
Testing
Clone repository, install dependencies and run tests npm test
.
Deployment
Add additional notes about how to deploy this on a live system
Contributing
Respect standard
rules.
Versioning
We use SemVer for versioning.
Authors
- Antonio Bustos - Initial work - antoniobusrod
License
This project is licensed under the MIT License - see the LICENSE file for details