Closed rgillan closed 6 years ago
We've masked most of the above by commenting out rows 707-710 in packet.js.
Seeing another buffer range error:
{"tmst":2727136675,"chan":2,"rfch":0,"freq":917.2,"stat":-1,"modu":"LORA","datr":"SF7BW125","codr":"OFF","lsnr":-7.5,"rssi":-103,"size":5,"data":"q5r5mNQ="} buffer.js:972 throw new RangeError('Index out of range'); ^
RangeError: Index out of range at checkOffset (buffer.js:972:11) at Buffer.readInt8 (buffer.js:1098:5) at _initialiseFromWireformat (/usr/local/lib/node_modules/lora-packet/lib/packet.js:166:33) at LoraPacket._fromWire (/usr/local/lib/node_modules/lora-packet/lib/packet.js:116:13) at Object.exports.fromWire (/usr/local/lib/node_modules/lora-packet/lib/packet.js:7:8) at Socket.stage0.on (/Users/rob/Documents/repositories/nisient/loragw/gwtest1680.js:48:19) at emitTwo (events.js:126:13) at Socket.emit (events.js:214:7) at UDP.onMessage [as onmessage] (dgram.js:658:8)
thanks for reporting these! I clearly merged a PR without checking that it contained plausible code. I'll review & fix.
I've committed a fix for some of these (+ tests as test/test_github_issue17.js) but the really short packets which give an "index out of range" I think aren't valid LoRa. If I'm wrong, please point me in the right direction & I'd love to get them parsed properly.
Awesome job. In the guise of helping out, below are a few packets we're seeing failures on (we're not the source of these, just sniffing so they could be malformed or non LoRaWAN anyway).