Just starting with the KNOT and the TG-BT5-IN & TG-BT5-OUT BLE Tags - very impressed! I have managed to get it all up and running with an HTTP post to an ORDS Database method.
We are going to use multiple TG-BT5 devices for our solution.
Can you please advise whether more than one MAC Address can be used in the system script OR is it one script per MAC Address (per BLE Device)?
I couldn’t find any examples in this regard - thus my only conclusion at this stage is one script per MAC Address (per BLE Device).
If you’re more familiar with programming, I’d refactor their examples. The scripting language support arrays and functions, that allow way cleaner code than Mikrotik IoT doc’s examples use – especially when you want to extend it to support multiple tags.
Many thanks for your quick response and direction. I am using the code you referenced in the link, and changed the code to send the notification/s via HTTP post. I will most definitely look at cleaner code options (arrays etc.)
One last question: is there a best practice/rule of thumb/advice for the number of tags a KNOT can handle/support?
We use the KNOTs for LoRaWAN, so I don’t know the limits of BLE tags… But I’d imagine the “limit” be more be how congested the 2.4Ghz environment is at the location (e.g. noise).
Now device and RouterOS scripting does have limits too, especially strings (4096 bytes). And, the example script uses a string to store a list of devices, so it be subject to that limit… Why I mention using arrays, since that type (unlike string) is limited by memory. But imagine you’d be fine for dozens of BLE tags using the Mikrotik’s example (beyond that I bet you’d hit some limit and require different logic).
Essentially any script for BLE has to periodically poll (e.g.via /system/scheduler)
/iot bluetooth scanners advertisements print detail as-value where ...
So how “smart” your code is at using the “where” and managing state to know if/what to notify via HTTP (/tool/fetch) is likely where you could run into limits on the OS side.