Posts by jcjdammers

    The attached atvclient.zip contains two files:

    • atvclient (this is the binary)
    • atvclient.service (this is the configuration of the service)

    Copy the atvclient file to the directory /storage/bin/

    Copy the atvclient.service file to the directory /storage/.config/system.d/


    Run the following two commands to enable the service:

    Code
    systemctl enable atvclient.service
    systemctl start atvclient.service


    Done.

    Files

    • atvclient.zip

      (12.99 kB, downloaded 48 times, last: )

    I have found another solution that works for me.


    Created a service "/storage/.config/system.d/kodiresume.service" that gets invoked during resume from suspend.

    Enabled the service with following command line:

    cd /storage/.config/system.d/

    systemctl enable kodiresume.service


    The service file contains the following:

    Hi @Iridium,


    I am using Intel architecture.

    See log details ==> http://ix.io/2dKp


    This is how my sript looks like (/storage/.config/sleep.d/02-home.power) :

    Bash
    #!/bin/sh
    case "$1" in
    pre)
    kodi-send --action="Action(close)" --delay=100 --action="ActivateWindow(home)" >> /tmp/test.log
    ;;
    post)
    kodi-send --action="Action(close)" --delay=100 --action="ActivateWindow(home)" >> /tmp/test.log
    ;;
    esac


    I can see in the /tmp/test.log file that the kodi-send action was executed.

    However the actions seem to be ignored by Kodi, because nothing happens with the screen.

    When Kodi is resumed again the screen is still in the old situation.


    Code
    Macmini:~/.config/sleep.d # more /tmp/test.log
    Sending: {'content': 'Action(close)', 'type': 'action'}
    Sending: {'content': 100, 'type': 'delay'}
    Sending: {'content': 'ActivateWindow(home)', 'type': 'action'}
    Sending: {'content': 'Action(close)', 'type': 'action'}
    Sending: {'content': 100, 'type': 'delay'}
    Sending: {'content': 'ActivateWindow(home)', 'type': 'action'}

    @kdejaeger is this still working for you?


    I am using LE 9.2.0 but it doesn't work on my system.


    The kodi-send command is executed as can be seen from the output of "systemctl status":

    Code
    Mar 08 15:56:09 Macmini systemd[1]: Starting Actions before Kodi goes to sleep...
    Mar 08 15:56:10 Macmini kodi-send[929]: Sending: {'content': 'System.LogOff', 'type': 'action'}
    Mar 08 15:56:10 Macmini systemd[1]: Started Actions before Kodi goes to sleep.
    Mar 08 15:56:19 Macmini systemd[1]: kodi-sleep.service: Succeeded.
    Mar 08 15:56:19 Macmini systemd[1]: Stopped Actions before Kodi goes to sleep.


    However Kodi seems to ignore the System.LogOff command.


    Thanks,

    Jeroen

    Hi,


    Does anybody know how I can deactivate my screensaver after Kodi is resumed again after a suspend?

    The reason that I ask is that my Kodi screensaver is still active after being resumed.

    On resume I would like to execute the buit-in function "ActivateWindow(home)" in order to deactivate the screensaver.

    I created a resume script in the /storage/.config/sleep.d folder containing the command "kodi-send --action=ActivateWindow(home)", but that didnot work.

    Seems that Kodi is not active yet when the resume script gets executed. When I execute the command manually in a Putty window then the command works fine.

    Another solution might be to use the addon "Kodi Callbacks", but then I need to know which event I can use to trigger the command?

    Any help / suggestions are very much appreciated.


    Thanks,

    Jeroen

    Thanks for all your help again HiassofT. The keymap works.

    However, I never had any issues with atvclient, on the contrary it always worked perfect for me (using macmini).

    As an alternative/test I also tried to install the atvclient myself, and that also worked:

    I stored the binary in /storage/bin/atvclient

    and then created a service to start it at boottime in /storage/.config/system.d/atvclient.service

    Regards.

    Hi HiassofT ,


    Apple remote is very simple. It only has a few buttons (as shown by evtest):

    KEY_ENTER

    KEY_VOLUMEDOWN

    KEY_VOLUMEUP

    KEY_MENU

    KEY_BACK

    KEY_FORWARD

    KEY_PLAYPAUSE


    When I use the atvclient it depends on the context which action is executed when I press the up/down buttons. If playing full screen music/video then the volume is increased/decreased, but when in a menu/navigation screen then it navigates up/down.


    So I still do not understand why you use the Kodi keyboard keys instead of the Kodi remote keys in the keymap.xml ??

    I also do not understand how the device keys (as listed by evtest) gets translated into Kodi keys as used in keymap.xml ??

    My thinking was that (after reading the wiki's):

    - eventlircd maps device events to LIRC events using /etc/eventlircd.d/03_05ac_8241.evmap

    - Lircmap.xml maps LIRC events/buttons to Kodi buttons

    - keymap.xmp maps Kodi buttons to Kodi commands (Keymap - Official Kodi Wiki)


    N.B.

    I also noticed the following line in my kodi.log, which did not seem to work :

    Loading special://xbmc/system/keymaps/customcontroller.AppleRemote.xml


    However with atvclient it all worked flawlessly without any configuration.

    Is there a possibility to install the atvclient myself, or to provide it as add-on ?


    Jeroen

    HiassofT


    Hi Hias,


    I triied your keymap. The Navigation works (but different then with atvclient), but volume up/down is not working at all.


    The LIRC tool looks really complicated to me.

    I also looked into wiki pages:

    Infrared Remotes [LibreELEC.wiki]

    LIRC - Official Kodi Wiki


    It seems to me that I also need following two files configured for the remote:

    lircd.conf

    Lircmap.xml

    However these files are not present on my system in the /storage/.config or /storage/.kodi (sub)directories.

    Do I need these files or not?


    Otherwise if I cannot get it properly working with LIRC, is it possible for me to install atvclient myself?


    Thanks,

    Jeroen

    HiassofT ,


    Here is the requested output:


    journalctl ==> http://ix.io/1rls


    lsusb ==> http://ix.io/1rlu


    evtest.==> http://ix.io/1rly


    The kodi.log file I have zipped and attached, since the paste didnot work for it.


    By the way, I tried to create keymap.xml file as described here ==> Apple remote - Official Kodi Wiki

    and store it in .kodi/userdata/keymaps, but that didnot work either.


    Thanks.

    Files

    • kodi.zip

      (539.21 kB, downloaded 76 times, last: )