Closed oscardavidtorres1994 closed 4 years ago
Did figure out how to interface chirpstack with TB GATEWAY ?
Hi @oscardavidtorres1994 ,
Thank you for your interest in ThingsBoard IoT gateway.
To parse data like this, you are able to use JsonPath Expressions, for example for cosumption value should be ${$.uplink_message.decoded_payload.consumption} , it will look like:
...
"key": "consumption" ,
"value": "${$.uplink_message.decoded_payload.consumption}"
},
...
To check your JsonPath expression, you are able to use the following site - https://jsonpath.com/
Did figure out how to interface chirpstack with TB GATEWAY ?
Hi @cristianhumelnicu ,
As I know there is a MQTT integration in Chirpstack, you may use it to connect the gateway using MQTT connector. Official documentation for MQTT integration in Chirpstack is here.
Did figure out how to interface chirpstack with TB GATEWAY ?
Hi @cristianhumelnicu ,
As I know there is a MQTT integration in Chirpstack, you may use it to connect the gateway using MQTT connector. Official documentation for MQTT integration in Chirpstack is here.
Yes , i know about it , i try it and is working , but im much interested to connect TB gateway via MQTT to chirpstack
I mean how to configure mqtt from TB gatway for that. I know how to do it in old TB Gw ... but this version ... is over my knowledge.
Thx
Please share your old configuration section mapping, I will try to help you to convert it to the current configuration.
Please share your old configuration section mapping, I will try to help you to convert it to the current configuration.
This is the old configuration. Difference is topic, now is application/123/device/+/event/up
Thak you very much for your help !
Please share your old configuration section mapping, I will try to help you to convert it to the current configuration.
Hi I put the configuration, can you help please ?
Thank You!
Hi @cristianhumelnicu ,
Please try the following configuration:
{
"broker": {
"name":"Default Local Broker",
"host":"localhost",
"port":18883,
"security": {
"type": "basic",
"username": "machineman5",
"password": "password"
}
},
"mapping": [
{
"topicFilter": "v3/machineman5/devices/+/up",
"converter": {
"type": "json",
"deviceNameTopicExpression": "(?<=devices/)(.*?)(?=/)",
"deviceTypeTopicExpression": "Machineman5",
"timeout": 60000,
"attributes": [
{
"type": "string",
"key": "model",
"value": "${sensorModel}"
}
],
"timeseries": [
{
"type": "double",
"key": "consumption" ,
"value": "${$.uplink_message.decoded_payload.consumption}"
},
{
"type": "string",
"key": "device_type",
"value": "${$.uplink_message.decoded_payload.device_type}"
},
{
"type": "double",
"key": "ignition",
"value": "${$.uplink_message.decoded_payload.ignition}"
},
{
"type": "double",
"key": "motor_temp",
"value": "${$.uplink_message.decoded_payload.motor_temp}"
},
{
"type": "double",
"key": "motor_water_temp",
"value": "${$.uplink_message.decoded_payload.motor_water_temp}"
},
{
"type": "double",
"key": "oil_pressure",
"value": "${$.uplink_message.decoded_payload.oil_pressure}"
},
{
"type": "double",
"key": "remaining_fuel",
"value": "${$.uplink_message.decoded_payload.remaining_fuel}"
},
{
"type": "double",
"key": "tire_pressure",
"value": "${$.uplink_message.decoded_payload.tire_pressure}"
}
]
}
}
],
"connectRequests": [
{
"topicFilter": "sensor/connect",
"deviceNameJsonExpression": "${SerialNumber}"
},
{
"topicFilter": "sensor/+/connect",
"deviceNameTopicExpression": "(?<=sensor\/)(.*?)(?=\/connect)"
}
],
"disconnectRequests": [
{
"topicFilter": "sensor/disconnect",
"deviceNameJsonExpression": "${SerialNumber}"
},
{
"topicFilter": "sensor/+/disconnect",
"deviceNameTopicExpression": "(?<=sensor\/)(.*?)(?=\/disconnect)"
}
],
"attributeUpdates": [
{
"deviceNameFilter": "SmartMeter.*",
"attributeFilter": "uploadFrequency",
"topicExpression": "sensor/${deviceName}/${attributeKey}",
"valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}"
}
],
"serverSideRpc": [
{
"deviceNameFilter": ".*",
"methodFilter": "echo",
"requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}",
"responseTopicExpression": "sensor/${deviceName}/response/${methodName}/${requestId}",
"responseTimeout": 10000,
"valueExpression": "${params}"
},
{
{
"deviceNameFilter": ".*",
"methodFilter": "no-reply",
"requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}",
"valueExpression": "${params}"
}
]
}
Hi @cristianhumelnicu ,
Please try the following configuration:
{ "broker": { "name":"Default Local Broker", "host":"localhost", "port":18883, "security": { "type": "basic", "username": "machineman5", "password": "password" } }, "mapping": [ { "topicFilter": "v3/machineman5/devices/+/up", "converter": { "type": "json", "deviceNameTopicExpression": "(?<=devices/)(.*?)(?=/)", "deviceTypeTopicExpression": "Machineman5", "timeout": 60000, "attributes": [ { "type": "string", "key": "model", "value": "${sensorModel}" } ], "timeseries": [ { "type": "double", "key": "consumption" , "value": "${$.uplink_message.decoded_payload.consumption}" }, { "type": "string", "key": "device_type", "value": "${$.uplink_message.decoded_payload.device_type}" }, { "type": "double", "key": "ignition", "value": "${$.uplink_message.decoded_payload.ignition}" }, { "type": "double", "key": "motor_temp", "value": "${$.uplink_message.decoded_payload.motor_temp}" }, { "type": "double", "key": "motor_water_temp", "value": "${$.uplink_message.decoded_payload.motor_water_temp}" }, { "type": "double", "key": "oil_pressure", "value": "${$.uplink_message.decoded_payload.oil_pressure}" }, { "type": "double", "key": "remaining_fuel", "value": "${$.uplink_message.decoded_payload.remaining_fuel}" }, { "type": "double", "key": "tire_pressure", "value": "${$.uplink_message.decoded_payload.tire_pressure}" } ] } } ], "connectRequests": [ { "topicFilter": "sensor/connect", "deviceNameJsonExpression": "${SerialNumber}" }, { "topicFilter": "sensor/+/connect", "deviceNameTopicExpression": "(?<=sensor\/)(.*?)(?=\/connect)" } ], "disconnectRequests": [ { "topicFilter": "sensor/disconnect", "deviceNameJsonExpression": "${SerialNumber}" }, { "topicFilter": "sensor/+/disconnect", "deviceNameTopicExpression": "(?<=sensor\/)(.*?)(?=\/disconnect)" } ], "attributeUpdates": [ { "deviceNameFilter": "SmartMeter.*", "attributeFilter": "uploadFrequency", "topicExpression": "sensor/${deviceName}/${attributeKey}", "valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}" } ], "serverSideRpc": [ { "deviceNameFilter": ".*", "methodFilter": "echo", "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}", "responseTopicExpression": "sensor/${deviceName}/response/${methodName}/${requestId}", "responseTimeout": 10000, "valueExpression": "${params}" }, { { "deviceNameFilter": ".*", "methodFilter": "no-reply", "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}", "valueExpression": "${params}" } ] }
Hi Ilya,
My topic is application/+/device/+/event/up
Will be same mappig that u have sending to me?
Thank you very much!
No, sorry, I have changed only mapping section, you should change v3/machineman5/devices/+/up
to application/+/device/+/event/up
. Also I recommend you change deviceNameTopicExpression to some static name for test purposes.
It works perfectly. Thanks a lot.
I'm glad to hear this, please write us if you will have any questions/suggestions.
I have data comming from TTN, the data seems like this:
I need to extrac data from the part: decoded_payload
I don't know to configure mqtt.json to extract the data. I can subscribe well into v3/machineman5/devices/+/up but I can't extract data to my device in ThingsBoard. I have this configuration:
**Error traceback
Versions :