I bought a KNOT and a TG-BT5-OUT tag to try and learn something about BLE and IoT. My aim is to complete a simple project where an HTTP POST is made when the tag detects a tilt.
I think I am running into a limitation with how BLE works but just wanted to check that it’s not my fault. I started off with the tag set to advertise when it detects that it’s been tilted, with periodic advertisements disabled. I was not seeing every tilt event when I looked at the advertising reports received on the KNOT - I am guessing this is a result of the radio not listening on whatever channel was used to broadcast the advertisement at the moment it was sent, and so I am missing it. If I set the tag to advertise every 3s then I get most of the advertisements but am still losing some - this can be one-off drops or sometimes 15-20s can pass without a packet being received. I would say about 20% of the advertisements aren’t being received. Signal strength is -64dB with line of sight between the tag and the KNOT so I don’t think that is the issue, the scanner interval and window are on their 10ms defaults.
Is there any way to improve this, or would it just be a case of reducing the advertisement interval (and pushing up the power consumption) to compensate for some of the messages being lost? I assume that I won’t be able to use the feature on the tag where it sends one message each time it detects a tilt as I have no guarantee of the KNOT receiving it, and the tag only sends one advertisement on each event (it would be great if it could send a burst of advertisements over a couple of seconds, not sure if that can be changed in future firmware), so it looks like I will need to look at the data coming back from the tag and decide in my script whether that counts as a tilt or not.
I am having similar issue with advertisements not updating using a ble tag with a button. Button is programmed for one press or two press and sends a different uuid for each. I was testing with one button press then tried two button press but kept getting data for the single press. after thinking it was the BLE button I tried a BLE app on my phone and button does exactly as its supposed to. If i reboot the KNOT and try double button press first I get correct data then try single button I keep getting data for the double press until I reboot it again. The Mikroitk KNOT seems to not be refreshing the data only the signal and timestamp.
Basically, the only difference in your case, is that the tilt condition will trigger the email notification. As you can see from the script, the script “collects” all possible triggers, so if you “tilt” the tag and see the payload’s 21 octets as “02” → it will send an email notification indicating that the “tilt trigger was detected”.
The last thing to change is the /tool e-mail part. You will just need to alter it for the “http post” /tool fetch scenario.
KNOT’s scanner should detect 37, 38 and 39 Bluetooth advertising channel data.
Can you try relocating your KNOT to another location with less 2.4 GHz interference and try checking how well the payloads are received there? Maybe it is a location issue.
I would highly advise you to create a ticket in our support system so we can check more detailed information there: https://mikrotik.com/support
Thanks Deniss. Is there a way within the KNOT itself to see if there is interference on the BLE channels? If I turn on the Wi-Fi radio and go to the status page it shows a noise floor of -119dBm.
Hi There Deniss, i have tried this guide and followed each step setting up the email server, and created the schedule. However I still do not get any emails or output from the Knot router at all to email.
Apart from the email server setup, is there any thing in the firewall settings that might cause this not to send any email?
If you can, check the logs what happens there. I would suggest making a support ticket in our system if you still have the issue: https://mikrotik.com/support