Skip to content

Instantly share code, notes, and snippets.

@croczey
Created July 31, 2017 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save croczey/0ed5b2f0b5339d729bce11bb15bc2fc9 to your computer and use it in GitHub Desktop.
Save croczey/0ed5b2f0b5339d729bce11bb15bc2fc9 to your computer and use it in GitHub Desktop.
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"
]
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment