Giter Club home page Giter Club logo

Comments (12)

Bluscream avatar Bluscream commented on September 22, 2024 2

New command in docker-compose without setcap:
'bash' '-c' 'venv/bin/python -m mqtt_io /config.yml'

Log without setcap:

Collecting RPi.GPIO
  Downloading RPi.GPIO-0.7.1.tar.gz (29 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: RPi.GPIO
  Building wheel for RPi.GPIO (setup.py): started
  Building wheel for RPi.GPIO (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-3.8
      creating build/lib.linux-armv7l-3.8/RPi
      copying RPi/__init__.py -> build/lib.linux-armv7l-3.8/RPi
      creating build/lib.linux-armv7l-3.8/RPi/GPIO
      copying RPi/GPIO/__init__.py -> build/lib.linux-armv7l-3.8/RPi/GPIO
      running build_ext
      building 'RPi._GPIO' extension
      creating build/temp.linux-armv7l-3.8
      creating build/temp.linux-armv7l-3.8/source
      gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/mqtt_io/venv/include -I/usr/local/include/python3.8 -c source/py_gpio.c -o build/temp.linux-armv7l-3.8/source/py_gpio.o
      unable to execute 'gcc': No such file or directory
      error: command 'gcc' failed with exit status 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for RPi.GPIO
  Running setup.py clean for RPi.GPIO
Failed to build RPi.GPIO
ERROR: Could not build wheels for RPi.GPIO, which is required to install pyproject.toml-based projects
2024-03-06 22:17:41 mqtt_io.__main__ [ERROR] MqttIo crashed!
Traceback (most recent call last):
  File "/home/mqtt_io/mqtt_io/modules/__init__.py", line 51, in install_missing_module_requirements
    install_missing_requirements(pkgs_required)
  File "/home/mqtt_io/mqtt_io/modules/__init__.py", line 22, in install_missing_requirements
    check_call([sys.executable, "-m", "pip", "install"] + pkgs_required)
  File "/usr/local/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/mqtt_io/venv/bin/python', '-m', 'pip', 'install', 'RPi.GPIO']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/home/mqtt_io/mqtt_io/__main__.py", line 107, in main
    mqtt_gpio.run()
  File "/home/mqtt_io/mqtt_io/server.py", line 1447, in run
    self._init_gpio_modules()
  File "/home/mqtt_io/mqtt_io/server.py", line 273, in _init_gpio_modules
    self.gpio_modules[gpio_config["name"]] = _init_module(
  File "/home/mqtt_io/mqtt_io/server.py", line 127, in _init_module
    install_missing_module_requirements(module)
  File "/home/mqtt_io/mqtt_io/modules/__init__.py", line 53, in install_missing_module_requirements
    raise CannotInstallModuleRequirements(
mqtt_io.exceptions.CannotInstallModuleRequirements: Unable to install packages for module <module 'mqtt_io.modules.gpio.raspberrypi' from '/home/mqtt_io/mqtt_io/modules/gpio/raspberrypi.py'> (['RPi.GPIO']): Command '['/home/mqtt_io/venv/bin/python', '-m', 'pip', 'install', 'RPi.GPIO']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/home/mqtt_io/mqtt_io/modules/__init__.py", line 51, in install_missing_module_requirements
    install_missing_requirements(pkgs_required)
  File "/home/mqtt_io/mqtt_io/modules/__init__.py", line 22, in install_missing_requirements
    check_call([sys.executable, "-m", "pip", "install"] + pkgs_required)
  File "/usr/local/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/mqtt_io/venv/bin/python', '-m', 'pip', 'install', 'RPi.GPIO']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/mqtt_io/mqtt_io/__main__.py", line 115, in <module>
    main()
  File "/home/mqtt_io/mqtt_io/__main__.py", line 107, in main
    mqtt_gpio.run()
  File "/home/mqtt_io/mqtt_io/server.py", line 1447, in run
    self._init_gpio_modules()
  File "/home/mqtt_io/mqtt_io/server.py", line 273, in _init_gpio_modules
    self.gpio_modules[gpio_config["name"]] = _init_module(
  File "/home/mqtt_io/mqtt_io/server.py", line 127, in _init_module
    install_missing_module_requirements(module)
  File "/home/mqtt_io/mqtt_io/modules/__init__.py", line 53, in install_missing_module_requirements
    raise CannotInstallModuleRequirements(
mqtt_io.exceptions.CannotInstallModuleRequirements: Unable to install packages for module <module 'mqtt_io.modules.gpio.raspberrypi' from '/home/mqtt_io/mqtt_io/modules/gpio/raspberrypi.py'> (['RPi.GPIO']): Command '['/home/mqtt_io/venv/bin/python', '-m', 'pip', 'install', 'RPi.GPIO']' returned non-zero exit status 1.

from mqtt-io.

chuxubank avatar chuxubank commented on September 22, 2024 2

Same error here

from mqtt-io.

BenjiU avatar BenjiU commented on September 22, 2024

Hi @Bluscream,

have you been on a normal PC in the while? :-D Can you provide more information, please?
I don't have the setup here for reproduction.

Thanks
Benni

from mqtt-io.

Bluscream avatar Bluscream commented on September 22, 2024

original docker-compose with setcap:

version: '3'
services:
  mqtt-io:
    privileged: true
    user: root
    image: flyte/mqtt-io
    ports:
     - "443:443"
     - "1883:1883"
     - "8883:8883"
     - "14567:14567"
    volumes:
      - type: bind
        source: /portainer/Files/AppData/Config/mqtt-io/config.yml
        target: /config.yml
        read_only: true
      - /dev/i2c-0:/dev/i2c-0
      - /dev/mem:/dev/mem
      - /dev/gpiomem:/dev/gpiomem
    devices:
      - /dev/i2c-0
      - /dev/mem
      - /dev/gpiomem
    command: >
      bash -c "setcap 'cap_sys_rawio+eip' $(readlink -f venv/bin/python) && venv/bin/python -m mqtt_io /config.yml"
    network_mode: host

logs:

from mqtt-io.

TBobsin avatar TBobsin commented on September 22, 2024

Hello,
i have the same Problem on Raspberry 4 with Debian 12 and Docker setup as described.
The previous Version was fine.

The same problem is on the Homeassistant Plugin which belongs to this project.
Look at this Issue RuntimeError: This module can only be run on a Raspberry Pi!

from mqtt-io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.