Skip to content

A pure C# library to decode packets for LoRa/LoRaWAN radio communication

License

Notifications You must be signed in to change notification settings

sntcz/LoRa.Message

Repository files navigation

LoRa.Message

A pure C# library to decode packets for LoRa/LoRaWANTM radio communication, based on the specification from the LoRa Alliance (based on V1.0.3)

Thanks for huge inspiration to lora-packet, a node.js library to decode and encode packets for LoRa/LoRaWANTM


Packet decoding is also wrapped in a simple command-line tool that accepts input in hex and base-64

Features

  • LoRa packet parsing & analysis
  • MIC (Message Integrity Check) checking
  • payload decryption
  • decode uplink & downlink packets
  • unit tests for everything
    • MIC calculation
    • message decryption
    • utility conversion
  • decode join request packets
  • decode join accept packets
  • generate NwkSKey and AppSKey from AppID

Usage (in your code)

PHYPayload packet = new PHYPayload(data, nwkSKey, appSKey, 0);

Usage (command-line packet decoding)

dotnet LoRaPacket.dll decode --hex 40F17DBE4900020001954378762B11FF0D
dotnet LoRaPacket.dll decode --base64 QK4TBCaAAAABb4ldmIEHFOMmgpU= \
    --nwkskey 99D58493D1205B43EFF938F0F66C339E \
    --appskey 0A501524F8EA5FCBF9BDB5AD7D126F75

Contribute

First off, Thank you! All contributions are welcome.

Please follow the project's tabs settings for easiest diff compares.

Contributor Code of Conduct

This project adheres to No Code of Conduct.

License

MIT