[Tutorial] Kite's Circuit board RetroPie menu item for Kite HUD update

Post Reply
User avatar
diko_d
Posts: 33
Joined: Mon May 08, 2017 5:18 pm
Has thanked: 27 times
Been thanked: 18 times

[Tutorial] Kite's Circuit board RetroPie menu item for Kite HUD update

Post by diko_d » Thu Mar 14, 2019 7:43 pm

First off, AMAZING boards by Kite in this community!!!

In addition, Kite has a great update utility for his HUD software. However, in most cases users don't have a keyboard at hand with hand-held devices and even with the (awesome!) on screen keyboard, it is not that easy to access the update script.

So, after a bit of digging around and playing with it, I figured out a simple way to add the HUD update functionality to RetroPie's main menu. I figured this might be very useful for others so I'll post the procedure here. @kite, maybe you'll even consider having this as part of your image? :shock: 8-)
IMG_3637.jpeg
IMG_3637.jpeg (2.41 MiB) Viewed 3122 times
You two options for installation:
- You can run the automated install using info in this repo: https://github.com/dikodahan/cs-hud-shortcuts. This will take care of everything listed below and you do not need to continue with this tutorial.
- You can follow the manual process listed here if you wish so.

You will need to SSH into your Circuit Gem/Sword to get this set up once. In my specific example, this is a Circuit Gem, but aside from some minor variations I will note below, the process is the same.
  1. First off, you will need to copy this image file here to your PC. Make sure it is saved as kite.png
    kite.png
    kite.png (61.01 KiB) Viewed 3179 times
  2. SSH to your Kite board.
  3. Go into the retromenu directory. Any sh file in this directory will automatically show up in RetroPie configuration menu.

    Code: Select all

    cd RetroPie/retropiemenu/
  4. Create a new shell script file to launch the script.

    Code: Select all

    nano kite-update.sh
  5. Paste the following lines in the file.

    Code: Select all

    #!/bin/bash
    
    if [[ -d "${HOME}/Circuit-Gem" ]]; then
      cd ~/Circuit-Gem
      sudo ./update.sh
    elif [[ -d "${HOME}/Circuit-Sword" ]]; then
      cd ~/Circuit-Sword
      sudo ./update.sh
    elif [[ -d "${HOME}/Circuit-Sword-Lite" ]]; then
      cd ~/Circuit-Sword-Lite
      sudo ./update.sh
    fi
  6. To save the file press Ctrl+x, Then y and then press Enter.
  7. Make the shell script executable:

    Code: Select all

    chmod +x kite-update.sh
  8. Now we need to update the RetroPie configuration menu to add this item properly.

    Code: Select all

    sudo nano /opt/retropie/configs/all/emulationstation/gamelists/retropie/gamelist.xml
  9. Scroll all the way down to the end of the file and just above the last line </gameList> add the following lines.

    Code: Select all

    <game>
            <path>./kite-update.sh</path>
            <name>Kite HUD Update</name>
            <desc>Installs available updates to Kite's HUD software.</desc>
            <image>./icons/kite.png</image>
    </game>
  10. To save the file press Ctrl+x, Then y and then press Enter.
  11. Close the SSH connection.
  12. Now you need to copy the kite.png file over to the following directory on your Circuit board: /home/pi/RetroPie/retropiemenu/icons
    I will not cover how to copy a file over to RetroPie from a PC or a Mac in this tutorial. You can easily google this part.
  13. From your HUD software perform a proper shutdown and turn your hand-held back on. You now have the update command easily accessible from RetroPie menu!!!
Last edited by diko_d on Tue May 07, 2019 7:22 am, edited 9 times in total.

User avatar
Ziggurat
Posts: 19
Joined: Tue Sep 20, 2016 1:11 am
Has thanked: 1 time
Been thanked: 4 times

Re: [Tutorial] Kite's Circuit board RetroPie menu shortcut

Post by Ziggurat » Fri Mar 15, 2019 2:33 am

I haven't tested it, please come with code review :D But this script should work for all situations.
run the install routine by having install as the first argument, (I haven't tested the sed command where it adds the xml section!), and it should find and update whichever folder of the three you installed the driver to?

Or am I missing something? are all three installed on all devices?

Should just be to ssh into raspberry

Code: Select all

cd RetroPie/retropiemenu/
wget https://gist.githubusercontent.com/sigboe/972d5f94ad54bba9e89eff5e3e2173a6/raw/85a130b32708f4a08810a81ac1382a50ce0ccdee/kite-update.sh
chmod +x kite-update.sh
./kite-update.sh install

Code: Select all

#!/bin/env bash
# adapted from diko_d scripts

if [[ "${1}" == "install" ]]; then
    if grep -Fxq "kite-update.sh" /opt/retropie/configs/all/emulationstation/gamelists/retropie/gamelist.xml; then

        kitesection=$(
            cat <<_END_
<game>
        <path>./kite-update.sh</path>
        <name>Circuit-Gem Update</name>
        <desc>Installs available updates to Kite's HUD software.</desc>
        <image>./icons/kite.png</image>
</game>
_END_
        )

        wget -O "/home/pi/RetroPie/retropiemenu/icons/kite.png" "https://sudomod.com/forum/download/file.php?id=14616&sid=2e5f7e8dbe357a42a9dd1c4669a3dbb9"
        sed -i "/\<\/gameList\>\n/a ${kitesection}" /opt/retropie/configs/all/emulationstation/gamelists/retropie/gamelist.xml
    fi
fi

if [[ -d "${HOME}/Circuit-Gem" ]]; then
    sudo "${HOME}/Circuit-Gem/update.sh"
elif [[ -d "${HOME}/Circuit-Sword" ]]; then
    sudo "${HOME}/Circuit-Sword/update.sh"
elif [[ -d "${HOME}/Circuit-Sword-Lite" ]]; then
    sudo "${HOME}/Circuit-Sword-Lite/update.sh"
else
    echo "It doesn't seam that Cirtcuit Sword drivers are installed."
fi
Pi3 in DMG-01 project https://goo.gl/Ax84Bf
(no pictures thus far, ordered most parts, waiting for them)

User avatar
diko_d
Posts: 33
Joined: Mon May 08, 2017 5:18 pm
Has thanked: 27 times
Been thanked: 18 times

Re: [Tutorial] Kite's Circuit board RetroPie menu shortcut

Post by diko_d » Fri Mar 15, 2019 12:11 pm

Ziggurat wrote:
Fri Mar 15, 2019 2:33 am
I haven't tested it, please come with code review :D But this script should work for all situations.
run the install routine by having install as the first argument, (I haven't tested the sed command where it adds the xml section!), and it should find and update whichever folder of the three you installed the driver to?

Or am I missing something? are all three installed on all devices?

Should just be to ssh into raspberry

Code: Select all

cd RetroPie/retropiemenu/
wget https://gist.githubusercontent.com/sigboe/972d5f94ad54bba9e89eff5e3e2173a6/raw/85a130b32708f4a08810a81ac1382a50ce0ccdee/kite-update.sh
chmod +x kite-update.sh
./kite-update.sh install

Code: Select all

#!/bin/env bash
# adapted from diko_d scripts

if [[ "${1}" == "install" ]]; then
    if grep -Fxq "kite-update.sh" /opt/retropie/configs/all/emulationstation/gamelists/retropie/gamelist.xml; then

        kitesection=$(
            cat <<_END_
<game>
        <path>./kite-update.sh</path>
        <name>Circuit-Gem Update</name>
        <desc>Installs available updates to Kite's HUD software.</desc>
        <image>./icons/kite.png</image>
</game>
_END_
        )

        wget -O "/home/pi/RetroPie/retropiemenu/icons/kite.png" "https://sudomod.com/forum/download/file.php?id=14616&sid=2e5f7e8dbe357a42a9dd1c4669a3dbb9"
        sed -i "/\<\/gameList\>\n/a ${kitesection}" /opt/retropie/configs/all/emulationstation/gamelists/retropie/gamelist.xml
    fi
fi

if [[ -d "${HOME}/Circuit-Gem" ]]; then
    sudo "${HOME}/Circuit-Gem/update.sh"
elif [[ -d "${HOME}/Circuit-Sword" ]]; then
    sudo "${HOME}/Circuit-Sword/update.sh"
elif [[ -d "${HOME}/Circuit-Sword-Lite" ]]; then
    sudo "${HOME}/Circuit-Sword-Lite/update.sh"
else
    echo "It doesn't seam that Cirtcuit Sword drivers are installed."
fi
Thanks for the help!
Unfortunately, your suggested sed commands are not complete, but that's perfectly fine as you mentioned that they ere untested :)
I have update the guide with a link to a repo that takes care of everything. Thanks for pushing me to do so!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest