Thingsboard Gateway REST 连接器无法初始化

Thingsboard Gateway REST connector fails to initialize

我正在尝试为 Thingsboard IoT 网关设置 REST 连接器并在初始化时遇到一些错误。我的 rest.json 配置是:

{
  "host": "127.0.0.1",
  "port": "5000",
  "SSL": false,
  "mapping": [
    {
      "endpoint": "/sizerdata",
      "HTTPMethods": [
        "POST"
      ],
      "security": {
        "type": "anonymous"
      },
      "converter": {
        "type": "json",
        "deviceNameExpression": "Sizer ${name}",
        "deviceTypeExpression": "default",
        "attributes": [
          {
            "type": "string",
            "key": "serialNumber",
            "value": "${serialNumber}"
          }
        ],
        "timeseries": [
          {
            "type": "integer",
            "key": "cupfill",
            "value": "${cupfill}"
          },
          {
            "type": "integer",
            "key": "packsPerHour",
            "value": "${packsPerHour}"
          },
          {
            "type": "integer",
            "key": "totalFruitPerMinute",
            "value": "${totalFruitPerMinute}"
          }
        ]
      }
    }
  ]
}

当我启动 thingsboard-gateway 服务时,我在日志中收到以下错误:

""2021-12-29 13:09:07" - |ERROR| - [rest_connector.py] - rest_connector - run - 152 - web.Application instance initialized with different loop"
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/rest/rest_connector.py", line 150, in run
    self.__run_server()
  File "/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/rest/rest_connector.py", line 143, in __run_server
    web.run_app(self._app, host=self.__config['host'], port=self.__config['port'], handle_signals=False,
  File "/var/lib/thingsboard_gateway/.local/lib/python3.8/site-packages/aiohttp/web.py", line 514, in run_app
    loop.run_until_complete(main_task)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/var/lib/thingsboard_gateway/.local/lib/python3.8/site-packages/aiohttp/web.py", line 321, in _run_app
    await runner.setup()
  File "/var/lib/thingsboard_gateway/.local/lib/python3.8/site-packages/aiohttp/web_runner.py", line 279, in setup
    self._server = await self._make_server()
  File "/var/lib/thingsboard_gateway/.local/lib/python3.8/site-packages/aiohttp/web_runner.py", line 373, in _make_server
    self._app._set_loop(loop)
  File "/var/lib/thingsboard_gateway/.local/lib/python3.8/site-packages/aiohttp/web_app.py", line 223, in _set_loop
    raise RuntimeError(
RuntimeError: web.Application instance initialized with different loop

我已经在 Ubuntu 安装和 Docker 容器上尝试过这个,我得到了相同的结果。关于为什么这不起作用的任何想法?

这是 aiohttp 的问题,它已经在 master 分支中修复。 可以使用网关仓库master分支的版本,也可以等下个版本发布。