Check KODI

  • Hey there,

    I would like to know, if there is any deamon or service, to check if KODI is already running or still running?
    I have build a "childrens-player" without a monitor. And if possible, I would like to use a LED, like a heardbeat to show whether KODI is running or not.

    Probably exsists a manual. But I don´t know what to look for.

    Thanks a lot!

  • And if possible, I would like to use a LED, like a heardbeat to show whether KODI is running or not.

    I'm still puzzling...

    Which hardware do you use, and why do you need to know the status of Kodi? Kodi always runs by default.

    If you use an RPi, you could trigger an LED from autostart.sh.

    I wouldn't do that heartbeat thing, because it will freak people out after some time.

  • Da Flex : Yes, I´m using a RPi 3B+.

    The reason why I want to know the status is because the RPi is inside a wodden box (Radio). And I could not see the onboard status-LED.

    If I trigger an LED from autostart.sh I know that the autostart-script is loaded. But I also want to know if KODI is loaded.

    I found this @ Mit Python einen service status abfragen - Das deutsche Python-Forum

    Sonntag 6. März 2016, 17:24
    @HightronicDesign: Wie Dav1d schrieb hat `systemd` eine DBus-API. Es gibt mit `python-systemd` eine API die darauf aufbaut.

    Code: Alles auswählen

    Python
    #!/usr/bin/env python
    # coding: utf8
    from __future__ import absolute_import, division, print_function
    from systemd.manager import Manager
    
    
    def main():    manager = Manager()    unit = manager.get_unit('mediacenter.service')    is_active = unit.properties.ActiveState == 'active'    print(is_active)
    
    
    if __name__ == '__main__':    main()

    Anstelle des `mediacenter.service` mit dem ich das auf meinem OSMC-Raspi getestet habe, müsstest Du da den Service-Namen eintragen den Du testen möchtest.


    Would that be a start?

    Edited 2 times, last by Blackbeard (December 27, 2019 at 8:55 PM).

  • If I trigger an LED from autostart.sh I know that the autostart-script is loaded. But I also want to know if KODI is loaded.

    That's nearly the same time, and as written, Kodi always runs from that point, if you don't explicitly stop that process.

    Read here how to trigger a status LED.

    PS: Watch the video at the linked thread to see when Kodi and status LED will start working - should be exactly what you need. :)