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.75k stars 845 forks source link

[HELP] #525

Closed GretiCani closed 3 years ago

GretiCani commented 3 years ago

I'm facing issues with request connector When I run Tb_gateway I'm getting error 208 ""2021-06-01 14:30:36" - ERROR - [request_connector.py] - request_connector - 208 - Timeout error on request http://192.168.1.43:8089/getdata." ""2021-06-01 14:30:46" - ERROR - [request_connector.py] - request_connector - 208 - Timeout error on request http://192.168.1.43:8089/getdata." ""2021-06-01 14:30:56" - ERROR - [request_connector.py] - request_connector - 208 - Timeout error on request http://192.168.1.43:8089/getdata." ""2021-06-01 14:31:06" - ERROR - [request_connector.py] - request_connector - 208 - Timeout error on request http://192.168.1.43:8089/getdata."

Response from api is {"serial":"serialNR","developer":"devname"}. I am using docker tb_gateway.

Configuration

{ "host": "http://192.168.1.43:8089", "SSLVerify": true, "security": { "type": "anonymous" }, "mapping": [ { "url": "getdata", "httpMethod": "GET", "httpHeaders": { "ACCEPT": "application/json" }, "allowRedirects": true, "timeout": 5, "scanPeriod": 10, "converter": { "type": "json", "deviceNameJsonExpression": "SD8500", "deviceTypeJsonExpression": "SD", "attributes": [ { "key": "serialNumber", "type": "string", "value": "${serial}" } ], "telemetry": [ { "key": "Maintainer", "type": "string", "value": "${developer}" } ] } } .... .... Notate: Remove Access token from file if you wanna attach tb_gateway.yaml

thingsboard: host: 53.178.89.216 port: 2883 remoteShell: true remoteConfiguration: true security: accessToken: token*** qos: 1 storage: type: memory read_records_count: 100 max_records_count: 100000 connectors:

name: REQUEST Connector
type: request
configuration: request.json

Versions (please complete the following information):

samson0v commented 3 years ago

Hi GretiCani, make sure that your docker daemon can ping your HTTP server (192.168.1.43:8089). If it can, then make sure that docker mounts the right config file, for that use the next command:

docker exec -it <container-name> bash
cat thingsboard_gateway/config/request.json