Closed Hkrie closed 2 years ago
Hi @Hkrie, I can't see from logs that you are using REST Connector, I see only MQTT Connector and it seems that you are using the wrong ThingsBoard Gateway token.
@samson0v well i did configure the rest connector though... I edited the rest.json that was by the updated tb_gateway.yaml. (The other config files where created automatically when installing thingsboard-gateway since they are not used in the tb_gateway.yaml i will delete them later on)
The token should be correct since i can connect with it using nodejs. I took the access token from here:
@samson0v Do you have a working example on github that i could see for reference? Maybe the folder structure that i got with the source installation (https://thingsboard.io/docs/iot-gateway/install/source-installation/) is malformed somehow or I got something wrong.
This is what I got after the installation:
I don't really know where to go from here since there is no step-by-step guide for this in the docs.
Hi @Hkrie,
Could you try to use IP address instead of thingsboard.demo.local, it may be the issue with dns resolving. Because we can see that the gateway receives a response with message connection FAIL with error 3 server unavailable
.
Do you can connect to ThingsBoard using any MQTT client?
@zbeacon i am using a vpn to access the thingsboard instance over vpn. I just used the ip address like you advised but the output seems to be the same. Did I maybe edit the wrong files?
I am starting the thingsboard gateway with the command: thingsboard-gateway
update: I can connect it via a node script (near the top of this issue). It works fine with both the domain name and the ip-address.
Do you have files in /etc/thingsboard-gateway/config ?
no. should i create those files (like descriped here: https://thingsboard.io/docs/iot-gateway/configuration/) next to the thingsboard-gateway folder that i currently have?
I assumed that i am supposed to edit the files near the tb_gateway.yaml that was updated by the configurator...
Yes, please move your config folder to /etc/thingsboard-gateway/ And then run thingsboard-gateway
where should i put the etc folder? [Option 1] parent-folder\thingsboard_gateway\etc
[Option 2] parent-folder\thingsboard_gateway\thingsboard_gateway\etc
[Option 3] parent-folder\etc
in Option 3: I get the following output:
root@LT000985:~/thingsboard/example-gateway# thingsboard-gateway
[STREAM ONLY] 2022-01-14 13:53:35,348 - ERROR - [mqtt_connector.py] - mqtt_connector - 142 - 'attributeRequests' section missing from configuration
[STREAM ONLY] 2022-01-14 13:53:35,349 - ERROR - [mqtt_connector.py] - mqtt_connector - 207 - [Errno 111] Connection refused
[STREAM ONLY] 2022-01-14 13:53:35,731 - ERROR - [tb_device_mqtt.py] - tb_device_mqtt - 146 - connection FAIL with error 3 server unavailable
[STREAM ONLY] 2022-01-14 13:53:35,732 - DEBUG - [tb_device_mqtt.py] - tb_device_mqtt - 123 - Disconnected client: <paho.mqtt.client.Client object at 0x7fc5fabbe5e0>, user data: None, result code: 0
[STREAM ONLY] 2022-01-14 13:53:45,360 - ERROR - [mqtt_connector.py] - mqtt_connector - 207 - [Errno 111] Connection refused
[STREAM ONLY] 2022-01-14 13:53:55,371 - ERROR - [mqtt_connector.py] - mqtt_connector - 207 - [Errno 111] Connection refused
[STREAM ONLY] 2022-01-14 13:54:05,381 - ERROR - [mqtt_connector.py] - mqtt_connector - 207 - [Errno 111] Connection refused
in Option 2 (in Option 1 the output is the same as here): If i put the etc folder where the config folder was before:
and run the command: /example-gateway/thingsboard-gateway# thingsboard-gateway
i get pretty much the same error like before: complete-command-line-output.txt
@zbeacon Does Thingsboard provide a barebone example-demo project where I could see the complete folder structure for a gateway?
@Hkrie ,
It looks like you have a daemon installation before, so please check folder /etc/thingsboard-gateway/config in your system, not in parent folder.
Hi @Hkrie, can we close the issue?
Describe the issue I try to connect to thingsboard and use the rest connector without success. I have a Thingsboard instance running on: http://thingsboard.demo.local/ and a rest-api-endpoint: http://localhost:8052/mmsp/status/systemStatus/get ==> These work correctly in browser.
I followed the installation guide: https://thingsboard.io/docs/iot-gateway/install/source-installation/ and configured the tb_gateway.yml using the tb-gateway-configurator: https://thingsboard.io/docs/iot-gateway/guides/how-to-configure-gateway-using-configurator/ After that I adjusted the rest.json.
To see that I can actually connect to the thingsboard and it's not a problem with my thingsboard instance I ran a simple node script:
Configuration (Attach your configuration file) tb_gateway.yaml
rest.json
Connector name (If you need help with some connector/converter): (REST Connector)
Error traceback (If it was raised): complete command line output:
complete-command-line-output.txt
Versions (please complete the following information):