Skip to content

Node : Message parser

Quentin DESBOIS edited this page Mar 29, 2018 · 8 revisions

atim-parser

This node add attribute channels as array of channel decoded / parsed from raw data message, to current input message. The decoder send msg.payload.channels as JSON Object{} through output:

  • channels : JSON Object{} :
    • "CHANNEL_NAME" : JSON Object {} :
      • unit : String : Channel's unit.
      • values : JSON Array [] :
        • JSON Object{}:
          • datetime : String : Date time of value
          • raw_value : String : Parsed data from Hex value without computing
          • decoded_value : Int: Decoded value
        • JSON Object{}
        • ..

Configuration

The node uses 2 detection modes either Automatic or Manual

  • Detection :
    • Automatic
    • Manual
      • Product : Enforce specific decoder selecting a product in the list, or choose Custom field to make your own device :
        • TH1
        • TM2D
        • ...
        • Custom :

Minimum required input values

  • msg.payload: JSON Object {} :
    • product: String : This field is required if Automatic mode is selected
    • data: String : Hexadecimal raw data
      • e.g : "4300BAFC7856"

Examples

Automatic detection

Input example : msg.payload

{
    "all_gw": [{
        "lsnr": 11.8,
        "mac": "B827EBFFFEA4ABCD",
        "rssi": -38
    }],
    "battery": 238,
    "best_gw": {
        "lsnr": 11.8,
        "mac": "B827EBFFFEA4ABCD",
        "rssi": -38
    },
    "codr": "4/5",
    "data": "3201000000000734",
    "datetime": "2018-03-08T09:32:39Z",
    "datr": "SF12BW125",
    "devaddr": "00A435B5",
    "deveui": "70B3D59BA000602A",
    "fcnt": 3428,
    "freq": 868.3,
    "port": 5,
    "product": "AST/LW8-TEMP-V2"
}

Flow example

Get channels list of decoded raw data with automatic product detection

  • First, create mqtt (input) node and configure it with broker's informations and topic
  • Create atim-find-product node, wired with previous node and set up :
    • Auth : Add new atim-agate-user and press pencil icon
    • Please fill forms with the same credentials than AGATE LoRaWAN Network server
      • Default : Username is admin / Password is admin
  • Create atim-parser node, wired with previous node and set up :
    • Detection : Automatic
  • Add the last node : debug and wired with previous node
  • Deploy !
[{"id":"64083e02.29d68","type":"mqtt in","z":"572f9705.921c98","name":"","topic":"out/#","qos":"2","broker":"d4c6dc9e.35d07","x":290,"y":160,"wires":[["193e19af.51a186"]]},{"id":"ca39ff30.5c447","type":"atim-parser","z":"572f9705.921c98","detection":"auto","x":770,"y":160,"wires":[["84d77069.e38ec"]]},{"id":"193e19af.51a186","type":"atim-find-product","z":"572f9705.921c98","x":530,"y":160,"wires":[["ca39ff30.5c447"]]},{"id":"84d77069.e38ec","type":"debug","z":"572f9705.921c98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":990,"y":160,"wires":[]},{"id":"d4c6dc9e.35d07","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""}]

Manuel detection

Input example : msg.payload

{
    "all_gw": [{
        "lsnr": 11.8,
        "mac": "B827EBFFFEA4ABCD",
        "rssi": -38
    }],
    "battery": 238,
    "best_gw": {
        "lsnr": 11.8,
        "mac": "B827EBFFFEA4ABCD",
        "rssi": -38
    },
    "codr": "4/5",
    "data": "3201000000000734",
    "datetime": "2018-03-08T09:32:39Z",
    "datr": "SF12BW125",
    "devaddr": "00A435B5",
    "deveui": "70B3D59BA000602A",
    "fcnt": 3428,
    "freq": 868.3,
    "port": 5
}

Flow example

Get channels list of decoded raw data with manual product detection

  • First, create mqtt (input) node and configure it with broker's informations and topic
  • Create atim-parser node, wired with previous node and set up :
    • Detection : Manual
    • Product : Select the right product you'll decode
  • Add the last node : debug and wired with previous node
  • Deploy !
[{"id":"bcd7da90.68db18","type":"tab","label":"atim-parser_manual","disabled":false,"info":""},{"id":"2e1e9dcc.949aa2","type":"mqtt in","z":"bcd7da90.68db18","name":"","topic":"out/#","qos":"2","broker":"d4c6dc9e.35d07","x":410,"y":160,"wires":[["f3bc52c1.28b55"]]},{"id":"f3bc52c1.28b55","type":"atim-parser","z":"bcd7da90.68db18","detection":"manual","product":"ACW/SF8-MR2","x":630,"y":160,"wires":[["960cf71e.43ed98"]]},{"id":"960cf71e.43ed98","type":"debug","z":"bcd7da90.68db18","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":850,"y":160,"wires":[]},{"id":"d4c6dc9e.35d07","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""}]