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

[HELP] I cannot connect gateway to thingsboard over getting started guide #1303

Closed
vadoster opened this issue Feb 20, 2024 · 2 comments
Closed
Assignees

Comments

@vadoster
Copy link

Describe the issue
Create description about your issue, and your actions to solve it.

I have some issue when I started gateway over local installed thingsboard. Following this guide https://thingsboard.io/docs/iot-gateway/getting-started/ , I download docker-compose.yaml file, and started gateway by command "docker compose up" in teminal.
I have got the following error :

| 2024-02-20 08:54:31 - |ERROR| - [tb_client.py] - tb_client - run - 258 - timed out
tb-gateway  | Traceback (most recent call last):
tb-gateway  |   File "/thingsboard_gateway/gateway/tb_client.py", line 253, in run
tb-gateway  |     self.client.connect(keepalive=keep_alive,
tb-gateway  |   File "/usr/local/lib/python3.11/site-packages/tb_device_mqtt.py", line 254, in connect
tb-gateway  |     self._client.connect(self.__host, self.__port, keepalive=keepalive)
tb-gateway  |   File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 915, in connect
tb-gateway  |     return self.reconnect()
tb-gateway  |            ^^^^^^^^^^^^^^^^
tb-gateway  |   File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 1057, in reconnect
tb-gateway  |     sock = self._create_socket_connection()
tb-gateway  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tb-gateway  |   File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 3731, in _create_socket_connection
tb-gateway  |     return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
tb-gateway  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tb-gateway  |   File "/usr/local/lib/python3.11/socket.py", line 851, in create_connection
tb-gateway  |     raise exceptions[0]
tb-gateway  |   File "/usr/local/lib/python3.11/socket.py", line 836, in create_connection
tb-gateway  |     sock.connect(sa)
tb-gateway  | TimeoutError: timed out

Configuration
My configuration file:

version: '3.4'
services:
  # ThingsBoard IoT Gateway Service Configuration
  tb-gateway:
    image: thingsboard/tb-gateway
    container_name: tb-gateway
    restart: always

    # Ports bindings - required by some connectors
    ports:
        - "5000:5000" # Comment if you don't use REST connector and change if you use another port
        # Uncomment and modify the following ports based on connector usage:
#        - "1052:1052" # BACnet connector
#        - "5026:5026" # Modbus TCP connector (Modbus Slave)
#        - "50000:50000/tcp" # Socket connector with type TCP
#        - "50000:50000/udp" # Socket connector with type UDP

    # Necessary mapping for Linux
    extra_hosts:
      - "host.docker.internal:host-gateway"

    # Environment variables
    environment:
      - host=host.docker.internal
      - port=1883
      - accessToken=*****************

    # Volumes bind
    volumes:
      - tb-gw-config:/thingsboard_gateway/config
      - tb-gw-logs:/thingsboard_gateway/logs
      - tb-gw-extensions:/thingsboard_gateway/extensions

# Volumes declaration for configurations, extensions and configuration
volumes:
  tb-gw-config:
    name: tb-gw-config
  tb-gw-logs:
    name: tb-gw-logs
  tb-gw-extensions:
    name: tb-gw-extensions

Versions (please complete the following information):

  • OS: Ubuntu 22.04
  • Thingsboard IoT Gateway version 3.4.4
  • Python version: 3.10.12
Copy link

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

IOTGW-119

@vadoster
Copy link
Author

vadoster commented Feb 20, 2024

I have found the issue, it was an issue with my firewall.
I have disabled a firewall for testing purposes and it is working.

sudo ufw disable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants