Online LoRaWAN packet decoder

The online version does did not check or decrypt anything (right now). So, you’ll need to use the library yourself. Note that the DevAddr is in the non-encrypted part of the message headers.

mkdir my-decoder-test
cd my-decoder-test
npm install lora-packet

node <<END
const lorapacket = require('lora-packet');
const nwkSKey = new Buffer('99D58493D1205B43EFF938F0F66C339E', 'hex');
const appSKey = new Buffer('0A501524F8EA5FCBF9BDB5AD7D126F75', 'hex');
const data = new Buffer('QK4TBCaAAAABb4ldmIEHFOMmgpU=', 'base64');

const packet = lorapacket.fromWire(data);
console.log(packet.toString());

// When the node's counter has exceeded 65,536, then use a recent FCnt value
// to supply its MSB in the call to verifyMIC:
//    const recentFCnt = 476604;
//    const msb = new Buffer(2);
//    msb.writeUInt16LE(recentFCnt >> 16, 0);
//    const valid = lorapacket.verifyMIC(packet, nwkSKey, null, msb);
const valid = lorapacket.verifyMIC(packet, nwkSKey);
console.log('MIC: ' + (valid ? 'OK' : 'FAIL'));

const payload = lorapacket.decrypt(packet, appSKey, nwkSKey);
// Assume plain ASCII text, which is bad, but works for your example...
console.log('Payload: ' + payload.toString());
END

…gives you:

Message Type = Data
            PHYPayload = 40AE130426800000016F895D98810714E3268295

          ( PHYPayload = MHDR[1] | MACPayload[..] | MIC[4] )
                  MHDR = 40
            MACPayload = AE130426800000016F895D98810714
                   MIC = E3268295

          ( MACPayload = FHDR | FPort | FRMPayload )
                  FHDR = AE130426800000
                 FPort = 01
            FRMPayload = 6F895D98810714

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

          Message Type = Unconfirmed Data Up
             Direction = up
                  FCnt = 0
             FCtrl.ACK = false
             FCtrl.ADR = true
MIC: OK
Payload: abcdefg

(You should keep the session keys secret, as anyone can now send data to your application. Also, you should not send text.)