background image

#################################### 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")

To run this script, the Broker should be pre-configured:

For example, 

 only requires settings that are shown in the screenshot above. When you successfully configure the broker, the only thing that 

thingsboard

needs to be changed in the script is:

:local broker "Demo Device"

line, where you should specify the broker's name within the quotation marks "".

Another line that should be taken into account is:

:local topic "v1/devices/me/telemetry"

, where you should specify the topic.

Содержание RB924i-2nD-BT5&BG77

Страница 1: ...gulation settings Set the antenna gain depending on the antenna used Set up your wireless network password Set up your router password Mounting The device can be mounted using provided DIN rail mount set Designed to fit standard 35 mm x 7 5 mm DIN rails Attach it with two provided screws to the device and attach the device to the DIN rail The DIN rail is not provided in the package Alternatively i...

Страница 2: ...Extension slots and ports 2 4 GHz 802 11b g n antenna gain 1 5 dBi Built in GPS module GPS GLONASS BeiDou Galileo Two 10 100 Ethernet ports supporting automatic cross straight cable correction Auto MDI X Either straight or crossover cable can be used for connecting to other network devices The Ethernet port accepts 12 57 V DC power from an PoE injector 802 3af at One microUSB 2 0 port for powering...

Страница 3: ...for 5 more seconds until LED turns off then release it to make the RouterBOARD look for Netinstall servers total 15 seconds Regardless of the above option used the system will load the backup RouterBOOT loader if the button is pressed before power is applied to the device Useful for RouterBOOT debugging and recovery GPIO pinout GPIO pins are located on the board under the case as shown in the pict...

Страница 4: ... note Analog input voltage is 0 60 V Theoretical resolution is 4 mV 14bit ADC Analog input impedance is approximately 72K Ohm Connected relays pin4 or pin6 Tamper switch pin5 ...

Страница 5: ...s is blocked from the internet port by default For recovery purposes it is possible to boot the device from the network see section Buttons and jumpers note make sure that package is installed beforehand iot Overview Protocols such as MQTT and HTTP are widely used to push data within networks M2M topologies can use different technologies such as Wi Fi or M2M Bluetooth to send data within networks ...

Страница 6: ...r example knowing the MAC address of the device you can set up a filter to only show specific reports You can add more filter options using icon You can remove filter options using icon MQTT Broker configuration Navigate to IoT MQTT You can add a new broker via button External antennas must be connected to use the Narrow Band modem and GPS Not provided with the package ...

Страница 7: ...QTT broker Password Password for MQTT broker Client Id A unique ID used for the connection The broker uses this ID to identify the client Certificate Chose a certificate if required for the two way authentication note You do not have to specify servers certificate cer file in the MQTT broker settings The Certificate field is used for the client s certificate note Name Address and Port field config...

Страница 8: ...her1 POSIX regex for filtering advertisement Bluetooth addresses E g BC 33 AC would only include addresses which start with those 3 octets To disable this filter set it to local addressRegex POSIX regex for filtering Bluetooth advertisements based on their data Same usage as with addressRegex local advertisingDataRegex Signal strength filter E g 40 would only include Bluetooth advertisements whose...

Страница 9: ...vTimestamp 0 Remove semicolons from MAC Bluetooth addresses local minimizeMac do local minimized local lastIdx len address 1 for idx from 0 to lastIdx step 1 do local char pick address idx if char do set minimized minimized char return minimized foreach adv in advertisements do local address adv address local ts adv epoch local rssi adv rssi local ad adv data local obj id minimizeMac address addre...

Страница 10: ...ze len message bytes put Sending message to MQTT broker iot mqtt publish broker broker topic topic message message put Done To run this script the Broker should be pre configured For example only requires settings that are shown in the screenshot above When you successfully configure the broker the only thing that thingsboard needs to be changed in the script is local broker Demo Device line where...

Страница 11: ...uld only include addresses which start with those 3 octets To disable this filter set it to local addressRegex POSIX regex for filtering Bluetooth advertisements based on their data Same usage as with addressRegex local advertisingDataRegex Signal strength filter E g 40 would only include Bluetooth advertisements whose signal strength is stronger than 40dBm To disable this filter set it to local r...

Страница 12: ...vTimestamp 0 Remove semicolons from MAC Bluetooth addresses local minimizeMac do local minimized local lastIdx len address 1 for idx from 0 to lastIdx step 1 do local char pick address idx if char do set minimized minimized char return minimized foreach adv in advertisements do local address adv address local ts adv epoch local rssi adv rssi local ad adv data local obj id minimizeMac address addre...

Страница 13: ...YlBqv59NdzOel6tyP telemetry Navigate to System Scripts and add a new script there name it for example script1 To run the script you can use the command line system script run script1 MikroTik mobile app Use the MikroTik smartphone app to configure your router in the field or to apply the most basic initial settings for your MikroTik home access point Scan QR code and choose your preferred OS Insta...

Страница 14: ...s device must accept any interference including interference that may cause undesired operation of the device L émetteur récepteur exempt de licence contenu dans le présent appareil est conforme aux CNR d Innovation Sciences et Développement économique Canada applicables aux appareils radio exempts de licence L exploitation est autorisée aux deux conditions suivantes 1 L appareil ne doit pas produ...

Страница 15: ...otīkls SIA niddikjara li dan it tip ta tagħmir tar radju RB924i 2nD BT5 BG77 huwa konformi mad Direttiva 2014 53 UE It test kollu tad dikjarazzjoni ta konformità tal UE huwa disponibbli f dan l indirizz tal Internet li ġej https mikrotik com products NL Hierbij verklaar ik Mikrotīkls SIA dat het type radioapparatuur RB924i 2nD BT5 BG77 conform is met Richtlijn 2014 53 EU De volledige tekst van de ...

Страница 16: ... maximalen WLAN und LTE Sendeleistung Grenzwerte gemäß ETSI Bestimmungen Weitere Informationen finden Sie oben unter Konformitätserklärung FR Cet appareil MikroTik respecte les limites maximales de puissance de transmission WLAN et LTE conformément aux réglementations ETSI Pour plus d informations voir la déclaration de conformité ci dessus IT Questo dispositivo MikroTik è conforme ai limiti massi...

Отзывы: