Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. XML Befehl über Blockly

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    XML Befehl über Blockly

    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      MCU @Nereos last edited by

      @Nereos Ist es möglich auf der Maschine den Phyton Befehl direkt einzugeben und auszuführen:

      1dfea9b0-1260-42b3-904a-8f4cd2417f28-image.png

      so ähnlich?

      N 1 Reply Last reply Reply Quote 0
      • N
        Nereos @MCU last edited by

        @MCU Probiere ich morgen früh aus. Anlage steht auf der Arbeit.

        M 1 Reply Last reply Reply Quote 0
        • M
          MCU @Nereos last edited by

          @Nereos Wenn es geht:

          97d2ccb4-3518-4d64-92b0-eff3c9cd197f-image.png

          e049208c-7bcc-4f99-85e6-311b0b203140-image.png

          N 1 Reply Last reply Reply Quote 0
          • N
            Nereos @MCU last edited by Nereos

            @MCU hi,

            Datei sieht so aus:

            import xmlrpc.client

            def run(IPaddress,port=8081):
            URI="http://{0}:{1}".format(IPaddress,port)
            with xmlrpc.client.ServerProxy(URI) as proxy:
            results=proxy.SetOpen(1)
            if name == "main":
            IPaddress="192.xxx.xx.xxx"
            run(IPaddress)

            Und liegt hier:

            /home/pi/test

            Wenn ich in den Ordner wechsle und dann python auf.py eingebe geht es.

            Über de nIOBroke bekomme ich das irgendwie nicht hin.

            M 1 Reply Last reply Reply Quote 0
            • M
              MCU @Nereos last edited by

              @Nereos Dann versuch doch mal im Exec: "sudo /home/pi/test/python auf.py"

              906c8d45-4b1d-4fa2-8d0b-da3ceb749d06-image.png

              N 1 Reply Last reply Reply Quote 0
              • N
                Nereos @MCU last edited by

                @MCU Geht einfach nicht! 😞

                M 1 Reply Last reply Reply Quote 0
                • M
                  MCU @Nereos last edited by

                  @Nereos Dann mal : im EXEC: "cd /home/pi/test && sudo phyton auf.py".

                  N 1 Reply Last reply Reply Quote 0
                  • N
                    Nereos @MCU last edited by

                    @MCU Kann es sein, das es mit der Rechte Vergabe zu tun hat oder das ich den Block unter Scripte in die VIS einbinden muss, damit es funktioniert?

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

                      evtl muss der befehl python in das sudoers file eingetragen werden, wenn sudo genutzt werden soll

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

                        @liv-in-sky 🤷‍♂️Was ist den das für ein file? Voll keinen Plan.

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

                          @Nereos

                          kann es nicht testen - aber versuch mal (console)

                          überprüfe, ob der pfad zu python auch stimmt

                          which python
                          

                          sollte dann: /usr/bin/python rauskommen

                          unter /etc/sudoers.d brauchst du eine datei z.b. iobroker-own

                          sudo nano /etc/sudoers.d/iobroker-own
                          

                          dort musst du die befehle eingeben, die du brauchst

                          ein beispiel von mir:

                          Image 3.png

                          du müßtest eine zeile haben die so aussieht

                          iobroker ALL=(ALL) NOPASSWD: /usr/bin/python /path/to/the/auf.py 
                          

                          mit control-x schliesst du den nano-texteditor und speicherst die datei

                          @AlCalzone - hast du da einen idee dazu?

                          quelle: https://serverfault.com/questions/482502/how-to-set-up-sudo-rights-for-execution-of-python-script-from-php

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

                            @Nereos @liv-in-sky Lasst das sudo weg - sollte für HTTP-Server jenseits Port 80 überhaupt nicht nötig sein.

                            Außerdem:
                            Das Skript muss in einem Ordner liegen, wo der User iobroker Zugriff hat, also z.B. /home/iobroker, nicht im Home-Verzeichnis eines anderen Users.
                            Dann lautet der Befehl einfach python /pfad/zum/skript/auf.py

                            1 Reply Last reply Reply Quote 1
                            • First post
                              Last post

                            Support us

                            ioBroker
                            Community Adapters
                            Donate

                            572
                            Online

                            31.9k
                            Users

                            80.2k
                            Topics

                            1.3m
                            Posts

                            4
                            15
                            391
                            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