-
Notifications
You must be signed in to change notification settings - Fork 0
Node : Find product
Quentin DESBOIS edited this page Mar 29, 2018
·
9 revisions
This node add attribute product
as product's name to the current msg.payload
send through input.
The node uses AGATE RestAPI to find Profile's name of device into LoRaWAN Network Server and applied it into product
attribute
-
msg.payload
: JSON Object {} :-
deveui
: String- e.g : "70B3D59BA0000000"
-
- atim-agate-user : Create or select an user access authorization for RestAPI Request
From MQTT subscription to AGATE Connector
{
"all_gw": [
{
"lsnr": 10.2,
"mac": "B827EBFFFEA4B183",
"rssi": -42
}
],
"app": "PlatformACW",
"appargs": "atim",
"battery": 239,
"best_gw": {
"lsnr": 10.2,
"mac": "B827EBFFFEA4B183",
"rssi": -42
},
"codr": "4/5",
"data": "320101000000073E",
"datetime": "2018-03-12T11:47:16Z",
"datr": "SF12BW125",
"devaddr": "00A435B5",
"deveui": "70B3D59BA00060000",
"fcnt": 7676,
"freq": 868.3,
"port": 5
}
{
"all_gw": [
{
"lsnr": 10.2,
"mac": "B827EBFFFEA4B183",
"rssi": -42
}
],
"app": "PlatformACW",
"appargs": "atim",
"battery": 239,
"best_gw": {
"lsnr": 10.2,
"mac": "B827EBFFFEA4B183",
"rssi": -42
},
"codr": "4/5",
"data": "320101000000073E",
"datetime": "2018-03-12T11:47:16Z",
"datr": "SF12BW125",
"devaddr": "00A435B5",
"deveui": "70B3D59BA0000000",
"fcnt": 7676,
"freq": 868.3,
"port": 5,
"product": "AST/LW8-TEMP-V2"
}
Add
product
attribute into currentmsg.payload
from MQTT subscription
- 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
- Add the last node : debug and wired with previous node
- Deploy !
[{"id":"5ccfd824.f2cb68","type":"tab","label":"atim-find-product","disabled":false,"info":""},{"id":"6991d027.0043","type":"mqtt in","z":"5ccfd824.f2cb68","name":"","topic":"out/#","qos":"2","broker":"d4c6dc9e.35d07","x":310,"y":100,"wires":[["ee5f5602.8d7538"]]},{"id":"ee5f5602.8d7538","type":"atim-find-product","z":"5ccfd824.f2cb68","user":"4827ca9d.d55f84","x":510,"y":100,"wires":[["342692af.2a096e"]]},{"id":"342692af.2a096e","type":"debug","z":"5ccfd824.f2cb68","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":730,"y":100,"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":""},{"id":"4827ca9d.d55f84","type":"atim-agate-user","z":"","name":"ogate","password":"ogate"}]