Ankündigung

Einklappen
Keine Ankündigung bisher.

Neue Logik funktionieren nur im Debug Modus

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Neue Logik funktionieren nur im Debug Modus

    Guten Abend,

    ich habe vor einiger Zeit bereits erfolgreich eine Logik für meine Türklingel geschrieben die bisher gut funktioniert. Nun habe ich eine neue Logik geschrieben welche den Müllkalender liest und LEDs aufblinken lässt falls am nächsten Tag Müll rausgebracht werden muss.

    Nun habe ich das Problem, dass meine Logik nur funktioniert, wenn ich smarthome.py im Debug Modus starte (also smarthome.py -d). Im normalen Modus oder auch
    bei einem Neustart wird diese Logik nicht ausgeführt. Hat jemand eine Idee woran das liegen kann? Ich habe zu Testzwecken auch noch eine test_logic.py erstellt welche nur einen Print "Test logic" macht. Auch diese wird nur im Debug Modus ausgeführt. Die Berechtigungen für die Logiken sind jedesmal gleich, z. B.

    -rwxrwxr-x 1 smarthome staff 678 Dez 20 22:05 garbage_notification.py*



    Anbei ein Auszug wenn es im Debug läuft:


    2017-12-20 22:34:23 DEBUG scheduler Scheduler plugins.avm_fritzbox_7490 next time: 2017-12-20 22:39:23+01:00 -- scheduler.py:_next_time:343
    2017-12-20 22:34:25 DEBUG __init__ Main KNX[default]: 1.0.22 set 2/1/0 to 21.2 -- __init__.pyarse_telegram:348
    2017-12-20 22:34:25 DEBUG __init__ Main KNX[default]: write request from 1.0.22 to 2/1/0 with '0c24' and DPT 9 -- __init__.pyarse_telegram:360
    Test logic
    2017-12-20 22:34:26 DEBUG item env_init Item env.core.version = 1.3a.ad06e4c.dev via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 INFO blockly_logics blockly_logics blockly_logics hallo Welt -- blockly_logics.py:<module>:6
    2017-12-20 22:34:26 DEBUG item env_init Item env.core.start = 2017-12-20 22:34:26.507697+01:00 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sunrise = 2017-12-21 08:09:22.574007+01:00 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_init Item env.system.name = smarthomeNG via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sunrise.azimut.degrees = 138.22 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sunrise.elevation.degrees = 6.43 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_init Item env.system.start = 2017-12-20 22:31:47.540401+01:00 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sunrise.azimut.radians = 2.41 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sunrise.elevation.radians = 0.11 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sunset = 2017-12-21 16:19:08.922398+01:00 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sunset.azimut.degrees = 244.51 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sunset.elevation.degrees = -9.23 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sunset.azimut.radians = 4.27 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sunset.elevation.radians = -0.16 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sun_position.azimut.degrees = 314.16 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sun_position.elevation.degrees = -57.44 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sun_position.azimut.radians = 5.48 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.sun_position.elevation.radians = -1.0 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.moonrise = 2017-12-21 10:08:31.491196+01:00 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.moonset = 2017-12-21 19:26:49.816114+01:00 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.moonphase = 1 via Logic None None -- item.py:__update:707
    2017-12-20 22:34:26 DEBUG item env_loc Item env.location.night = True via Logic None None -- item.py:__update:707
    Running garbage notificator
    2017-12-20 22:34:27 DEBUG scheduler Scheduler sh.gc next time: 2017-12-21 02:04:00+01:00 -- scheduler.py:_next_time:343
    2017-12-20 22:34:27 DEBUG scheduler Scheduler env_loc next time: 2017-12-20 23:04:27+01:00 -- scheduler.py:_next_time:343
    2017-12-20 22:34:27 DEBUG smarthome sh.gc Garbage collector: collected 45 objects. -- smarthome.py:_garbage_collection:821
    Bring out the paper garbage
    2017-12-20 22:34:27 DEBUG item garbage_logics Item haus.aussen.muell.papier_muell = True via Logic None None -- item.py:__update:707


    Für Vorschläge bin ich dankbar!

    Grüße,
    Andi



    #2
    Deutet schon auf ein Rechteproblem hin.. Was meint denn ps aux | grep python3?
    Wenn du Smarthome manuell startest, startet es vermutlich als root. Als Service als smarthome User.
    Recht für das py File scheint zu passen, aber mach sicherheitshalber mal ein chown smarthome:staff /usr/local/smarthome -R

    Kommentar


      #3
      ps aux | grep python:
      smartho+ 2190 0.9 3.9 227428 34456 ? Sl Dez20 11:59 python3 /usr/local/smarthome/bin/smarthome.py
      smartho+ 8693 0.0 0.2 4768 1932 pts/0 S+ 18:55 0:00 grep --color=auto python3


      Ich habe den chwon Befehl ausgeführt, jedoch keine Besserung....

      Kommentar


        #4
        Kommando zurück! Nun scheint die Logik doch ausgeführt zu werden. Ich habe in meinen Logiken nur einen Print-Befehl reingeschrieben. Dieser wurde in der Konsole ausgegeben aber natürlich nicht in den Log-Nachrichten.
        Nun rufe ich logger.info auf und schon gehts

        Kommentar

        Lädt...
        X