Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. LAN-Gateway (PI) neustarten wenn DUTY-Cycle -1

    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

    LAN-Gateway (PI) neustarten wenn DUTY-Cycle -1

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

      Hallo,

      im rega-Adapter DUTY-Cycle aktivieren.

      Variable mit Duty-Cycle suchen: hm-rega.0.OEQ0608058.0.DUTY_CYCLE

      sshpass installieren oder keys erstellen (apt-get install sshpass)

      Gateway-Adresse suchen: 192.168.1.10 (meine)

      Es wird 120 Sekunden gewartet, wenn dann immer noch der DUTY-Cycle auf -1 ist, wird das Gateway neu gestartet.

      Das wird 30mal wiederholt, solange bis der DUTY wieder auf >=0 ist.

      PS: Exec muss im Java-Script Adapter aktiviert werden!

      on({id: 'hm-rega.0.OEQ0608058.0.DUTY_CYCLE', change: "ne"}, function (obj) {
        var value = obj.state.val;
        var oldValue = obj.oldState.val;
        // console.log('PI-LAN-GATEWAY:'+value);
        if (value == "-1") {
          console.log('PI-LAN-GATEWAY-ERROR:'+value);
          (function theLoop (i) {
                  setTimeout(function () {
                      var val = getState('hm-rega.0.OEQ0608058.0.DUTY_CYCLE').val;
                      if (val=="-1") {
                        console.log('PI-LAN-GATEWAY-Restart('+i+'):'+val);
                        exec('sshpass -p passort ssh root@192.168.1.10 reboot now');
                      } else {
                          console.log('PI-LAN-GATEWAY-Erfolg('+i+'):'+val);
                          i = 0;
                      }
                      i--;
                      if (i>0) {          // If i > 0, keep going
                          theLoop(i);       // Call the loop again, and pass it the current value of i
                      }
                  }, 120000);
          })(30);
        }
      });
      
      1 Reply Last reply Reply Quote 0
      • F
        Flauschi last edited by

        sollte man nicht lieber daran arbeiten, die Ursache für einen hohen DutyCycle auszumerzen?

        Eine riesige Installation mit sogar Lan Gateways braucht keinen DutyCycle über 50 zu haben, wenn man ordentlich programmiert.

        Sent from my iPhone using Tapatalk

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

          Es geht um einen negativen DC wo immer der herkommt.

          Gruß Rainer

          1 Reply Last reply Reply Quote 0
          • sissiwup
            sissiwup last edited by

            @Homoran:

            Es geht um einen negativen DC wo immer der herkommt.

            Gruß Rainer `

            Genau, es geht nicht um zu hohen DUTY-Cycle.

            Wenn der Duty-Cycle -1 ist, bedeutet es dass das LAN-Gateway nicht mehr erreicht wird.

            Das Gateway ist normalerweise schon noch per ping etc. erreichbar, nur halt von der CCU nicht.

            In diesen Fall kann man sich beheben indem man das Gateway neu startet.

            Und das macht das Script automatisiert. Es kann natürlich durch jedes beliebige Ereignis ausgelöst werden

            und dann irgend etwas zeitversetzt starten.

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

            Support us

            ioBroker
            Community Adapters
            Donate

            834
            Online

            31.7k
            Users

            79.8k
            Topics

            1.3m
            Posts

            3
            4
            548
            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