theengs / gateway

Multi platform Multi devices BLE Bluetooth to MQTT gateway leveraging Theengs Decoder
https://gateway.theengs.io
GNU General Public License v3.0
109 stars 31 forks source link

Bug Install #90

Open Sonic62 opened 1 year ago

Sonic62 commented 1 year ago

Hello J'ai installe en docker la passerelle, mais lors d'un reboot, elle se relance pas toute seul je suis obligé de faire ceci pour qu'elle redémarre:

root@docker:~# sudo docker run --rm --network host -e MQTT_HOST=192.168.2.165 -v /var/run/dbus:/var/run/dbus --name TheengsGateway theengs/gateway

J'ai cru comprendre que la passerelle démarre je dois faire ceci

sudo pip3 install TheengsGateway

puis

Then create this systemd service script in /etc/systemd/system/TheengsGateway.service: et finir par

[Unit]
Description=Theengs Gateway
After=network.target
[Service]
Restart=always
Type=simple
ExecStart=/usr/bin/python3 -m TheengsGateway -H host -u user -p password

[Install]
WantedBy=multi-user.target

sauf que quand je lance la commande sudo pip3 install TheengsGateway

J'ai l'erreur suivante

___ _ _ _ ____ ____ / _ \ __| |_ __ ___ (_) __| | / ___|___ \ | | | |/ _ | '/ | |/ ` | | | ) | | || | (| | | | () | | (| | | |_ / _/ \/ _,|_| _/||_,_| _||

Welcome to Armbian Buster with Linux 6.0.13-meson64

System load: 0.20 0.23 0.24 Up time: 1 day Memory usage: 34 % of 1931MB IP: 172.18.0.1 192.168.2.165 CPU temp: 30°C Usage of /: 15% of 29G

[ General system configuration (beta): armbian-config ]

Last login: Thu Jan 19 20:59:41 2023 from 192.168.2.2

root@docker:~# sudo pip3 install TheengsGateway

Collecting TheengsGateway Downloading https://files.pythonhosted.org/packages/1f/7c/53289b5bbd2b6bbc8945 0848d0618a0215b0bd5e0bfab2912f7e2ade0ae5/TheengsGateway-0.7.0.tar.gz (134kB) 100% |████████████████████████████████| 143kB 1.9MB/s Installing build dependencies ... error Complete output from command /usr/bin/python3 -m pip install --ignore-installe d --no-user --prefix /tmp/pip-build-env-zn0x1l9m --no-warn-script-location --no- binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools cmak e wheel scikit-build ninja: Collecting setuptools Downloading https://files.pythonhosted.org/packages/bd/ef/76cffd20061a0c6512 dad4ba3537314904c6350738b99526c2f48992ff58/setuptools-66.0.0-py3-none-any.whl (1 .3MB) Collecting cmake Downloading https://files.pythonhosted.org/packages/e9/67/3d545c3a706bc427b1 bd2a9108e3986dfc8c1450be0da8149fe591902875/cmake-3.25.0.tar.gz Installing build dependencies: started Installing build dependencies: finished with status 'done' Collecting wheel Using cached https://files.pythonhosted.org/packages/bd/7c/d38a0b30ce22fc26e d7dbc087c6d00851fb3395e9d0dac40bec1f905030c/wheel-0.38.4-py3-none-any.whl Collecting scikit-build Using cached https://files.pythonhosted.org/packages/09/3e/e92b856e9c19a732b 915a63b7023775ad31aede0d7473c79cdea844979d1/scikit_build-0.16.5-py3-none-any.whl Collecting ninja Downloading https://files.pythonhosted.org/packages/f7/69/938374c8ebfeda6838 63b22e936f5d465ac9f5bf42be238504c018123190/ninja-1.11.1.tar.gz Installing build dependencies: started Installing build dependencies: finished with status 'done' Collecting distro (from scikit-build) Using cached https://files.pythonhosted.org/packages/f4/2c/c90a3adaf0ddb70af e193f5ebfb539612af57cffe677c3126be533df3098/distro-1.8.0-py3-none-any.whl Collecting typing-extensions>=3.7; python_version < "3.8" (from scikit-build) Using cached https://files.pythonhosted.org/packages/0b/8e/f1a0a5a76cfef77e1 eb6004cb49e5f8d72634da638420b9ea492ce8305e8/typing_extensions-4.4.0-py3-none-any .whl Collecting packaging (from scikit-build) Using cached https://files.pythonhosted.org/packages/ed/35/a31aed2993e398f6b 09a790a181a7927eb14610ee8bbf02dc14d31677f1c/packaging-23.0-py3-none-any.whl Building wheels for collected packages: cmake, ninja Running setup.py bdist_wheel for cmake: started Running setup.py bdist_wheel for cmake: finished with status 'error' Complete output from command /usr/bin/python3 -u -c "import setuptools, toke nize;file='/tmp/pip-install-1itenkc8/cmake/setup.py';f=getattr(tokenize, 'op en', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile( code, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-aplg85at --python-tag cp 37: Traceback (most recent call last): File "/tmp/pip-build-env-n2b8y5p7/lib/python3.7/site-packages/skbuild/setu ptools_wrap.py", line 617, in setup cmkr = cmaker.CMaker(cmake_executable) File "/tmp/pip-build-env-n2b8y5p7/lib/python3.7/site-packages/skbuild/cmak er.py", line 151, in init self.cmake_version = get_cmake_version(self.cmake_executable) File "/tmp/pip-build-env-n2b8y5p7/lib/python3.7/site-packages/skbuild/cmak er.py", line 108, in get_cmake_version ) from err

    =============================DEBUG ASSISTANCE===========================                                                                                                                     ==
    If you are seeing a compilation error please try the following steps to
    successfully install cmake:
    1) Upgrade to the latest pip and try again. This will fix errors for mos                                                                                                                     t
       users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
    2) If on Linux, with glibc < 2.12, you can set PIP_ONLY_BINARY=cmake in
       order to retrieve the last manylinux1 compatible wheel.
    3) If on Linux, with glibc < 2.12, you can cap "cmake<3.23" in your
       requirements in order to retrieve the last manylinux1 compatible whee                                                                                                                     l.
    4) Open an issue with the debug information that follows at
       https://github.com/scikit-build/cmake-python-distributions/issues

    Python: 3.7.3
    platform: Linux-6.0.13-meson64-aarch64-with-debian-10.13
    glibc: glibc 2.28
    machine: aarch64
    bits: 64
    pip: 18.1
    setuptools: 66.0.0
    scikit-build: 0.16.5
    =============================DEBUG ASSISTANCE===========================                                                                                                                     ==

Problem with the CMake installation, aborting build. CMake executable is cma                                                                                                                     ke

----------------------------------------
Failed building wheel for cmake
Running setup.py clean for cmake
Running setup.py bdist_wheel for ninja: started
Running setup.py bdist_wheel for ninja: finished with status 'error'
Complete output from command /usr/bin/python3 -u -c "import setuptools, toke                                                                                                                     nize;__file__='/tmp/pip-install-1itenkc8/ninja/setup.py';f=getattr(tokenize, 'op                                                                                                                     en', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(                                                                                                                     code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-jr836sb3 --python-tag cp                                                                                                                     37:
Traceback (most recent call last):
  File "/tmp/pip-build-env-dwq04nok/lib/python3.7/site-packages/skbuild/setu                                                                                                                     ptools_wrap.py", line 617, in setup
    cmkr = cmaker.CMaker(cmake_executable)
  File "/tmp/pip-build-env-dwq04nok/lib/python3.7/site-packages/skbuild/cmak                                                                                                                     er.py", line 151, in __init__
    self.cmake_version = get_cmake_version(self.cmake_executable)
  File "/tmp/pip-build-env-dwq04nok/lib/python3.7/site-packages/skbuild/cmak                                                                                                                     er.py", line 108, in get_cmake_version
    ) from err

Problem with the CMake installation, aborting build. CMake executable is cma                                                                                                                     ke

----------------------------------------
Failed building wheel for ninja
Running setup.py clean for ninja

Failed to build cmake ninja Installing collected packages: setuptools, cmake, wheel, distro, typing-extens ions, packaging, scikit-build, ninja Running setup.py install for cmake: started Running setup.py install for cmake: finished with status 'error' Complete output from command /usr/bin/python3 -u -c "import setuptools, to kenize;file='/tmp/pip-install-1itenkc8/cmake/setup.py';f=getattr(tokenize, ' open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compil e(code, file, 'exec'))" install --record /tmp/pip-record-mj8jzmg5/install-re cord.txt --single-version-externally-managed --prefix /tmp/pip-build-env-zn0x1l9 m --compile: /tmp/pip-build-env-n2b8y5p7/lib/python3.7/site-packages/setuptools/command /install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Us e build and pip and other standards-based tools. setuptools.SetuptoolsDeprecationWarning, Traceback (most recent call last): File "/tmp/pip-build-env-n2b8y5p7/lib/python3.7/site-packages/skbuild/se tuptools_wrap.py", line 617, in setup cmkr = cmaker.CMaker(cmake_executable) File "/tmp/pip-build-env-n2b8y5p7/lib/python3.7/site-packages/skbuild/cm aker.py", line 151, in init self.cmake_version = get_cmake_version(self.cmake_executable) File "/tmp/pip-build-env-n2b8y5p7/lib/python3.7/site-packages/skbuild/cm aker.py", line 108, in get_cmake_version ) from err

      =============================DEBUG ASSISTANCE=========================                                                                                                                     ====
      If you are seeing a compilation error please try the following steps t                                                                                                                     o
      successfully install cmake:
      1) Upgrade to the latest pip and try again. This will fix errors for m                                                                                                                     ost
         users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
      2) If on Linux, with glibc < 2.12, you can set PIP_ONLY_BINARY=cmake i                                                                                                                     n
         order to retrieve the last manylinux1 compatible wheel.
      3) If on Linux, with glibc < 2.12, you can cap "cmake<3.23" in your
         requirements in order to retrieve the last manylinux1 compatible wh                                                                                                                     eel.
      4) Open an issue with the debug information that follows at
         https://github.com/scikit-build/cmake-python-distributions/issues

      Python: 3.7.3
      platform: Linux-6.0.13-meson64-aarch64-with-debian-10.13
      glibc: glibc 2.28
      machine: aarch64
      bits: 64
      pip: 18.1
      setuptools: 66.0.0
      scikit-build: 0.16.5
      =============================DEBUG ASSISTANCE=========================                                                                                                                     ====

  Problem with the CMake installation, aborting build. CMake executable is c                                                                                                                     make

  ----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pi p-install-1itenkc8/cmake/setup.py';f=getattr(tokenize, 'open', open)(file);c ode=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec' ))" install --record /tmp/pip-record-mj8jzmg5/install-record.txt --single-versio n-externally-managed --prefix /tmp/pip-build-env-zn0x1l9m --compile" failed with error code 1 in /tmp/pip-install-1itenkc8/cmake/


Command "/usr/bin/python3 -m pip install --ignore-installed --no-user --prefix / tmp/pip-build-env-zn0x1l9m --no-warn-script-location --no-binary :none: --only-b inary :none: -i https://pypi.org/simple -- setuptools cmake wheel scikit-build n inja" failed with error code 1 in None root@docker:~# root@docker:~# `

1technophile commented 1 year ago

Salut,

Le mieux serait de redemarrer le conteneur automatiquement si ca marche avec ton docker https://docs.docker.com/config/containers/start-containers-automatically/

Peux etre en ajoutant --restart unless-stopped a ta ligne de commande ?

Sonic62 commented 1 year ago

Re,

Alors j'ai fais une installe en dcoker comme ceci:

sudo docker run \ --network host \ -e MQTT_HOST=192.168.2.165 \ -e MQTT_USERNAME=docker \ -e MQTT_PASSWORD=docker \ -e MQTT_PUB_TOPIC=home/TheengsGateway/BTtoMQTT \ -e MQTT_SUB_TOPIC=home/TheengsGateway/commands \ -e PUBLISH_ALL=true \ -e TIME_BETWEEN=60 \ -e SCAN_TIME=60 \ -e LOG_LEVEL=DEBUG \ -e HASS_DISCOVERY=true \ -e DISCOVERY=true \ -e DISCOVERY_TOPIC=homeassistant/sensor \ -e DISCOVERY_DEVICE_NAME=TheengsGateway \ -e DISCOVERY_FILTER="[IBEACON,GAEN,MS-CDP]" \ -e SCANNING_MODE=active \ -e ADAPTER=hci0 \ -v /var/run/dbus:/var/run/dbus \ --name TheengsGateway \ theengs/gateway

Que j'au corrigé en supprimant "-- RM" et corrigé la ligne
-e SCANNING_MODE=active

car elle contiens une erreur , et donc installe impossible.

Une fois l'installe faite le conteneur de Theegs, fonctionne quelque minutes et arrête de fonctionné .

J'ai beau choisir Never Always On Failure Unless Stopped

mais rien ne change

1technophile commented 1 year ago

Tu as quoi dans les logs quand il s'arrête si tu mets en verbose ?

Sonic62 commented 1 year ago

J'ai pas encore regardé , je vais regardé , si je fais pas attention voila ce qui ce passe Capture d’écran 2023-01-21 004930