Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    May 2019
    Posts
    27

    Trying to add GPIO controls - anyone managed to build/run/use PiKeyD on PiCorePlayer?

    If so how did you do it? I'm trying to use GPIO controls for Jivelite as seen here:



    But pikeyd https://github.com/dozencrows/pikeyd is required.

    I have no idea where to start, I could probably manage to build it on Rasbian, but with PiCorePlayer I'm not sure what the build / compile process is.

  2. #2
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    There's a tool called sbpd (SqueezeButtonPi Daemon) available in pCP. It can call specific LMS functions, as well as calling scripts to do non-LMS functions.

  3. #3
    Junior Member
    Join Date
    May 2019
    Posts
    27
    Quote Originally Posted by chill View Post
    There's a tool called sbpd (SqueezeButtonPi Daemon) available in pCP. It can call specific LMS functions, as well as calling scripts to do non-LMS functions.
    Hi, thank yes I've tried SqueezeButtonPi Daemon and I was able to get it do LMS functions, I could control the volume OK.

    However I didn't know it could calling scripts to do non-LMS functions, is there a script or functions that could simulate a keyboard keypress?

    I'm trying to control Jivelite.

  4. #4
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    Quote Originally Posted by TheHypnoToad View Post
    ... is there a script or functions that could simulate a keyboard keypress?

    I'm trying to control Jivelite.
    Good question. Probably. Not sure - I don't do that myself. I use an IR remote to control Jiivelite on my HDMI TV, and sbpd to issue basic LMS commands: play, next, shuffle, stop, vol+/- etc.

  5. #5
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    2,298
    Quote Originally Posted by TheHypnoToad View Post
    Hi, thank yes I've tried SqueezeButtonPi Daemon and I was able to get it do LMS functions, I could control the volume OK.

    However I didn't know it could calling scripts to do non-LMS functions, is there a script or functions that could simulate a keyboard keypress?

    I'm trying to control Jivelite.
    Several have talked about it, but not sure if anyone ever got it working. Some of the keypress emulators need an actual keyboard connected.

    I think I would look at the gpio-key overlay.....
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  6. #6
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    xdotool can apparently emulate keyboard presses, so I guess it would be possible to make a script to emulate a single keypress, e.g. press_UP.sh, that corresponds to one of the Jivelite keys, and then call that script from an sbpd command.

    Given that it's an X11 automation tool, will it require any other X11 components to be loaded? If so, it's probably a non-starter for pCP. I was going to try it out, but xdotool.tcz isn't yet in either of the repositories available to pCP5. Paul - any chance you could pull it across from the repository that pCP4 uses?
    Last edited by chill; 2019-08-05 at 10:47.

  7. #7
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    Quote Originally Posted by chill View Post

    Given that it's an X11 automation tool, will it require any other X11 components to be loaded? If so, it's probably a non-starter for pCP.
    I tried xdotool under pCP4 - couldn't get it to work. I think it's only going to work if Jivelite is run under an X window, so a non-starter for a typical pCP setup.

    As you were.

  8. #8
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    Quote Originally Posted by paul- View Post

    I think I would look at the gpio-key overlay.....
    This works very nicely. I edited config.txt in the mmcblk0p1 partition to include these lines in the Custom Configuration Area at the end:

    Code:
    #Custom Configuration Area, for config settings that are not managed by pCP.
    #pCP will retain these settings during insitu-update
    #---Begin-Custom-(Do not alter Begin or End Tags)-----
    dtoverlay=gpio-key,gpio=23,keycode=108 # KEY_DOWN
    dtoverlay=gpio-key,gpio=12,keycode=103 # KEY_UP
    dtoverlay=gpio-key,gpio=25,keycode=105 # KEY_LEFT
    dtoverlay=gpio-key,gpio=22,keycode=106 # KEY_RIGHT
    #---End-Custom----------------------------------------
    The keycodes came from here. This configured four of my buttons to give me the basic arrow keys, which is all that's really needed to navigate Jivelite.

  9. #9
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,335
    I added a couple more 'convenience' functions to use up all six buttons on my button board:

    Code:
    dtoverlay=gpio-key,gpio=23,keycode=108 # KEY_DOWN
    dtoverlay=gpio-key,gpio=12,keycode=103 # KEY_UP
    dtoverlay=gpio-key,gpio=25,keycode=105 # KEY_LEFT
    dtoverlay=gpio-key,gpio=22,keycode=106 # KEY_RIGHT
    dtoverlay=gpio-key,gpio=24,keycode=27  # KEY_RIGHTBRACE (go_playlist)
    dtoverlay=gpio-key,gpio=27,keycode=26  # KEY_LEFTBRACE  (go_now_playing)

  10. #10
    Junior Member
    Join Date
    May 2019
    Posts
    27
    Quote Originally Posted by paul- View Post
    I think I would look at the gpio-key overlay.....
    I've managed to get a few buttons working using the gpio-key overlay, it's working great for the buttons.

    I do have a rotary-encoder also, and there seems to be rotary_encoder kernel module also, documented here, once I get the module added it won't emulate a keyboard however so I may have to tinker with jivelite a little in order for it to see the encoder.

    Even just having the buttons working for now it great. Thanks!

    Quote Originally Posted by chill View Post
    I added a couple more 'convenience' functions to use up all six buttons on my button board:
    Thanks, the examples are big help. I'll add a few extra I'm using also:

    Code:
    dtoverlay=gpio-key,gpio=12,keycode=57 # KEY_SPACE - play/pause
    dtoverlay=gpio-key,gpio=26,keycode=16 # Q - power on/off
    So far so good and seems more responsive than sbpd too.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •