Pycom Scanner

Hey,

To help people get up and running as easy as possible I have a simple to use BLE to MQTT scanner that can be run on a Pycom board. It will decode both RAWv1 and RAWv2 data. It also decodes Eddystone TLM data and anything it cannot decode the raw packet is snt through.

Source Code is:

2 Likes

Perfect :ok_hand: Having more gateway options is always good!

Looks great.

In format 5, you might consider byte 15, Movement counter (8bit unsigned), incremented by motion detection interrupts from LIS2DH12 Accelerometer.

How do you intrepret totalACC, by that i mean what does it mean to you?
Are you Ruuvi’s at fixed locations or do they move?

Hey Thanks for that,

Already have the Movement counter as an issue I have to fix.

Total acceleration is just RMS, so RMS = sqrt(x * x + y * y + z * z).

This makes it easy to only focus on one acceleration value instead of the three and is easier to create rules against if the highpass filter has been enabled on the Ruuvitag. As when stationary value will range from 0 to 0.02 due to fluxiations with gravity readings. So an alert could be triggered if above 0.04 for example.

The tags are stationary, could be movable and use the RSSI from multiple gateways to triangulate location of the tag.

theBASTI0N said: I have a double brick house where a raspberry pi’s ble sensitivty meant I would not be able to see all tags within the house and outside.

With the Pycom boards I can use an external antenna for ble which gives me better performance with sensitivty and it means it is not sharing the antenna with wifi.

I haev one on each end of the house which collects all tags in the house and outside and every other ble packet from the neighbours.

Also the performance with hosting everything on a RPI was not ideal once I went over 10 tags it found it sluggish.

“from the neighbours.” interesting.

++++

dgerman replied: You have a very large number of Unknown Tags. I expect all those cause a lot of interference. Does it result in many missing packets even with many just showing up infrequently.

Are you familiar with RuuviCollectors:
measurementUpdateLimit=30000

Which MQTT broker are you using?
What is infix / Grafana running on?

Unknown advertisement will always occur, they could be a gaming remote a speaker almost anything nowadays that supports BLE. This also means that interference is expected filtering is almost always done on a software level when scanning for BLE data, you may add a tag into a whitelist but the hardware is always scanning for everything it can see having the software filter the data afterwards.

I have tested the Pycom boards in an environment where there were more known and unknown tags that I have at home. Performance was improved when I separated the WiFi to the external and BLE to the internal antenna which I cannot do an a RPI. But packets will still be lost and that is expected in a polluted RF environment. Where I see the most packets lost is on external tags where the weather plays a major role in interference.

With the unknown tags I could begin to look at the Manufactures IDs to determine what type of device it may be.

As for what I am using:

  • Mosquito on a RPI 3 b+

  • Unraid server running docker container for:
    -Node-RED
    -Influx and
    -Grafana

This gives me much better performance than what I could ever get on a RPI.

If wanted I added the Node-RED flows on the github page and list the DB’s to create.

1 Like

Hey,

Added movement counter into decoded data, along with Measurement Sqequnce and fixed the issue I had with Battery and tx measurements.

1 Like