LoRaWAN packet decoder

A frontend towards lora-packet.

 
Assuming base64-encoded packet
QCkuASaAAAAByFaF53Iu+vzmwQ==

Message Type = Data
  PHYPayload = 40292E012680000001C85685E7722EFAFCE6C1

( PHYPayload = MHDR[1] | MACPayload[..] | MIC[4] )
        MHDR = 40
  MACPayload = 292E012680000001C85685E7722E
         MIC = FAFCE6C1

( MACPayload = FHDR | FPort | FRMPayload )
        FHDR = 292E0126800000
       FPort = 01
  FRMPayload = C85685E7722E

      ( FHDR = DevAddr[4] | FCtrl[1] | FCnt[2] | FOpts[0..15] )
     DevAddr = 26012E29 (Big Endian)
       FCtrl = 80
        FCnt = 0000 (Big Endian)
       FOpts = 

Message Type = Unconfirmed Data Up
   Direction = up
        FCnt = 0
   FCtrl.ACK = false
   FCtrl.ADR = true

Note that erroneous packets are likely to show incorrect results: lora-packet can also validate the packet's integrity and decrypt the payload if you know the node's secrets. Or to install it as a command line utility:

  • install Node.js and npm
  • run: npm install -g lora-packet
  • run: lora-packet-decode --base64 ADFGUkFEshgAdAoAAACyGADXQ5rzpZs=
    or lora-packet-decode --hex 003146524144B21800740A000000B21800D7439AF3A59B (beware that removing leading zeroes affects proper decoding)