-
Notifications
You must be signed in to change notification settings - Fork 844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HELP] - [tb_gateway_service.py] - tb_gateway_service - __connect_with_connectors - 849 - Config incorrect for mqtt #1287
Comments
Hi @DuXiaoChuang. IOTGW-83 |
@DuXiaoChuang According to your gateway config, MQTT config is in mqtt.json |
ok,how to reslove this problem?my gateway config is error? MQTT.jason:
|
Hi @DuXiaoChuang, Could you try to use a version from the master branch? it contains changes in connect_with_connectors method. |
THKS,I will try; |
"Hello, I just downloaded the latest code from the master branch, but I'm still getting this recurring error when running it." |
"Hello, do I need to run the thingsboard-gateway code on a Linux system? Currently, I am debugging the thingsboard-gateway code on a Windows system." |
Hello, I have already solved this problem, but I'm not sure if this solution is correct. I modified the --connect_ With_ The connectors method, modified the conditions, and after modification, it can connect to the mqtt connector normally. Before modification:
After modification: |
Hi @DuXiaoChuang, This issue was closed due to inactivity, please open it if you think that it is not solved. |
Describe the issue
[tb_gateway_service.py] - tb_gateway_service - __connect_with_connectors - 849 - Config incorrect for mqtt
Configuration (Attach your configuration file)
MQTT.json:{ "broker": { "name": "Default Local Broker", "host": "broker.emqx.io", "port": 1883, "clientId": "ThingsBoard_gateway", "version": 5, "maxMessageNumberPerWorker": 10, "maxNumberOfWorkers": 100, "sendDataOnlyOnChange": false, "security": { "type": "basic", "username": "", "password": "" } }, "mapping": [ { "topicFilter": "/sensor/data", "converter": { "type": "json", "deviceNameJsonExpression": "${serialNumber}", "deviceTypeJsonExpression": "${sensorType}", "sendDataOnlyOnChange": false, "timeout": 60000, "attributes": [ { "type": "string", "key": "model", "value": "${sensorModel}" }, { "type": "string", "key": "${sensorModel}", "value": "on" } ], "timeseries": [ { "type": "double", "key": "temperature", "value": "${temp}" }, { "type": "double", "key": "humidity", "value": "${hum}" }, { "type": "string", "key": "combine", "value": "${hum}:${temp}" } ] } }, { "topicFilter": "/sensor/+/data", "converter": { "type": "json", "deviceNameTopicExpression": "(?<=sensor/)(.*?)(?=/data)", "deviceTypeTopicExpression": "Thermometer", "sendDataOnlyOnChange": false, "timeout": 60000, "attributes": [ { "type": "string", "key": "model", "value": "${sensorModel}" } ], "timeseries": [ { "type": "double", "key": "temperature", "value": "${temp}" }, { "type": "double", "key": "humidity", "value": "${hum}" } ] } }, { "topicFilter": "/sensor/raw_data", "converter": { "type": "bytes", "deviceNameExpression": "[0:4]", "deviceTypeExpression": "default", "sendDataOnlyOnChange": false, "timeout": 60000, "attributes": [ { "type": "raw", "key": "rawData", "value": "[:]" } ], "timeseries": [ { "type": "raw", "key": "temp", "value": "[4:]" } ] } }, { "topicFilter": "/custom/sensors/+", "converter": { "type": "custom", "extension": "CustomMqttUplinkConverter", "cached": true, "extension-config": { "temperatureBytes": 2, "humidityBytes": 2, "batteryLevelBytes": 1 } } } ], "connectRequests": [ { "topicFilter": "sensor/connect", "deviceNameJsonExpression": "${SerialNumber}" }, { "topicFilter": "sensor/+/connect", "deviceNameTopicExpression": "(?<=sensor/)(.*?)(?=/connect)" } ], "disconnectRequests": [ { "topicFilter": "sensor/disconnect", "deviceNameJsonExpression": "${SerialNumber}" }, { "topicFilter": "sensor/+/disconnect", "deviceNameTopicExpression": "(?<=sensor/)(.*?)(?=/disconnect)" } ], "attributeRequests": [ { "retain": false, "topicFilter": "v1/devices/me/attributes/request", "deviceNameJsonExpression": "${serialNumber}", "attributeNameJsonExpression": "${versionAttribute}, ${pduAttribute}", "topicExpression": "devices/${deviceName}/attrs", "valueExpression": "${attributeKey}: ${attributeValue}" } ], "attributeUpdates": [ { "retain": true, "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}" } ], "id": "f69f14a1-d87c-4d28-840b-37dfb34a26c4" }
Connector name (If you need help with some connector/converter):
[e.g. MQTT Connector]
Error traceback (If it was raised):
'deviceName'
Traceback (most recent call last):
File "", line 2, in
KeyError: 'deviceName'
The text was updated successfully, but these errors were encountered: