Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Tester
    4. Test Adapter Linux Control v1.x.x

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Test Adapter Linux Control v1.x.x

    This topic has been deleted. Only users with topic management privileges can see it.
    • Homoran
      Homoran Global Moderator Administrators @Thomas Braun last edited by Homoran

      @Thomas-Braun sagte in Test Adapter Linux Control v0.x.x:

      ls -la /usr/bin/find

      pi@tinkerboard:~$ ls -la /usr/bin/find
      -rwxr-xr-x 1 root root 158456 Nov  5  2017 /usr/bin/find
      

      habe das ganze dann mit sudo su mal als root ausführen wollen, um zu sehen, ob ich damals vielleicht unter root installiert hatte 😳 dabei kam das hier:

      pi@tinkerboard:~$ sudo su
      [sudo] password for pi:
      Sorry, user pi is not allowed to execute '/bin/su' as root on localhost.
      

      vielleicht hilft das

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

        @Homoran Setz das setuid bit mal auf die Datei:

        sudo chmod u+x /usr/bin/find
        

        Die Rechte müssten danach so aussehen:

        -rwSr-xr-x 1 root root 158456 Nov  5  2017 /usr/bin/find
        
        Homoran 1 Reply Last reply Reply Quote 0
        • Homoran
          Homoran Global Moderator Administrators @Thomas Braun last edited by

          @Thomas-Braun sagte in Test Adapter Linux Control v0.x.x:

          Setz das setuid bit mal auf die Datei:

          W+ürde ich ja gerne, aber:

          Sorry, user pi is not allowed to execute '/bin/chmod u+x /usr/bin/find' as root on localhost.
          
          

          Darf ich da ausnahmsweise mal als root ran?

          PS hatte ich schon mal irgendwo erwähnt, dass ich Ubuntu hasse?

          liv-in-sky Thomas Braun 2 Replies Last reply Reply Quote 0
          • liv-in-sky
            liv-in-sky @Homoran last edited by

            @Homoran uuuhhhh - heikles thema 🙂

            Homoran 1 Reply Last reply Reply Quote 0
            • Homoran
              Homoran Global Moderator Administrators @liv-in-sky last edited by Homoran

              @liv-in-sky ich weiß, deswegen frag ich ja gaaaanz vorsichtig an 😉

              Aber:
              linux_control_011.png

              Die Farbe wird sich hoffentlich im nächsten Zyklus ändern, ich hatte die Datenpunkte für den Header vergessen

              Der Charly-Tinker hat ein Armbian auf Debian-Basis!

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

                @Homoran sagte in Test Adapter Linux Control v0.x.x:

                Darf ich da ausnahmsweise mal als root ran?

                Versuch mal aus einer root-shell heraus.
                Aber eigentlich wundert es mich, dass das nicht mit sudo geht.

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

                  @Thomas-Braun sagte in Test Adapter Linux Control v0.x.x:

                  Aber eigentlich wundert es mich, dass das nicht mit sudo geht.

                  da scheint dann auch der Wurm mit den Rechten dran zu hängen

                  über root gesetzt und über pi abgefragt:

                  -rwxr-xr-x 1 root root 158456 Nov  5  2017 /usr/bin/find
                  
                  
                  Thomas Braun Homoran 2 Replies Last reply Reply Quote 0
                  • Thomas Braun
                    Thomas Braun Most Active @Homoran last edited by

                    @Homoran
                    Kannst du mal die komplette Ein- und Ausgabe zeigen? Also inkl. prompt?

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

                      @Thomas-Braun sagte in Test Adapter Linux Control v0.x.x:

                      @Homoran
                      Kannst du mal die komplette Ein- und Ausgabe zeigen? Also inkl. prompt?

                      klar:
                      root:

                      root@tinkerboard:~# chmod u+x /usr/bin/find
                      root@tinkerboard:~#
                      

                      pi

                      pi@tinkerboard:~$ ls -la /usr/bin/find
                      -rwxr-xr-x 1 root root 158456 Nov  5  2017 /usr/bin/find
                      
                      1 Reply Last reply Reply Quote 0
                      • liv-in-sky
                        liv-in-sky @Homoran last edited by

                        @Homoran sagte in Test Adapter Linux Control v0.x.x:

                        @liv-in-sky ich weiß, deswegen frag ich ja gaaaanz vorsichtig an 😉

                        Aber:
                        linux_control_011.png

                        Die Farbe wird sich hoffentlich im nächsten Zyklus ändern, ich hatte die Datenpunkte für den Header vergessen

                        Der Charly-Tinker hat ein Armbian auf Debian-Basis!

                        falls da ein problem ist ( die farbe wird durch den is-online datenpunkt gemacht) machen wir im anderen thread weiter - du solltest auch das script auf den neusten stand bringen - da hat sich was geändert im adapter

                        Homoran 2 Replies Last reply Reply Quote 0
                        • Homoran
                          Homoran Global Moderator Administrators @liv-in-sky last edited by

                          @liv-in-sky sagte in Test Adapter Linux Control v0.x.x:

                          machen wir im anderen thread weiter

                          genau, der heisst da is-online statt isOnline

                          @liv-in-sky sagte in Test Adapter Linux Control v0.x.x:

                          du solltest auch das script auf den neusten stand bringen - da hat sich was geändert im adapter

                          Stress!

                          liv-in-sky 1 Reply Last reply Reply Quote 0
                          • liv-in-sky
                            liv-in-sky @Homoran last edited by liv-in-sky

                            @Homoran mach wenn du zeit hast 🙂

                            erstmal das linux thema lösen - die vis danach

                            1 Reply Last reply Reply Quote 0
                            • Homoran
                              Homoran Global Moderator Administrators @liv-in-sky last edited by

                              @liv-in-sky sagte in Test Adapter Linux Control v0.x.x:

                              da hat sich was geändert im adapter

                              Dannbleiben wir hier bei dem Thema!
                              müssen die alten states gelöscht werden?

                              der neue state heisst is-online, die alten isOnline!

                              @Thomas-Braun
                              Die Änderung hat keinen Erfolg gebracht - habe aber im Moment die Instanz nicht auf debug, kenne also ad hoc die Fehlermeldung noch nicht.
                              fürchte aber, dass da de user pi unter ubuntu einfach zu wenig Rechte bekommt.

                              liv-in-sky 1 Reply Last reply Reply Quote 0
                              • liv-in-sky
                                liv-in-sky @Homoran last edited by liv-in-sky

                                @Homoran sagte in Test Adapter Linux Control v0.x.x:

                                Dannbleiben wir hier bei dem Thema!
                                müssen die alten states gelöscht werden?
                                der neue state heisst is-online, die alten isOnline!

                                adpter stop - den linux-control.0 ordner löschen - adapter start

                                und script stoppen

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

                                  @Homoran sagte in Test Adapter Linux Control v0.x.x:

                                  da scheint dann auch der Wurm mit den Rechten dran zu hängen

                                  @Thomas-Braun
                                  @Scrounger

                                  Hier das aktuelle debug-log vom Tinker (leider rückwärts!)

                                  linux-control.0	2020-08-20 14:00:38.452	info	(8147) successful received data from Tinker (192.168.138.74:22)
                                  linux-control.0	2020-08-20 14:00:38.328	debug	(8147) [userCommand] Tinker (192.168.138.74:22, id: mem, description: ): response stdout: 2009;307;1049
                                  linux-control.0	2020-08-20 14:00:38.281	debug	(8147) [userCommand] Tinker (192.168.138.74:22, id: mem, description: ): send command: 'free -m | awk ' NR == 2 {print $2";"$3";"$4}''
                                  linux-control.0	2020-08-20 14:00:35.592	debug	(8147) [userCommand] Tinker (192.168.138.74:22, id: cpu-temp, description: ): response stdout: 50
                                  linux-control.0	2020-08-20 14:00:35.548	debug	(8147) [userCommand] Tinker (192.168.138.74:22, id: cpu-temp, description: ): send command: 'cat /sys/devices/virtual/thermal/thermal_zone0/temp | awk '{print substr($1, length($0)-5,3)}''
                                  linux-control.0	2020-08-20 14:00:35.540	debug	(8147) [userCommand] Tinker (192.168.138.74:22, id: ip, description: ): response stdout: 192.168.138.74
                                  linux-control.0	2020-08-20 14:00:35.491	debug	(8147) [userCommand] Tinker (192.168.138.74:22, id: ip, description: ): send command: 'hostname -I | cut -d' ' -f1'
                                  linux-control.0	2020-08-20 14:00:35.484	debug	(8147) [userCommand] Tinker (192.168.138.74:22, id: root, description: ): response stdout: 5
                                  linux-control.0	2020-08-20 14:00:35.439	debug	(8147) [userCommand] Tinker (192.168.138.74:22, id: root, description: ): send command: 'df / | grep / | awk '{ print $5}' | sed 's/%//g''
                                  linux-control.0	2020-08-20 14:00:35.393	debug	(8147) [folderSizes] Tinker (192.168.138.74:22): Tinker.folders.iobroker.lastChange: NaN ->
                                  linux-control.0	2020-08-20 14:00:35.389	debug	(8147) [folderSizes] Tinker (192.168.138.74:22): response stdout: Sorry, user pi is not allowed to execute '/usr/bin/find /opt/iobroker/iobroker-data -name * -type f -exec stat -c %Y %n -- {} ;' as r
                                  linux-control.0	2020-08-20 14:00:35.309	debug	(8147) [folderSizes] Tinker (192.168.138.74:22): send command: 'tmp=$(sudo -S find /opt/iobroker/iobroker-data -name "*" -type f -exec stat -c "%Y %n" -- {} \; | sort -nr | head -n1 | awk '{print $2}'
                                  linux-control.0	2020-08-20 14:00:35.259	debug	(8147) [folderSizes] Tinker (192.168.138.74:22): Tinker.folders.iobroker.files: NaN Dateien
                                  linux-control.0	2020-08-20 14:00:35.256	debug	(8147) [folderSizes] Tinker (192.168.138.74:22): response stdout: Sorry, user pi is not allowed to execute '/usr/bin/find /opt/iobroker/iobroker-data -name *' as root on localhost. 0
                                  linux-control.0	2020-08-20 14:00:35.148	debug	(8147) [folderSizes] Tinker (192.168.138.74:22): send command: 'sudo -S find /opt/iobroker/iobroker-data -name "*" | wc -l'
                                  linux-control.0	2020-08-20 14:00:35.103	debug	(8147) [folderSizes] Tinker (192.168.138.74:22): Tinker.folders.iobroker.size: NaN MB
                                  linux-control.0	2020-08-20 14:00:35.099	debug	(8147) [folderSizes] Tinker (192.168.138.74:22): response stdout: Sorry, user pi is not allowed to execute '/usr/bin/du -sk /opt/iobroker/iobroker-data' as root on localhost.
                                  linux-control.0	2020-08-20 14:00:34.929	debug	(8147) [folderSizes] Tinker (192.168.138.74:22): send command: 'sudo -S du -sk /opt/iobroker/iobroker-data | awk '{ print $1 /1024 }''
                                  linux-control.0	2020-08-20 14:00:34.916	debug	(8147) [needrestart] Tinker (192.168.138.74:22): no datapoints selected -> removing existing datapoints
                                  linux-control.0	2020-08-20 14:00:33.615	debug	(8147) [servicesInfo] Tinker (192.168.138.74:22): csvToJson result: [{"id":"alsa-restore.service","load":"loaded","active":"active","running":"exited","description":"Save/Restore Sound Card State"},{"
                                  linux-control.0	2020-08-20 14:00:33.604	debug	(8147) [servicesInfo] Tinker (192.168.138.74:22): response stdout: alsa-restore.service,loaded,active,exited, Save/Restore Sound Card State alsa-state.service,loaded,inactive,dead, Manage Sound Card S
                                  linux-control.0	2020-08-20 14:00:33.579	debug	(8147) [servicesInfo] Tinker (192.168.138.74:22): send command: 'systemctl list-units --type service --all --no-legend | awk '{out=""; for(i=5;i<=NF;i++){out=out" "$i}; print $1","$2","$3","$4","out}'
                                  linux-control.0	2020-08-20 14:00:33.561	debug	(8147) [cmdAptUpdate] Tinker (192.168.138.74:22): Tinker.updates.lastUpdate: Fallback method: 1597917525000 -> 20.08.2020 11:58
                                  linux-control.0	2020-08-20 14:00:33.560	debug	(8147) [cmdAptUpdate] Tinker (192.168.138.74:22): response stdout: 2020-08-20 11:58:45
                                  linux-control.0	2020-08-20 14:00:33.514	debug	(8147) [cmdAptUpdate] Tinker (192.168.138.74:22): send command: 'grep installed /var/log/dpkg.log | tail -1 | cut -c1-19'
                                  linux-control.0	2020-08-20 14:00:33.513	debug	(8147) [cmdAptUpdate] Tinker (192.168.138.74:22): response stdout:
                                  linux-control.0	2020-08-20 14:00:33.457	debug	(8147) [cmdAptUpdate] Tinker (192.168.138.74:22): send command: 'dpkg-query -f '${db-fsys:Last-Modified} ' -W | sort -nr | head -1'
                                  linux-control.0	2020-08-20 14:00:33.403	debug	(8147) [cmdAptUpdate] Tinker (192.168.138.74:22): Tinker.updates.newPackagesList: [{"name":"bsdutils","installedVersion":"1:2.31.1-0.4ubuntu3.5","availableVersion":"1:2.31.1-0.4ubuntu3.6"},{"name":"li
                                  linux-control.0	2020-08-20 14:00:33.354	debug	(8147) [cmdAptUpdate] Tinker (192.168.138.74:22): Tinker.updates.upgradable: true
                                  linux-control.0	2020-08-20 14:00:33.345	debug	(8147) [cmdAptUpdate] Tinker (192.168.138.74:22): Tinker.updates.newPackages: 118
                                  linux-control.0	2020-08-20 14:00:33.339	debug	(8147) [cmdAptUpdate] Tinker (192.168.138.74:22): response stdout: bsdutils,1:2.31.1-0.4ubuntu3.5,1:2.31.1-0.4ubuntu3.6 libuuid1,2.31.1-0.4ubuntu3.5,2.31.1-0.4ubuntu3.6 libblkid1,2.31.1-0.4ubuntu3.5,2
                                  linux-control.0	2020-08-20 14:00:27.093	debug	(8147) [cmdAptUpdate] Tinker (192.168.138.74:22): send command: 'apt-get --just-print upgrade 2>&1 | perl -ne 'if (/Inst\s([\w,\-,\d,\.,~,:,\+]+)\s[([\w,\-,\d,\.,~,:,\+]+)]\s\(([\w,\-,\d,\.,~,:,\+]+
                                  linux-control.0	2020-08-20 14:00:27.092	debug	(8147) [cmdAptUpdate] Tinker (192.168.138.74:22): response stdout: Sorry, user pi is not allowed to execute '/usr/bin/apt-get update' as root on localhost.
                                  linux-control.0	2020-08-20 14:00:26.925	debug	(8147) [cmdAptUpdate] Tinker (192.168.138.74:22): send command: 'sudo -S apt-get update'
                                  linux-control.0	2020-08-20 14:00:26.845	debug	(8147) [distributionInfo] Tinker (192.168.138.74:22): csvToJson result: [{"prop":"NAME","val":"Ubuntu"},{"prop":"VERSION","val":"18.04.5 LTS (Bionic Beaver)"},{"prop":"ID","val":"ubuntu"},{"prop":"ID_
                                  linux-control.0	2020-08-20 14:00:26.840	debug	(8147) [distributionInfo] Tinker (192.168.138.74:22): response stdout: NAME="Ubuntu" VERSION="18.04.5 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.5 LTS" VERSION_ID="18.04"
                                  linux-control.0	2020-08-20 14:00:26.622	debug	(8147) [distributionInfo] Tinker (192.168.138.74:22): send command: 'cat /etc/os-release'
                                  linux-control.0	2020-08-20 14:00:26.503	debug	(8147) [getConnection] Host 'Tinker' (192.168.138.74:22): using sudo for authentification
                                  linux-control.0	2020-08-20 14:00:26.471	info	(8147) getting data from Tinker (192.168.138.74:22)
                                  

                                  es bleibt leider bei:

                                  
                                  linux-control.0	2020-08-20 14:00:35.099	debug	(8147) [folderSizes] Tinker (192.168.138.74:22): response stdout: Sorry, user pi is not allowed to execute '/usr/bin/du -sk /opt/iobroker/iobroker-data' as root on localhost.
                                  

                                  nach dem Befehl:

                                  linux-control.0	2020-08-20 14:00:34.929	debug	(8147) [folderSizes] Tinker (192.168.138.74:22): send command: 'sudo -S du -sk /opt/iobroker/iobroker-data | awk '{ print $1 /1024 }''
                                  

                                  entsprechend kommt dabei dann kein Wert heraus:

                                  linux-control.0	2020-08-20 14:00:35.103	debug	(8147) [folderSizes] Tinker (192.168.138.74:22): Tinker.folders.iobroker.size: NaN MB
                                  

                                  EDIT:
                                  Der Befehl unter "Eigene Befehle"
                                  Tinker_Ordner.png

                                  bringt jedoch ein Ergebnis:
                                  TinkerUpdates.png

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

                                    @Thomas-Braun
                                    @Scrounger

                                    Habe noch "ein wenig" rumgespielt.

                                    Auch wenn ich auf der Konsole als user den Befehl sudo -S du -sk /opt/iobroker/iobroker-data | awk '{ print $1 /1024 }' ausführen will, kommt der Hinweis, dass der User nicht berechtigt ist....

                                    Führe ich ihn jedoch ohne sudo -S aus klappt es 😱

                                    Habe dann in der Konfiguration der Instanz, den Haken bei "verwende sudo" herausgenommen.
                                    Dann fliegen dem Adapter die richtig bösen Fehlermeldungen schon vorher um die Ohren, weil die anderen Befehle nicht abgearbeitet werden können 😢

                                    Aus lauter Verzweiflung habe ich dann das System noch mit apt update && apt upgrade auf den neuesten Stand gebracht - ohne Erfolg

                                    Werde jetzt mal der Instanz den Zugriff als root erlauben 🤣

                                    EDIT:
                                    Als Root klappt es:
                                    Tinker_als_root.png

                                    Ist aber für mich kein Dauerzustand
                                    PS der Tinker wurde umbenannt -> MQTT-Tinker

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

                                      @Homoran sagte in Test Adapter Linux Control v0.x.x:

                                      Auch wenn ich auf der Konsole als user den Befehl sudo -S du -sk /opt/iobroker/iobroker-data | awk '{ print $1 /1024 }' ausführen will, kommt der Hinweis, dass der User nicht berechtigt ist....

                                      Führe ich ihn jedoch ohne sudo -S aus klappt es 😱

                                      Habe dann in der Konfiguration der Instanz, den Haken bei "verwende sudo" herausgenommen.
                                      Dann fliegen dem Adapter die richtig bösen Fehlermeldungen schon vorher um die Ohren, weil die anderen Befehle nicht abgearbeitet werden können 😢

                                      Mhh da bin ich dann auch ratlos. Dann mach die Folder abfragen als eigene Befehle, kannst hier ja die gleiche Strutkur verwenden. Oder - siehe unten 😉

                                      EDIT:
                                      Als Root klappt es:
                                      Tinker_als_root.png

                                      Ist aber für mich kein Dauerzustand
                                      PS der Tinker wurde umbenannt -> MQTT-Tinker

                                      Dann geh doch per root mit rsa key drauf, das ist auch ausreichend sicher, solange du den key nicht weiter gibts. Eine gute Anleitung wie man das einrichtet findest du hier:
                                      https://www.howtoforge.de/anleitung/key-basierte-ssh-logins-mit-putty/

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

                                        @Scrounger sagte in Test Adapter Linux Control v0.x.x:

                                        Eine gute Anleitung wie man das einrichtet findest du hier:

                                        Danke!

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

                                          Bitte nicht hauen, ich habe mal das nächste unmögliche Ding losgetreten.

                                          Ich hatte erwartet, dass es da "Probleme" geben wird und da @Scrounger zu Recht nur Debian und Ubuntu LTS Versionen unterstützen will, ist dies nur eine kleine Randbemerkung über das was mal jemand -in diesem Falle ich- mit dem Adapter probiert hat:

                                          Traumkiste.png

                                          Im letzten Block werden einige Daten von der Dreambox geholt.
                                          Wie zu erwarten hagelte es Fehler im log, wegen der anderen Befehle, die das OS der DM920 nicht beherrschte.

                                          Aber die Infos sind auch schon mal brauchbar.

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

                                            @Homoran
                                            Hehe nice 😁 für meine vu gibt's zum Glück schon nen Adapter.
                                            Hab sowas mit meinem Unifi UDMPro - UbiOs gemacht und lese damit die vpn l2tp Verbindungen aus.

                                            Tipp: Allen Datenpunkte des Host (DreamBox) auf die Blacklist ziehen, dann hast auch keine Fehlermeldung mehr.

                                            liv-in-sky 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            779
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            adapter control hardware linux steuern
                                            64
                                            656
                                            128191
                                            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