# LoRaWAN: простой симулятор устройства и базовой станции - https://github.com/prohazko2/lorawan-send-payload LoRaWAN Send Payload - простой симулятор устройства LoRaWAN класса A с поддержкой активации OTAA (Over-The-Air Activation). Проект позволяет эмулировать работу LoRaWAN устройства, отправляя uplink сообщения на шлюз через протокол packet_forwarder. Симулятор подключается к LoRaWAN шлюзу по UDP и выполняет простой цикл работы устройства: - отправку Join Request - получение Join Accept - периодическую отправку данных ## Требования - Node.js >= 22.0.0 ## Запуск ```bash npm install cp config.example.json config.json ``` Отредактируйте `config.json` и укажите параметры вашего шлюза и устройства: ```json { "gatewayHost": "dev.rightech.io", "gatewayPort": 1700, "gatewayEUI": "0000000000000000", "devEUI": "0000000000000001", "appKey": "00000000000000000000000000000000", "frequencyPlan": "RU864", "uplinkFPort": 1, "uplinkInterval": 60000 } ``` Параметры `devEUI`, `appKey`, `gatewayEUI`, `frequencyPlan` должны совпадать с параметрами устройства в платформе: ![](https://store.rightech.io/api/v1/media/47630370-1efa-4c36-ba1e-37e7bb6397f3.png) ![](https://store.rightech.io/api/v1/media/98cae482-4108-4701-91f8-7e553c0fd9a3.png) Далее запускаем симулятор: ```bash npm start ``` В случае успешного подключение увидим в консоли: ``` Sending Join Request... ✓ Device activated via OTAA DevAddr: xxxxx NwkSKey: xxxxxxxxxxxxxxxxxxxx AppSKey: xxxxxxxxxxxxxxxxxxxx TX_ACK sent successfully Send uplink (FCnt: 0, FPort: 3, Freq: 864.1 MHz): hex: df19 Send uplink (FCnt: 1, FPort: 3, Freq: 864.1 MHz): hex: dd18 Send uplink (FCnt: 2, FPort: 3, Freq: 868.9 MHz): hex: dc17 ```
Использование этого шаблона и его компонентов допускается только в платформе Rightech IoT. Лицензия автора шаблона распространяется только на его собственный код и не влияет на сторонние библиотеки и компоненты, используемые в шаблоне, и не может противоречить их лицензиям и лицензии Rightech IoT.

MIT License Copyright (c) 2025 prohazko Permission 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: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.