Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Tester
    4. [Gelöst] CPU-Last & Temperatur von entferntem RasPi auslesen

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    [Gelöst] CPU-Last & Temperatur von entferntem RasPi auslesen

    This topic has been deleted. Only users with topic management privileges can see it.
    • NWH
      NWH last edited by NWH

      Ich wollte den Adapter RPI Monitor and GPIO installieren, leider kommt bei mir immer der Fehler:

      host.iobroker Cannot install iobroker.rpi2@2.2.1: 1
      
      ERROR: Process exited with code 25
      

      Ich gehe mal davon aus, dass das Problem meine Node.js Version ist. ( v20.18.0)
      Gibt es eine Möglichkeit diesen Adapter trotzdem zu installieren?

      Thomas Braun 1 Reply Last reply Reply Quote 0
      • Thomas Braun
        Thomas Braun Most Active @NWH last edited by Thomas Braun

        @nwh sagte in Test Adapter rpi2 2.x:

        Gibt es eine Möglichkeit diesen Adapter trotzdem zu installieren?

        iob stop
        iob fix
        iob start
        

        Dann nochmal probieren.
        Ansonsten wird mehr Input benötigt. Im Log steht mehr als 2 Zeilen drin.

        NWH 1 Reply Last reply Reply Quote 0
        • NWH
          NWH @Thomas Braun last edited by

          @thomas-braun
          Habe ich gemacht, leider nein.
          Mein IOB läuft in einem Container am Nas.

          $ iobroker add rpi2 auto --host iobroker --debug
          
          NPM version: 10.8.2Installing iobroker.rpi2@2.2.1... (System call)
          
          > iobroker.rpi2@2.2.1 preinstall> sudo apt-get install -y libgpiod-dev || exit 0sudo: unable to resolve host iobroker: Name or service not known
          
          Reading package lists...
          
          Building dependency tree...Reading state information...
          
          The following additional packages will be installed:
          
          libgpiod2
          
          Suggested packages: libgpiod-doc
          
          The following NEW packages will be installed:
          
          libgpiod-dev libgpiod2
          
          0 upgraded, 2 newly installed, 0 to remove and 29 not upgraded.Need to get 96,7 kB of archives.After this operation, 493 kB of additional disk space will be used.Get:1 http://deb.debian.org/debian bookworm/main amd64 libgpiod2 amd64 1.6.3-1+b3 [39,0 kB]
          
          Get:2 http://deb.debian.org/debian bookworm/main amd64 libgpiod-dev amd64 1.6.3-1+b3 [57,7 kB]
          
          debconf: unable to initialize frontend: Dialogdebconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78, <> line 2.)debconf: falling back to frontend: Readlinedebconf: unable to initialize frontend: Readlinedebconf: (This frontend requires a controlling tty.)debconf: falling back to frontend: Teletype
          
          dpkg-preconfigure: unable to re-open stdin:
          
          Fetched 96,7 kB in 0s (503 kB/s)Selecting previously unselected package libgpiod2:amd64.(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 30815 files and directories currently installed.)Preparing to unpack .../libgpiod2_1.6.3-1+b3_amd64.deb ...
          
          Unpacking libgpiod2:amd64 (1.6.3-1+b3) ...
          
          Selecting previously unselected package libgpiod-dev:amd64.
          
          Preparing to unpack .../libgpiod-dev_1.6.3-1+b3_amd64.deb ...
          
          Unpacking libgpiod-dev:amd64 (1.6.3-1+b3) ...
          
          Setting up libgpiod2:amd64 (1.6.3-1+b3) ...
          
          Setting up libgpiod-dev:amd64 (1.6.3-1+b3) ...
          
          Processing triggers for libc-bin (2.36-9+deb12u8) ...
          
          > node-dht-sensor@0.4.3 install> node-gyp configure
          
          gyp info it worked if it ends with ok
          
          gyp info using node-gyp@10.2.0
          
          gyp info using node@20.18.0 | linux | x64
          
          gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
          
          gyp info spawn /usr/bin/python3
          
          gyp info spawn args [gyp info spawn args '/opt/iobroker/node_modules/node-gyp/gyp/gyp_main.py',gyp info spawn args 'binding.gyp',gyp info spawn args '-f',gyp info spawn args 'make',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/node_modules/node-dht-sensor/build/config.gypi',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/node_modules/node-gyp/addon.gypi',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/.cache/node-gyp/20.18.0/include/node/common.gypi',gyp info spawn args '-Dlibrary=shared_library',gyp info spawn args '-Dvisibility=default',gyp info spawn args '-Dnode_root_dir=/opt/iobroker/.cache/node-gyp/20.18.0',gyp info spawn args '-Dnode_gyp_dir=/opt/iobroker/node_modules/node-gyp',gyp info spawn args '-Dnode_lib_file=/opt/iobroker/.cache/node-gyp/20.18.0/<(target_arch)/node.lib',gyp info spawn args '-Dmodule_root_dir=/opt/iobroker/node_modules/node-dht-sensor',gyp info spawn args '-Dnode_engine=v8',gyp info spawn args '--depth=.',gyp info spawn args '--no-parallel',gyp info spawn args '--generator-output',gyp info spawn args 'build',gyp info spawn args '-Goutput_dir=.'gyp info spawn args ]
          
          gyp info ok
          
          > opengpio@1.0.16 install> node-gyp rebuild
          
          gyp info it worked if it ends with ok
          
          gyp info using node@20.18.0 | linux | x64
          
          gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
          
          gyp info spawn /usr/bin/python3
          
          gyp info spawn args [gyp info spawn args '/opt/iobroker/node_modules/node-gyp/gyp/gyp_main.py',gyp info spawn args 'binding.gyp',gyp info spawn args '-f',gyp info spawn args 'make',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/node_modules/opengpio/build/config.gypi',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/node_modules/node-gyp/addon.gypi',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/.cache/node-gyp/20.18.0/include/node/common.gypi',gyp info spawn args '-Dlibrary=shared_library',gyp info spawn args '-Dvisibility=default',gyp info spawn args '-Dnode_root_dir=/opt/iobroker/.cache/node-gyp/20.18.0',gyp info spawn args '-Dnode_gyp_dir=/opt/iobroker/node_modules/node-gyp',gyp info spawn args '-Dnode_lib_file=/opt/iobroker/.cache/node-gyp/20.18.0/<(target_arch)/node.lib',gyp info spawn args '-Dmodule_root_dir=/opt/iobroker/node_modules/opengpio',gyp info spawn args '-Dnode_engine=v8',gyp info spawn args '--depth=.',gyp info spawn args '--no-parallel',gyp info spawn args '--generator-output',gyp info spawn args 'build',gyp info spawn args '-Goutput_dir=.'gyp info spawn args ]
          
          gyp info spawn make
          
          gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
          
          make: Entering directory '/opt/iobroker/node_modules/opengpio/build'
          
          CXX(target) Release/obj.target/opengpio/cpp/opengpio.o
          
          In file included from /opt/iobroker/node_modules/opengpio/node_modules/node-addon-api/napi.h:13, from ../cpp/opengpio.cpp:1:/opt/iobroker/.cache/node-gyp/20.18.0/include/node/node_api.h:83:54: fatal error: opening dependency file ./Release/.deps/Release/obj.target/opengpio/cpp/opengpio.o.d.raw: No such file or directory 83 | NAPI_MODULE_INIT() { return regfunc(env, exports); } | ^/opt/iobroker/node_modules/opengpio/node_modules/node-addon-api/napi-inl.h:355:3: note: in expansion of macro ‘NAPI_MODULE’../cpp/opengpio.cpp:374:1: note: in expansion of macro ‘NODE_API_MODULE’
          
          compilation terminated.
          
          make: *** [opengpio.target.mk:108: Release/obj.target/opengpio/cpp/opengpio.o] Error 1
          
          make: Leaving directory '/opt/iobroker/node_modules/opengpio/build'
          
          gyp ERR! UNCAUGHT EXCEPTION gyp ERR! stack Error: ENOENT: no such file or directory, lstat '/opt/iobroker/node_modules/opengpio/build/node_gyp_bins'gyp ERR! System Linux 4.4.302+gyp ERR! command "/usr/bin/node" "/opt/iobroker/node_modules/.bin/node-gyp" "rebuild"gyp ERR! cwd /opt/iobroker/node_modules/opengpiogyp ERR! node -v v20.18.0gyp ERR! node-gyp -v v10.2.0gyp ERR! Node-gyp failed to build your package.gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
          
          npm error code 7
          
          npm error path /opt/iobroker/node_modules/opengpio
          
          npm error command failednpm error command sh -c node-gyp rebuild
          
          npm error A complete log of this run can be found in: /opt/iobroker/.npm/_logs/2024-11-13T19_42_00_802Z-debug-0.log
          
          sudo: unable to resolve host iobroker: Name or service not knowndebconf: unable to initialize frontend: Dialogdebconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78, <> line 2.)debconf: falling back to frontend: Readlinedebconf: unable to initialize frontend: Readlinedebconf: (This frontend requires a controlling tty.)debconf: falling back to frontend: Teletypedpkg-preconfigure: unable to re-open stdin: gyp info it worked if it ends with okgyp info using node-gyp@10.2.0gyp info using node@20.18.0 | linux | x64gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"gyp info spawn /usr/bin/python3gyp info spawn args [gyp info spawn args '/opt/iobroker/node_modules/node-gyp/gyp/gyp_main.py',gyp info spawn args 'binding.gyp',gyp info spawn args '-f',gyp info spawn args 'make',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/node_modules/node-dht-sensor/build/config.gypi',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/node_modules/node-gyp/addon.gypi',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/.cache/node-gyp/20.18.0/include/node/common.gypi',gyp info spawn args '-Dlibrary=shared_library',gyp info spawn args '-Dvisibility=default',gyp info spawn args '-Dnode_root_dir=/opt/iobroker/.cache/node-gyp/20.18.0',gyp info spawn args '-Dnode_gyp_dir=/opt/iobroker/node_modules/node-gyp',gyp info spawn args '-Dnode_lib_file=/opt/iobroker/.cache/node-gyp/20.18.0/<(target_arch)/node.lib',gyp info spawn args '-Dmodule_root_dir=/opt/iobroker/node_modules/node-dht-sensor',gyp info spawn args '-Dnode_engine=v8',gyp info spawn args '--depth=.',gyp info spawn args '--no-parallel',gyp info spawn args '--generator-output',gyp info spawn args 'build',gyp info spawn args '-Goutput_dir=.'gyp info spawn args ]gyp info ok gyp info it worked if it ends with okgyp info using node-gyp@10.2.0gyp info using node@20.18.0 | linux | x64gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"gyp info spawn /usr/bin/python3gyp info spawn args [gyp info spawn args '/opt/iobroker/node_modules/node-gyp/gyp/gyp_main.py',gyp info spawn args 'binding.gyp',gyp info spawn args '-f',gyp info spawn args 'make',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/node_modules/opengpio/build/config.gypi',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/node_modules/node-gyp/addon.gypi',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/.cache/node-gyp/20.18.0/include/node/common.gypi',gyp info spawn args '-Dlibrary=shared_library',gyp info spawn args '-Dvisibility=default',gyp info spawn args '-Dnode_root_dir=/opt/iobroker/.cache/node-gyp/20.18.0',gyp info spawn args '-Dnode_gyp_dir=/opt/iobroker/node_modules/node-gyp',gyp info spawn args '-Dnode_lib_file=/opt/iobroker/.cache/node-gyp/20.18.0/<(target_arch)/node.lib',gyp info spawn args '-Dmodule_root_dir=/opt/iobroker/node_modules/opengpio',gyp info spawn args '-Dnode_engine=v8',gyp info spawn args '--depth=.',gyp info spawn args '--no-parallel',gyp info spawn args '--generator-output',gyp info spawn args 'build',gyp info spawn args '-Goutput_dir=.'gyp info spawn args ]gyp info spawn makegyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]In file included from /opt/iobroker/node_modules/opengpio/node_modules/node-addon-api/napi.h:13, from ../cpp/opengpio.cpp:1:/opt/iobroker/.cache/node-gyp/20.18.0/include/node/node_api.h:83:54: fatal error: opening dependency file ./Release/.deps/Release/obj.target/opengpio/cpp/opengpio.o.d.raw: No such file or directory 83 | NAPI_MODULE_INIT() { return regfunc(env, exports); } | ^/opt/iobroker/node_modules/opengpio/node_modules/node-addon-api/napi-inl.h:355:3: note: in expansion of macro ‘NAPI_MODULE’../cpp/opengpio.cpp:374:1: note: in expansion of macro ‘NODE_API_MODULE’compilation terminated.make: *** [opengpio.target.mk:108: Release/obj.target/opengpio/cpp/opengpio.o] Error 1gyp ERR! UNCAUGHT EXCEPTION gyp ERR! stack Error: ENOENT: no such file or directory, lstat '/opt/iobroker/node_modules/opengpio/build/node_gyp_bins'gyp ERR! System Linux 4.4.302+gyp ERR! command "/usr/bin/node" "/opt/iobroker/node_modules/.bin/node-gyp" "rebuild"gyp ERR! cwd /opt/iobroker/node_modules/opengpiogyp ERR! node -v v20.18.0gyp ERR! node-gyp -v v10.2.0gyp ERR! Node-gyp failed to build your package.gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.npm error code 7npm error path /opt/iobroker/node_modules/opengpionpm error command failednpm error command sh -c node-gyp rebuildnpm error A complete log of this run can be found in: /opt/iobroker/.npm/_logs/2024-11-13T19_42_00_802Z-debug-0.loghost.iobroker Cannot install iobroker.rpi2@2.2.1: 7
          
          ERROR: Process exited with code 25
          

          Homoran Thomas Braun 2 Replies Last reply Reply Quote 0
          • Homoran
            Homoran Global Moderator Administrators @NWH last edited by

            @nwh sagte in Test Adapter rpi2 2.x:

            Mein IOB läuft in einem Container am Nas.

            und was soll da ein Adapter für den RaspberryPi bewirken?

            NWH 1 Reply Last reply Reply Quote 1
            • NWH
              NWH @Homoran last edited by

              @homoran
              Wofür ist den der Adapter?
              Man kann damit den Raspi auslesen, oder etwa nicht?
              Würde gerne CPU Last und Temp sehen.

              Homoran Thomas Braun 2 Replies Last reply Reply Quote 0
              • Thomas Braun
                Thomas Braun Most Active @NWH last edited by

                @nwh sagte in Test Adapter rpi2 2.x:

                Mein IOB läuft in einem Container am Nas.

                Der Code baut auf der Hardware wohl nicht.

                Man kann damit den Raspi auslesen, oder etwa nicht?

                Ja, aber der Adapter muss dazu auch auf einem Raspi laufen und nicht auf deinem NAS (mit steinaltem Kernel).

                1 Reply Last reply Reply Quote 1
                • Homoran
                  Homoran Global Moderator Administrators @NWH last edited by

                  @nwh sagte in Test Adapter rpi2 2.x:

                  Man kann damit den Raspi auslesen, oder etwa nicht?

                  aber nur wenn der Adapter auf dem Raspi läuft

                  @nwh sagte in Test Adapter rpi2 2.x:

                  Mein IOB läuft in einem Container am Nas.

                  sieht nicht danach aus

                  1 Reply Last reply Reply Quote 0
                  • Thomas Braun
                    Thomas Braun Most Active @NWH last edited by

                    @nwh sagte in Test Adapter rpi2 2.x:

                    Würde gerne CPU Last und Temp sehen.

                    Das würde ich per kleinem Skript machen.

                    NWH 1 Reply Last reply Reply Quote 0
                    • NWH
                      NWH @Thomas Braun last edited by

                      @thomas-braun @Homoran
                      Mein IOb läuft jetzt seit ca. 6 Jahren am Nas im Container und das eigentlich ohne Probleme.
                      Wenn mal was nicht ging, war immer ich Schuld.

                      Wie kann so ein Script aussehen? Kannst du mir hierbei helfen.

                      Homoran Thomas Braun 2 Replies Last reply Reply Quote 0
                      • Homoran
                        Homoran Global Moderator Administrators @NWH last edited by

                        @nwh sagte in Test Adapter rpi2 2.x:

                        Mein IOb läuft jetzt seit ca. 6 Jahren am Nas im Container und das eigentlich ohne Probleme.

                        das ist ja durchaus möglich und auch normal.
                        Aber jetzt gehts um einen Adapter, der Werte aus dem RaspberryPi Betriebssystem ausliest

                        oder läuft das Raspberry Pi OS bei dir im Container.
                        Ansonsten verstehe ich nicht was du uns sagen willst.

                        1 Reply Last reply Reply Quote 0
                        • Thomas Braun
                          Thomas Braun Most Active @NWH last edited by

                          @nwh sagte in Test Adapter rpi2 2.x:

                          Kannst du mir hierbei helfen.

                          Da ich nicht der begnadete javascript-Coder bin eher nicht.
                          Ich würde da was in einem Blockly aus SSH-Verbindung und den Kommandozeilenprogrammen per EXEC basteln.

                          1 Reply Last reply Reply Quote 0
                          • Homoran
                            Homoran Global Moderator Administrators last edited by Homoran

                            Ich weiss auch nicht wue du an die Temperatur des Containers kommen willst 😉

                            @NWH
                            du willst doch bestimmt die Werte des Hostsystems haben, oder?

                            Ab hier gehört es aber nicht mehr zum Test des neuen rpi2-Adapters!

                            NWH 1 Reply Last reply Reply Quote 0
                            • NWH
                              NWH @Homoran last edited by

                              @homoran sagte in Test Adapter rpi2 2.x:

                              Ich weiss auch nicht wue du an die Temperatur des Containers kommen willst 😉

                              @NWH
                              du willst doch bestimmt die Werte des Hostsystems haben, oder?

                              Nein, es läuft nur der IOB im Container.

                              Ich habe noch einen zusätzlichen Raspi wo ich die WP auslese.

                              @Thomas-Braun
                              Blockly wäre mir auch Recht. Aber mit Kommandozeilenprogrammen per EXEC noch nie gehört 🙄

                              Homoran 1 Reply Last reply Reply Quote 0
                              • Homoran
                                Homoran Global Moderator Administrators @NWH last edited by

                                @nwh ich hab das mal ausgegliedert!

                                Bitte Threadtitel an dein "Problem" anpassen.

                                @nwh sagte in cpu Last und Temperatur von entferntem RasPi auslesen:

                                @NWH
                                du willst doch bestimmt die Werte des Hostsystems haben, oder?

                                Nein, es läuft nur der IOB im Container.

                                ein Container hat keine Temperatur 😉
                                und ein RasPi ist er auch nicht.

                                Was genau willst du?

                                Thomas Braun 1 Reply Last reply Reply Quote 0
                                • Thomas Braun
                                  Thomas Braun Most Active @Homoran last edited by

                                  @homoran sagte in cpu Last und Temperatur von entferntem RasPi auslesen:

                                  Was genau willst du?

                                  Per 'Fernzugang'/SSH die Werte eines RPi auslesen.

                                  Homoran 1 Reply Last reply Reply Quote 0
                                  • NWH
                                    NWH last edited by

                                    @homoran sagte in cpu Last und Temperatur von entferntem RasPi auslesen:

                                    @nwh ich hab das mal ausgegliedert!

                                    Bitte Threadtitel an dein "Problem" anpassen.

                                    @nwh sagte in cpu Last und Temperatur von entferntem RasPi auslesen:

                                    @NWH
                                    du willst doch bestimmt die Werte des Hostsystems haben, oder?

                                    Nein, es läuft nur der IOB im Container.

                                    ein Container hat keine Temperatur 😉
                                    und ein RasPi ist er auch nicht.

                                    Was genau willst du?

                                    Ich will die CPU Last und die Temperatur vom Raspi auslesen.

                                    Das sind 2 Physisch unterschiedliche Geräte.
                                    1x Nas mit einem Container wo der Iob läuft.
                                    1x Raspi mit Raspina OS wo ein Script läuft. Hat nicht mit Iob zu tun.

                                    Homoran 1 Reply Last reply Reply Quote 0
                                    • Homoran
                                      Homoran Global Moderator Administrators @Thomas Braun last edited by

                                      @thomas-braun

                                      @thomas-braun sagte in cpu Last und Temperatur von entferntem RasPi auslesen:

                                      @homoran sagte in cpu Last und Temperatur von entferntem RasPi auslesen:

                                      Was genau willst du?

                                      Per 'Fernzugang'/SSH die Werte eines RPi auslesen.

                                      dann hab ich mit dem provisorischen Threadtitel doch getroffen.

                                      dann geht es um den hier?

                                      @nwh sagte in cpu Last und Temperatur von entferntem RasPi auslesen:

                                      Ich habe noch einen zusätzlichen Raspi wo ich die WP auslese.

                                      @NWH
                                      läuft da iobroker als slave drauf?

                                      NWH 1 Reply Last reply Reply Quote 0
                                      • NWH
                                        NWH @Homoran last edited by

                                        @homoran sagte in cpu Last und Temperatur von entferntem RasPi auslesen:

                                        @thomas-braun

                                        @thomas-braun sagte in cpu Last und Temperatur von entferntem RasPi auslesen:

                                        @homoran sagte in cpu Last und Temperatur von entferntem RasPi auslesen:

                                        Was genau willst du?

                                        Per 'Fernzugang'/SSH die Werte eines RPi auslesen.

                                        dann hab ich mit dem provisorischen Threadtitel doch getroffen.

                                        dann geht es um den hier?

                                        @nwh sagte in cpu Last und Temperatur von entferntem RasPi auslesen:

                                        Ich habe noch einen zusätzlichen Raspi wo ich die WP auslese.

                                        @NWH
                                        läuft da iobroker als slave drauf?

                                        Nein, wie gesagt Raspin OS und ein Script.

                                        1 Reply Last reply Reply Quote 0
                                        • Homoran
                                          Homoran Global Moderator Administrators @NWH last edited by Homoran

                                          @nwh Da haben sich unsere Posts überschnitten.

                                          Das wird nicht so einfach per script aus dem Container zu lösen sein.
                                          Du musst ja Zugriff auf den anderen Raspi bekommen

                                          aber ggf. anders herum.
                                          Vom Raspi per simple API auf den Container zugreifen.

                                          Hab aber keine Ahnung wie!

                                          NWH Codierknecht 2 Replies Last reply Reply Quote 0
                                          • NWH
                                            NWH @Homoran last edited by

                                            @homoran
                                            mhhh
                                            ChatGPT meinte:

                                            Um die CPU-Temperatur und -Auslastung deines Raspberry Pi auszulesen und im ioBroker darzustellen, kannst du die Daten mit einem Shell-Skript sammeln und dann über den ioBroker-Adapter „Systeminfo“ oder „Javascript“ zur Anzeige bringen.

                                            Allerdings möchte ich nicht haben das die Daten am Raspi gespeichert werden.
                                            Ich kenn mich hier nicht so gut aus, aber kann man den Pfad wo anders hin ändern?

                                            Das wäre das Script

                                            #!/bin/bash
                                            # cpu_data.sh
                                            
                                            # CPU-Temperatur
                                            temp=$(vcgencmd measure_temp | egrep -o '[0-9]*\.[0-9]*')
                                            
                                            # CPU-Auslastung
                                            usage=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}')
                                            
                                            # Ausgabe
                                            echo "temp=$temp"
                                            echo "usage=$usage"
                                            
                                            

                                            und hier das 2te Script

                                            const exec = require('child_process').exec;
                                            
                                            function readCpuData() {
                                                // Befehl für die CPU-Temperatur
                                                exec("vcgencmd measure_temp", (error, stdout, stderr) => {
                                                    if (error) {
                                                        console.error(`exec error: ${error}`);
                                                        return;
                                                    }
                                                    const temp = parseFloat(stdout.replace('temp=', '').replace("'C\n", ''));
                                                    setState("javascript.0.raspberrypi.temp", temp);
                                                });
                                            
                                                // Befehl für die CPU-Auslastung
                                                exec("top -bn1 | grep 'Cpu(s)' | sed 's/.*, *\\([0-9.]*\\)%* id.*/\\1/' | awk '{print 100 - $1}'", (error, stdout, stderr) => {
                                                    if (error) {
                                                        console.error(`exec error: ${error}`);
                                                        return;
                                                    }
                                                    const usage = parseFloat(stdout);
                                                    setState("javascript.0.raspberrypi.usage", usage);
                                                });
                                            }
                                            
                                            // CPU-Daten alle 10 Sekunden abrufen
                                            schedule("*/10 * * * * *", readCpuData);
                                            
                                            
                                            Homoran 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            967
                                            Online

                                            31.7k
                                            Users

                                            79.6k
                                            Topics

                                            1.3m
                                            Posts

                                            raspberry pi
                                            5
                                            42
                                            1804
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo