thingsboard / thingsboard-gateway

Open-source IoT Gateway - integrates devices connected to legacy and third-party systems with ThingsBoard IoT Platform using Modbus, CAN bus, BACnet, BLE, OPC-UA, MQTT, ODBC and REST protocols
https://thingsboard.io/docs/iot-gateway/what-is-iot-gateway/
Apache License 2.0
1.76k stars 847 forks source link

[HELP] use MQTT v3.1.1 #1121

Closed andonoc closed 1 year ago

andonoc commented 1 year ago

Create description about your issue, and your actions to solve it. I try to connect tb-gateway to nodered. i installed the aedes mqtt broker node and it does not work. then i noticed that aedes supports only mqtt 3.1 and mqtt 3.1.1. In the documentation i did not find if tb-gateway supports these versions. in the mqtt.json file i changed version to 4, 3, 3.1 and 3.1.1 i have a fresh docker installation, connection to thingsboard on docker established

Versions (please complete the following information):

samson0v commented 1 year ago

Hi @andonoc, thanks for your interest in ThingsBoard IoT Gateway! Send, please, your config files (tb_gateway.yml, mqtt.json, and docker compose file).

andonoc commented 1 year ago

Hi, thank you i used the getting started docker guide from your website

docker run -it -v ~/.tb-gateway/logs:/thingsboard_gateway/logs -v ~/.tb-gateway/extensions:/thingsboard_gateway/extensions -v ~/.tb-gateway/config:/thingsboard_gateway/config --name tb-gateway --restart always thingsboard/tb-gateway
mqttnodered.json

{ "broker": { "name": "nr Broker", "host": "192.168.178.62", "port": 1883, "clientId": "Nodered", "version": 4, "maxMessageNumberPerWorker": 10, "maxNumberOfWorkers": 100, "security": { "type": "basic", "username": "blabla", "password": "blablabla" } }, "mapping": [ { "topicFilter": "application/+/device/+/event/up", "converter": { "type": "json", "deviceNameJsonExpression": "${deviceInfo.devEui}", "deviceTypeJsonExpression": "${deviceInfo.deviceProfileName}", "timeout": 60000, "attributes": [ { "type": "string", "key": "application_id", "value": "${deviceInfo.deviceProfileName}" } ], "timeseries": [ { "type": "double", "key": "temperature", "value": "${object.temperature}" }, { "type": "long", "key": "RSSI", "value": "${rxInfo[0].rssi}" }, { "type": "long", "key": "bandwidth", "value": "${txInfo.modulation.lora.bandwidth}" }, { "type": "long", "key": "spreading_factor", "value": "${txInfo.modulation.lora.bandwidth}" }, { "type": "long", "key": "snr", "value": "${rxInfo[0].snr}" }, { "type": "long", "key": "frequency", "value": "${rxInfo[0].snr}" } ] } } ], "connectRequests": [], "disconnectRequests": [], "attributeUpdates": [], "serverSideRpc": [] }

tb_gateway.yaml

```` thingsboard: host: 172.24.0.2 port: 1883 remoteShell: false remoteConfiguration: false statistics: enable: true statsSendPeriodInSeconds: 3600 #configuration: statistics.json maxPayloadSizeBytes: 1024 minPackSendDelayMS: 0 checkConnectorsConfigurationInSeconds: 60 handleDeviceRenaming: true checkingDeviceActivity: checkDeviceInactivity: false inactivityTimeoutSeconds: 120 inactivityCheckPeriodSeconds: 10 security: accessToken: blablabla qos: 1 storage: type: memory read_records_count: 100 max_records_count: 100000 # type: file # data_folder_path: ./data/ # max_file_count: 10 # max_read_records_count: 10 # max_records_per_file: 10000 # type: sqlite # data_file_path: ./data/data.db # messages_ttl_check_in_hours: 1 # messages_ttl_in_days: 7 grpc: enabled: false serverPort: 9595 keepaliveTimeMs: 10000 keepaliveTimeoutMs: 5000 keepalivePermitWithoutCalls: true maxPingsWithoutData: 0 minTimeBetweenPingsMs: 10000 minPingIntervalWithoutDataMs: 5000 connectors: - name: MQTT aedes Broker Connector type: mqtt configuration: mqttnodered.json # - # name: Modbus Connector # type: modbus # configuration: modbus.json # # - # name: Modbus Connector # type: modbus # configuration: modbus_serial.json # # - # name: OPC-UA Connector # type: opcua # configuration: opcua.json # # - # name: OPC-UA Connector # type: opcua_asyncio # configuration: opcua.json # # - # name: BLE Connector # type: ble # configuration: ble.json # # - # name: REQUEST Connector # type: request # configuration: request.json # # - # name: CAN Connector # type: can # configuration: can.json # # - # name: BACnet Connector # type: bacnet # configuration: bacnet.json # # - # name: ODBC Connector # type: odbc # configuration: odbc.json # # - # name: REST Connector # type: rest # configuration: rest.json # # - # name: SNMP Connector # type: snmp # configuration: snmp.json # # - # name: FTP Connector # type: ftp # configuration: ftp.json # # - # name: Socket TCP/UDP Connector # type: socket # configuration: socket.json # # - # name: XMPP Connector # type: xmpp # configuration: xmpp.json # # - # name: OCPP Connector # type: ocpp # configuration: ocpp.json # # ========= Customization ========== # # # - # name: Custom Serial Connector # type: serial # configuration: custom_serial.json # class: CustomSerialConnector # # - # name: GRPC Connector 1 # key: auto # type: grpc # configuration: grpc_connector_1.json ````

samson0v commented 1 year ago

@andonoc, please, replace all INFO with DEBUG log levels in logs.conf file and send the logs.

samson0v commented 1 year ago

Hi @andonoc, can we close the issue?