The collector incorrectly tries to parse certain BLE packets that are similar to those sent by ruuvi
See original GitHub issueHi! I got this warning around every 3 second and no data was stored in the Influxdb:
WARN [Main] Uncaught exception while handling measurements java.lang.ArrayIndexOutOfBoundsException: 5 at fi.tkgwf.ruuvi.handler.impl.AbstractEddystoneURL.handleMeasurement(AbstractEddystoneURL.java:74) at fi.tkgwf.ruuvi.handler.impl.AbstractEddystoneURL.read(AbstractEddystoneURL.java:36) at fi.tkgwf.ruuvi.Main.lambda$run$5(Main.java:122) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1235) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at fi.tkgwf.ruuvi.Main.run(Main.java:124) at fi.tkgwf.ruuvi.Main.main(Main.java:88)
Do you have any clues? Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Alright so technically the collector works, but throws annoying warnings as it erroneously detects non-ruuvi packets as such, I will improve the detection logic based on this to get rid of the warnings, hopefully I find time for this already this weekend, latest next weekend (as that’s when my vacation starts).
You can see the source MAC address from the bytes at offset 7-12 backwards, for example:
> 04 3E 2A 02 01 03 01 BC 7C 37 C4 4A F7 1E 02 01 06 1A FF 4C
is a packet originating from a device with MAC address of F7:4A:C4:37:7C:BC (the bytes are in reverse order). The 7 bytes before the MAC address is what the current logic uses to “detect” the data from ruuvi, which are in order:
The immediate warnings (based on the provided BLE dump) should be gone now. Additionally I added support for blacklisting or whitelisting tags based on their MAC address in case something still causes issues, check the ruuvi-collector.properties.example for more information in case you need it