tim-hellhake / mi-flora-adapter

Mozilla Public License 2.0
1 stars 3 forks source link

RangeError('Index out of range'); #6

Closed flatsiedatsie closed 5 years ago

flatsiedatsie commented 5 years ago

I noticed a crash in the log so I thought I'd report it.

2019-06-05 12:02:04.892 ERROR  : mi-flora: buffer.js:977
2019-06-05 12:02:04.895 ERROR  : mi-flora:     throw new RangeError('Index out of range');
2019-06-05 12:02:04.898 ERROR  : mi-flora:     ^
2019-06-05 12:02:04.900 ERROR  : mi-flora: 
2019-06-05 12:02:04.902 ERROR  : mi-flora: RangeError: Index out of range
2019-06-05 12:02:04.903 ERROR  : mi-flora:     at checkOffset (buffer.js:977:11)
2019-06-05 12:02:04.905 ERROR  : mi-flora:     at Buffer.readInt8 (buffer.js:1103:5)
2019-06-05 12:02:04.907 ERROR  : mi-flora:     at Hci.processLeAdvertisingReport (/home/pi/.mozilla-iot/addons/mi-flora-adapter/node_modules/@abandonware/noble/lib/hci-socket/hci.js:643:21)
2019-06-05 12:02:04.909 ERROR  : mi-flora:     at Hci.processLeMetaEvent (/home/pi/.mozilla-iot/addons/mi-flora-adapter/node_modules/@abandonware/noble/lib/hci-socket/hci.js:608:10)
2019-06-05 12:02:04.911 ERROR  : mi-flora:     at Hci.onSocketData (/home/pi/.mozilla-iot/addons/mi-flora-adapter/node_modules/@abandonware/noble/lib/hci-socket/hci.js:479:12)
2019-06-05 12:02:04.913 ERROR  : mi-flora:     at emitOne (events.js:116:13)
2019-06-05 12:02:04.915 ERROR  : mi-flora:     at BluetoothHciSocket.emit (events.js:211:7)
2019-06-05 12:02:04.921 INFO   : Plugin: mi-flora-adapter died, code = 1 restarting...
2019-06-05 12:02:05.762 INFO   : mi-flora: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
2019-06-05 12:02:05.812 INFO   : mi-flora: Loading add-on for mi-flora-adapter from /home/pi/.mozilla-iot/addons/mi-flora-adapter
2019-06-05 12:02:06.584 INFO   : mi-flora: The pollInterval is 1440 minutes
2019-06-05 12:02:06.609 INFO   : mi-flora: Noble adapter is poweredOn
2019-06-05 12:02:06.612 INFO   : mi-flora: Start scanning for devices
tim-hellhake commented 5 years ago

Thanks for the info, I'll look into it.

tim-hellhake commented 5 years ago

The cause seems to be in the noble sourcecode. They don't expect an advertising report to be empty. Unfortunately, there is nothing I can do about it.