test

test

[
    {
        "id":"7666dab9.81527c",
        "type":"lora in",
        "name":"",
        "datatype":"bytes",
        "x":88,
        "y":54,
        "z":"f8a112a7.ed53d",
        "wires":[
            [
                "1dba508c.e3280f"
            ]
        ]
    },
    {
        "id":"4a1d0c2f.ddb2c4",
        "type":"http request",
        "name":"HTTP Request",
        "method":"use",
        "ret":"txt",
        "url":"",
        "x":370,
        "y":211,
        "z":"f8a112a7.ed53d",
        "wires":[
            [
                "42c592dc.469c7c"
            ]
        ]
    },
    {
        "id":"1dba508c.e3280f",
        "type":"function",
        "name":"Prepare Request",
        "func":"return {\n    method: \"POST\",\n    url: \"https://lora.mydevices.com/v1/networks/multitech/uplink\",\n    payload: msg,\n}",
        "outputs":1,
        "noerr":0,
        "x":160,
        "y":144,
        "z":"f8a112a7.ed53d",
        "wires":[
            [
                "4a1d0c2f.ddb2c4",
                "a7afffd4.b82e4"
            ]
        ]
    },
    {
        "id":"a7afffd4.b82e4",
        "type":"debug",
        "name":"Debug Request",
        "active":true,
        "console":"false",
        "complete":"true",
        "x":277,
        "y":343,
        "z":"f8a112a7.ed53d",
        "wires":[
 
        ]
    },
    {
        "id":"3b4ac0d7.2d2c7",
        "type":"debug",
        "name":"Debug Response",
        "active":true,
        "console":"false",
        "complete":"payload",
        "x":826,
        "y":402,
        "z":"f8a112a7.ed53d",
        "wires":[
 
        ]
    },
    {
        "id":"42c592dc.469c7c",
        "type":"switch",
        "name":"",
        "property":"statusCode",
        "rules":[
            {
                "t":"eq",
                "v":"200"
            },
            {
                "t":"else"
            }
        ],
        "checkall":"true",
        "outputs":2,
        "x":491,
        "y":275,
        "z":"f8a112a7.ed53d",
        "wires":[
            [
                "cba8556f.4029f8"
            ],
            [
                "446cd852.38ca58"
            ]
        ]
    },
    {
        "id":"446cd852.38ca58",
        "type":"json",
        "name":"",
        "x":499,
        "y":376,
        "z":"f8a112a7.ed53d",
        "wires":[
            [
                "d484c284.99dd3"
            ]
        ]
    },
    {
        "id":"cba8556f.4029f8",
        "type":"function",
        "name":"OK",
        "func":"return {\n    payload: 'Payload sent to Cayenne'\n}",
        "outputs":1,
        "noerr":0,
        "x":646,
        "y":339,
        "z":"f8a112a7.ed53d",
        "wires":[
            [
                "3b4ac0d7.2d2c7"
            ]
        ]
    },
    {
        "id":"d484c284.99dd3",
        "type":"function",
        "name":"Error",
        "func":"if (msg.statusCode == 403) {\n    return {\n        payload: \"DevEUI unknown in Cayenne\"\n    }\n}\nreturn msg;",
        "outputs":1,
        "noerr":0,
        "x":646,
        "y":386,
        "z":"f8a112a7.ed53d",
        "wires":[
            [
                "3b4ac0d7.2d2c7"
            ]
        ]
    }
]
croczey

Flow Info

created 2 months, 3 weeks ago

Node Types

Core
  • debug (x2)
  • function (x3)
  • http request (x1)
  • json (x1)
  • switch (x1)
Other
  • lora in (x1)

Tags

Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option