Community discussions

MikroTik App
 
misko67
just joined
Topic Author
Posts: 3
Joined: Fri Aug 27, 2021 12:01 pm

KNOT & TG-BT5-IN / OUT

Thu Nov 25, 2021 7:53 pm

Dear MikroTik friends,
have any of you looked into the KNOT's bluetooth scanner in conjunction with the TG-BT5-IN or TG-BT5-OUT?
As far as I understood the instructions and the script (https://help.mikrotik.com/docs/pages/vi ... ptscenario), the KNOT should send the scanned Bluetooth information via MQTT. Something is also sent via MQTT but there is no data of the detected Bluetooth devices included.
Here an example:
{"clientId":"KNOT-01","t":0,"v":1,"OldestAdvertisementTimestamp":0,"locs":[{"id":"2CC81B84xxx","tags":[],"ed":{"model":"RB924i-2nD-BT5&BG77","sn":"E0FD0E56xxx","ros":"6.49","cpu":28,"umem":23117824,"fmem":43991040,"psu":0,"temp":0}}]}

I would have expected the script to also send information of the scanned Bluetooth devices via MQTT, which unfortunately is not the case. Since MQTT data is sent, the script also seems to work in principle. I did not change anything in the script itself, except that I have changed the name of the MQTT server (:local broker "Demo Device") to mine.

I first thought that there might be too many Bluetooth devices that are seen and therefore none are sent via MQTT and have set up a whitelist in which two devices are included. But that didn't help either.

Are you aware of a problem or bug? The software I use is the 6.49 version.
Further I would be interested if someone knows what the HEX data of the TG-BT5-IN / OUT tags mean. I would have expected that these are documented somewhere and that they can be evaluated for example in Node-Red. I would be happy if someone could help me and the colleagues from MikroTik improve the documentation a bit.

Best Regards,
Ivan
 
misko67
just joined
Topic Author
Posts: 3
Joined: Fri Aug 27, 2021 12:01 pm

Re: KNOT & TG-BT5-IN / OUT

Sun Nov 28, 2021 1:08 am

Meanwhile I tried to interpret the script. Currently I would say that in the MQTT output no parameters from the Bluetooth part are. I´ve attached the MQTT Part and hope somebody can find the bug.


#################################### MQTT #####################################
:local message \
"{\
\"clientId\":\"$[/iot mqtt brokers get value-name=client-id \
[/iot mqtt brokers find name=$broker]]\",\
\"t\":0,\
\"v\":1,\
\"OldestAdvertisementTimestamp\":$btOldestAdvertisementTimestamp,\
\"locs\":[{\
\"id\":\"$[$minimizeMac address=$ifaceMac]\",\
\"tags\":[$advJson],\
\"ed\":{\
\"model\":\"$model\",\
\"sn\":\"$serialNumber\",\
\"ros\":\"$rosVersion\",\
\"cpu\":$cpuLoad,\
\"umem\":$usedMemory,\
\"fmem\":$freeMemory,\
\"psu\":$supplyVoltage,\
\"temp\":$boardTemp\
}\
}]\
}"
:log info "$message";
:put ("[*] Total message size: $[:len $message] bytes")
:put ("[*] Sending message to MQTT broker...")
/iot mqtt publish broker=$broker topic=$topic message=$message
:put ("[*] Done")

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], johnb175a, scoobyn8 and 54 guests