Skip to content
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

[BUG] Config incorrect for mqtt #1299

Closed
devaskim opened this issue Feb 11, 2024 · 3 comments
Closed

[BUG] Config incorrect for mqtt #1299

devaskim opened this issue Feb 11, 2024 · 3 comments
Assignees
Labels
bug can be closed If bug fixed or feature is implemented

Comments

@devaskim
Copy link
Contributor

Describe the bug

After pulling out the latest source code (11 Jan) I faced with a problem of invalid configuration of each my mqtt connector.

There are magic lines of code in tb_gateway_service.py which my configurations cannot pass. The debugger pointed me out to an absent logLevel. Where this field should be set?

if ("logLevel" in connector_config["config"][config] and "name" in connector_config["config"][config] and len(connector_config["config"][config].keys()) > 3) or \
    ("logLevel" not in connector_config["config"][config] and "name" not in connector_config["config"][config] and len(connector_config["config"][config].keys()) > 1)

Here is one of connector's configuration:

{
  "broker": {
    "name": "ADFWEB",
    "host": "127.0.0.1",
    "port": 1883,
    "clientId": "ADFWebGateway",
    "maxMessageNumberPerWorker": 10,
    "maxNumberOfWorkers": 100,
    "sendDataOnlyOnChange": false,
    "sendDataOnlyOnChangeTtl": 10800000,
    "security": {
      "type": "basic",
      "username": "user",
      "password": "qwerty"
    }
  },
  "mapping": [
    {
      "topicFilter": "ADF_Web/HD67933/T_Flow",
      "converter": {
        "type": "json",
        "deviceNameTopicExpression": "HD67933",
        "deviceTypeTopicExpression": "ADFWEB",
        "attributes": [],
        "timeseries": [
          {
            "type": "double",
            "key": "T_Flow",
            "value": "${value}"
          }
        ]
      }
    }
  ],
  "connectRequests": [],
  "disconnectRequests": [],
  "attributeRequests": [],
  "attributeUpdates": [],
  "serverSideRpc": [],
  "id": "93cc2506-adcd-43cb-ae48-d454770de1f1"
}

And here is snippet from tb_gateway.json

,
  "connectors": [
    {
      "name": "ADFWEB",
      "type": "mqtt",
      "configuration": "adfweb.json"
     }
  ]
Copy link

Hi @devaskim.
Thank you for your interest in ThingsBoard IoT Gateway.
Your issue was registered, please wait for response from engineer.

IOTGW-111

@imbeacon
Copy link
Member

Hi @devaskim,

Please try the version from the master branch, bda8f12 - should fix the issue.

@imbeacon imbeacon added the can be closed If bug fixed or feature is implemented label Feb 20, 2024
@devaskim
Copy link
Contributor Author

fixed, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug can be closed If bug fixed or feature is implemented
Projects
None yet
Development

No branches or pull requests

3 participants