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

TGW in Docker mode on a Synology DS220+ DSM6. #11

Open
Didier3L opened this issue Feb 16, 2024 · 0 comments
Open

TGW in Docker mode on a Synology DS220+ DSM6. #11

Didier3L opened this issue Feb 16, 2024 · 0 comments

Comments

@Didier3L
Copy link

Good morning

I installed TGW in Docker mode on a Synology DS220+ DSM6.

Here is my docker-compose

# docker-compose.yaml
version: '3.1'

services:
  theengsgateway:
    image: maretodoric/theengsgateway-amd64:latest
    container_name: theengs-gateway
    network_mode: host
    tty: true
    privileged: true
    cap_add:
      - SYS_PTRACE 
      - SYS_ADMIN
      - NET_ADMIN 
    environment:
      MQTT_HOST: 192.168.1.241
#      MQTT_USERNAME: <username>
#      MQTT_PASSWORD: <password>
      MQTT_PUB_TOPIC: home/tgwsyno/BTtoMQTT
      MQTT_SUB_TOPIC: home/+/BTtoMQTT/undecoded
      LWT_TOPIC: tgw/tgwsyno/LWT
      PUBLISH_ALL: 1
      TIME_BETWEEN: 60
      SCAN_TIME: 60
      LOG_LEVEL: DEBUG
      DISCOVERY_TOPIC: homeassistant
      DISCOVERY_DEVICE_NAME: tgwsyno
      DISCOVERY_FILTER: "[IBEACON,GAEN,MS-CDP]"
      SCANNING_MODE: active
      ADAPTER: hci0
      PUID: 1032
      PGID: 101
    volumes:
      - /var/run/dbus:/var/run/dbus

I connected inside the container to execute the commands

pip3 install TheengsGateway

root@Serveur:/# python3 -m TheengsGateway -h
/usr/local/bin/python3: No module named TheengsGateway
root@Serveur-Ho37:/# pip3 install TheengsGateway
Collecting TheengsGateway
  Downloading TheengsGateway-1.4.0.tar.gz (529 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 529.7/529.7 KB 2.8 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting importlib-metadata
  Downloading importlib_metadata-7.0.1-py3-none-any.whl (23 kB)
Collecting paho-mqtt<3.0.0,>=2.0.0
  Downloading paho_mqtt-2.0.0-py3-none-any.whl (66 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.9/66.9 KB 165.6 kB/s eta 0:00:00
Collecting bleak>=0.19.0
  Downloading bleak-0.21.1-py3-none-any.whl (137 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 137.8/137.8 KB 654.4 kB/s eta 0:00:00
Collecting bluetooth-numbers<2.0,>=1.0
  Downloading bluetooth_numbers-1.1.1-py3-none-any.whl (474 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 474.1/474.1 KB 2.5 MB/s eta 0:00:00
Collecting pycryptodomex>=3.18.0
  Downloading pycryptodomex-3.20.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 15.0 MB/s eta 0:00:00
Collecting bluetooth-clocks<1.0
  Downloading bluetooth_clocks-0.2.0-py3-none-any.whl (20 kB)
Collecting TheengsDecoder>=1.7.0
  Downloading TheengsDecoder-1.7.0.tar.gz (296 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 296.8/296.8 KB 5.2 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting bluetooth-adapters>=0.15.3
  Downloading bluetooth_adapters-0.17.0-py3-none-any.whl (19 kB)
Collecting async-timeout<5,>=3.0.0
  Downloading async_timeout-4.0.3-py3-none-any.whl (5.7 kB)
Collecting typing-extensions>=4.7.0
  Using cached typing_extensions-4.9.0-py3-none-any.whl (32 kB)
Collecting dbus-fast<3,>=1.83.0
  Downloading dbus_fast-2.21.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.0/5.0 MB 5.3 MB/s eta 0:00:00
Collecting aiohttp>=3.8.1
  Downloading aiohttp-3.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 9.2 MB/s eta 0:00:00
Collecting mac-vendor-lookup>=0.1.12
  Downloading mac_vendor_lookup-0.1.12-py3-none-any.whl (350 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 350.3/350.3 KB 3.7 MB/s eta 0:00:00
Collecting usb-devices>=0.4.5
  Downloading usb_devices-0.4.5-py3-none-any.whl (5.3 kB)
Collecting zipp>=0.5
  Downloading zipp-3.17.0-py3-none-any.whl (7.4 kB)
Collecting frozenlist>=1.1.1
  Downloading frozenlist-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (240 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 240.7/240.7 KB 2.1 MB/s eta 0:00:00
Collecting attrs>=17.3.0
  Downloading attrs-23.2.0-py3-none-any.whl (60 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.8/60.8 KB 892.9 kB/s eta 0:00:00
Collecting aiosignal>=1.1.2
  Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting yarl<2.0,>=1.0
  Downloading yarl-1.9.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (304 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 304.3/304.3 KB 5.3 MB/s eta 0:00:00
Collecting multidict<7.0,>=4.5
  Downloading multidict-6.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (123 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 123.8/123.8 KB 822.6 kB/s eta 0:00:00
Collecting aiofiles
  Downloading aiofiles-23.2.1-py3-none-any.whl (15 kB)
Collecting idna>=2.0
  Downloading idna-3.6-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.6/61.6 KB 389.8 kB/s eta 0:00:00
Building wheels for collected packages: TheengsGateway, TheengsDecoder
  Building wheel for TheengsGateway (pyproject.toml) ... done
  Created wheel for TheengsGateway: filename=TheengsGateway-1.4.0-py3-none-any.whl size=33011 sha256=93802e269756fb9070d9513d11669bb2bbe417da9d7833494bc4ccf4efd147a2
  Stored in directory: /root/.cache/pip/wheels/93/2e/ff/aba517177465dba45a5b2c383c22d8ed547339939c4b9b90da
  Building wheel for TheengsDecoder (pyproject.toml) ... done
  Created wheel for TheengsDecoder: filename=TheengsDecoder-1.7.0-cp39-cp39-linux_x86_64.whl size=63150 sha256=469998fd0d92fb7a27ed3c070d18484f146468cc1ec13bcbc65f9027ffd1e0fe
  Stored in directory: /root/.cache/pip/wheels/17/e6/e5/e55c3512ebdf8a793a2bb3cc9dee21338c1e492f6a5cad3da6
Successfully built TheengsGateway TheengsDecoder
Installing collected packages: TheengsDecoder, zipp, usb-devices, typing-extensions, pycryptodomex, paho-mqtt, multidict, idna, frozenlist, dbus-fast, bluetooth-numbers, attrs, async-timeout, aiofiles, yarl, importlib-metadata, bleak, aiosignal, bluetooth-clocks, aiohttp, mac-vendor-lookup, bluetooth-adapters, TheengsGateway
Successfully installed TheengsDecoder-1.7.0 TheengsGateway-1.4.0 aiofiles-23.2.1 aiohttp-3.9.3 aiosignal-1.3.1 async-timeout-4.0.3 attrs-23.2.0 bleak-0.21.1 bluetooth-adapters-0.17.0 bluetooth-clocks-0.2.0 bluetooth-numbers-1.1.1 dbus-fast-2.21.1 frozenlist-1.4.1 idna-3.6 importlib-metadata-7.0.1 mac-vendor-lookup-0.1.12 multidict-6.0.5 paho-mqtt-2.0.0 pycryptodomex-3.20.0 typing-extensions-4.9.0 usb-devices-0.4.5 yarl-1.9.4 zipp-3.17.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 22.0.4; however, version 24.0 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.

python3 -m TheengsGateway -a hci0

An error occurs

root@Serveur:/# python3 -m TheengsGateway -a hci0
# Theengs Gateway Diagnostics

## Package Versions

| Name               | Value  |
|--------------------|--------|
| Theengs Gateway    | 1.4.0  |
| Theengs Decoder    | 1.7.0  |
| Bleak              | 0.21.1 |
| Bluetooth Clocks   | 0.2.0  |
| Bluetooth Numbers  | 1.1.1  |
| Paho MQTT          | 2.0.0  |
| Bluetooth Adapters | 0.17.0 |

## Python

| Name           | Value                  |
|----------------|------------------------|
| Version        | 3.9.14                 |
| Implementation | CPython                |
| Compiler       | GCC 10.2.1 20210110    |
| Executable     | /usr/local/bin/python3 |

## Operating System

| Name         | Value                                           |
|--------------|-------------------------------------------------|
| System       | Linux                                           |
| Release      | 4.4.59+                                         |
| Version      | #25556 SMP PREEMPT Tue Mar 21 22:25:44 CST 2023 |
| Machine type | x86_64                                          |

## Configuration

File: /root/theengsgw.conf

{
    "adapter": "hci0",
    "bindkeys": {},
    "ble": 1,
    "ble_scan_time": 60,
    "ble_time_between_scans": 60,
    "discovery": true,
    "discovery_device_name": "tgwsyno",
    "discovery_filter": "[IBEACON,GAEN,MS-CDP]",
    "discovery_topic": "homeassistant",
    "enable_tls": 0,
    "enable_websocket": 0,
    "general_presence": 0,
    "hass_discovery": 1,
    "host": "192.168.1.241",
    "identities": {},
    "log_level": "DEBUG",
    "lwt_topic": "home/TheengsGateway/LWT",
    "pass": "***",
    "port": 1883,
    "presence": 0,
    "presence_topic": "home/TheengsGateway/presence",
    "publish_advdata": 0,
    "publish_all": true,
    "publish_topic": "home/tgwsyno/BTtoMQTT",
    "scanning_mode": "active",
    "subscribe_topic": "home/+/BTtoMQTT/undecoded",
    "time_format": 0,
    "time_sync": [],
    "tracker_timeout": 120,
    "user": "***"
}

## Bluetooth adapters

Default adapter: hci0

### hci0

| Name         | Value                   |
|--------------|-------------------------|
| address      | 00:01:95:XX:XX:XX       |
| sw_version   | Unknown                 |
| hw_version   | None                    |
| passive_scan | False                   |
| manufacturer | Sena Technologies, Inc. |
| product      | None                    |
| vendor_id    | None                    |
| product_id   | None                    |

INFO:BLEGateway:Starting BLE scan
INFO:BLEGateway:Connected to MQTT broker
INFO:BLEGateway:Subscribed to home/+/BTtoMQTT/undecoded
ERROR:BLEGateway:[org.freedesktop.DBus.Error.UnknownMethod] Method "GetManagedObjects" with signature "" on interface "org.freedesktop.DBus.ObjectManager" doesn't exist

We also notice that the installation did not take into account the parameters of my docker-compose

"lwt_topic": "home/TheengsGateway/LWT", vs LWT_TOPIC: tgw/tgwsyno/LWT

MQTT EXPLORER confirms the presence of my antenna online

image

But I don't have any information about my equipment

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

No branches or pull requests

1 participant