Page 1 of 2

ES Favorites not saving

Posted: Sat Feb 17, 2018 5:33 pm
by SuperOldboy
Hey,
when I add a game to my favorites it shows up there but when I restart my GBZ they are all gone. All I found was setting the "save metadata on exit" in "other settings" to ON, but this didn´t help. Couldn´t find any other solutions in the internet.
Thanks.

Re: ES Favorites not saving

Posted: Sat Feb 17, 2018 7:33 pm
by McGyver
Do you shut down your Gameboy by the SafeShutdown board feature? I recogniced a similar problem then. Try to shut down by the EmulationStation software. In my case this safes the last played games in the list.

Re: ES Favorites not saving

Posted: Sun Feb 18, 2018 2:06 pm
by SuperOldboy
McGyver wrote:
Sat Feb 17, 2018 7:33 pm
Do you shut down your Gameboy by the SafeShutdown board feature? I recogniced a similar problem then. Try to shut down by the EmulationStation software. In my case this safes the last played games in the list.
Yes when i shutdown via the ES menu it saves it. I use the normal power switch at the top, i´ve got the CSO.

Re: ES Favorites not saving

Posted: Sun Feb 18, 2018 11:28 pm
by McGyver
I thing it's part of how Emulation Station works:
-During shutdown procedure last settings are saved.
-If shutdown via safe-shutdown cirquit linux initiates shutdown and just closes all runnings application.

Could be improved by adding to the shutdown command something that saved last settings from emulationstation.

Re: ES Favorites not saving

Posted: Mon Feb 19, 2018 4:15 am
by SuperOldboy
McGyver wrote:
Sun Feb 18, 2018 11:28 pm
I thing it's part of how Emulation Station works:
-During shutdown procedure last settings are saved.
-If shutdown via safe-shutdown cirquit linux initiates shutdown and just closes all runnings application.

Could be improved by adding to the shutdown command something that saved last settings from emulationstation.
And where or what should i add?

i´ve found this but i don´t know how to do it. https://retropie.org.uk/forum/topic/128 ... m-shutdown

Re: ES Favorites not saving

Posted: Mon Feb 19, 2018 6:12 am
by McGyver
Nice research! This link explains exactly the situation we are talking about.
I will install this during the next days and report if it works. Should be all being possible by the terminal connected via SSH.

Re: ES Favorites not saving

Posted: Mon Feb 19, 2018 8:09 am
by SuperOldboy
McGyver wrote:
Mon Feb 19, 2018 6:12 am
Nice research! This link explains exactly the situation we are talking about.
I will install this during the next days and report if it works. Should be all being possible by the terminal connected via SSH.
Ok, if it works could you be so kind an write me a step by step tutorial? :oops: :roll:

Re: ES Favorites not saving

Posted: Tue Feb 20, 2018 8:12 am
by McGyver
First of all: the description in https://retropie.org.uk/forum/topic/128 ... m-shutdown works with some adaptation because the folder /etc looks to be root owned so all files have to be created by using sudo. Just one disadvantage: the shutdown procedure needs about 10 seconds longer! During shutdown the pi jumps to the terminal prompt but the shutdown goes on after maybe 10 sec. This is maybe due to the sleep routines used in the script.
And: the BBCode masses up a little here on the forum website. Maybe better copy the scripts from the external link on retropie.org!

Here a short tutorial for installing this software. General explanation: inside the terminal send: means copy or typing the text behind the send:_ contend and press ENTER.

Open your terminal and SSH into your pi:

send: ssh pi@192.168.xxx.xxx

type your password if your are asked for. The standard passwd should be raspberry, buy the way: please change it!

maybe security warning appears: „Are you sure you want to continue connecting (yes/#no)?“

send: yes

in the terminal send: pwd to know where you arrived in the filesystem.
In my case it is /home/pi

So I need send two times the command cd .. press ENTER KEY cd .. press ENTER KEY to arrive in the root directory. You can send dir to list all sub folders. This search should include the /etc directory we are looking for.

send: cd etc to go into /etc directory

send: sudo nano killes.sh

paste into the editor:

#!/bin/bash

# Check if EmulationStation is running. Finish the script if doesn't.
espid="$(pgrep -f "/opt/retropie/supplementary/.*/emulationstation([^.]|$)")" || exit 0

# the "sed" command below isn't a crypted message, it's just a trick to
# make $emucall regex-safe to use in the "pgrep -f" below.
emucall="$(sed '4!d; s/\([\\"]\|[[:alnum:]_]\+=[^ ]* \)//g; s/[][(){}^$*.|+? ]/\\&/g' /dev/shm/runcommand.info)"

# If there's an emulator running, we need to kill it and go back to ES
if [[ -n "$emucall" ]]; then
emupid="$(pgrep -f "$emucall" | tr '\n' ' ')"
pkill -P "$(echo $emupid | tr ' ' ',')"
kill "$emupid"
wait "$emupid"
sleep 5 # maybe it can be lesser
fi

kill "$espid"
wait "$espid"
sleep 5 # maybe it can be lesser

press control+x / press y / press enter after confirming the file name will be saved as killes.sh

send: sudo chmod a+x /etc/killes.sh
send: cd systemd/system
send: sudo nano killes.service

paste into the editor:

[Unit]
Description=Kill EmulationStation
After=autologin@tty1.service

[Service]
Type=oneshot
RemainAfterExit=true
ExecStop=/etc/killes.sh

[Install]
WantedBy=multi-user.target

press control+x / press y / press enter after confirming the file name will be saved as killes.service

send: sudo systemctl enable killes

Done! Try some shutdown commands via terminal or safe-shutdown switch feature to see if it works. I tested it with the lasted played feature in emulationstation which is now being saved.

Re: ES Favorites not saving

Posted: Tue Feb 20, 2018 8:32 am
by SuperOldboy
McGyver wrote:
Tue Feb 20, 2018 8:12 am
First of all: the description in https://retropie.org.uk/forum/topic/128 ... m-shutdown works with some adaptation because the folder /etc looks to be root owned so all files have to be created by using sudo. Just one disadvantage: the shutdown procedure needs about 10 seconds longer! During shutdown the pi jumps to the terminal prompt but the shutdown goes on after maybe 10 sec. This is maybe due to the sleep routines used in the script.
And: the BBCode masses up a little here on the forum website. Maybe better copy the scripts from the external link on retropie.org!

Here a short tutorial for installing this software. General explanation: inside the terminal send: means copy or typing the text behind the send:_ contend and press ENTER.

Open your terminal and SSH into your pi:

send: ssh pi@192.168.xxx.xxx

type your password if your are asked for. The standard passwd should be raspberry, buy the way: please change it!

maybe security warning appears: „Are you sure you want to continue connecting (yes/#no)?“

send: yes

in the terminal send: pwd to know where you arrived in the filesystem.
In my case it is /home/pi

So I need send two times the command cd .. press ENTER KEY cd .. press ENTER KEY to arrive in the root directory. You can send dir to list all sub folders. This search should include the /etc directory we are looking for.

send: etc to go into /etc directory

send: sudo nano killes.sh

paste into the editor:

#!/bin/bash

# Check if EmulationStation is running. Finish the script if doesn't.
espid="$(pgrep -f "/opt/retropie/supplementary/.*/emulationstation([^.]|$)")" || exit 0

# the "sed" command below isn't a crypted message, it's just a trick to
# make $emucall regex-safe to use in the "pgrep -f" below.
emucall="$(sed '4!d; s/\([\\"]\|[[:alnum:]_]\+=[^ ]* \)//g; s/[][(){}^$*.|+? ]/\\&/g' /dev/shm/runcommand.info)"

# If there's an emulator running, we need to kill it and go back to ES
if [[ -n "$emucall" ]]; then
emupid="$(pgrep -f "$emucall" | tr '\n' ' ')"
pkill -P "$(echo $emupid | tr ' ' ',')"
kill "$emupid"
wait "$emupid"
sleep 5 # maybe it can be lesser
fi

kill "$espid"
wait "$espid"
sleep 5 # maybe it can be lesser

press control+x / press y / press enter after confirming the file name will be saved as killes.sh

send: sudo chmod a+x /etc/killes.sh
send: cd systemd/system
send: sudo nano killes.service

paste into the editor:

[Unit]
Description=Kill EmulationStation
After=autologin@tty1.service

[Service]
Type=oneshot
RemainAfterExit=true
ExecStop=/etc/killes.sh

[Install]
WantedBy=multi-user.target

press control+x / press y / press enter after confirming the file name will be saved as killes.service

send: sudo systemctl enable killes

Done! Try some shutdown commands via terminal or safe-shutdown switch feature to see if it works. I tested it with the lasted played feature in emulationstation which is now being saved.


Nice! Thank you i'm gonna try it out later today :)

Re: ES Favorites not saving

Posted: Wed Feb 21, 2018 7:30 am
by SuperOldboy
McGyver wrote:
Tue Feb 20, 2018 8:12 am
First of all: the description in https://retropie.org.uk/forum/topic/128 ... m-shutdown works with some adaptation because the folder /etc looks to be root owned so all files have to be created by using sudo. Just one disadvantage: the shutdown procedure needs about 10 seconds longer! During shutdown the pi jumps to the terminal prompt but the shutdown goes on after maybe 10 sec. This is maybe due to the sleep routines used in the script.
And: the BBCode masses up a little here on the forum website. Maybe better copy the scripts from the external link on retropie.org!

Here a short tutorial for installing this software. General explanation: inside the terminal send: means copy or typing the text behind the send:_ contend and press ENTER.

Open your terminal and SSH into your pi:

send: ssh pi@192.168.xxx.xxx

type your password if your are asked for. The standard passwd should be raspberry, buy the way: please change it!

maybe security warning appears: „Are you sure you want to continue connecting (yes/#no)?“

send: yes

in the terminal send: pwd to know where you arrived in the filesystem.
In my case it is /home/pi

So I need send two times the command cd .. press ENTER KEY cd .. press ENTER KEY to arrive in the root directory. You can send dir to list all sub folders. This search should include the /etc directory we are looking for.

send: cd etc to go into /etc directory

send: sudo nano killes.sh

paste into the editor:

#!/bin/bash

# Check if EmulationStation is running. Finish the script if doesn't.
espid="$(pgrep -f "/opt/retropie/supplementary/.*/emulationstation([^.]|$)")" || exit 0

# the "sed" command below isn't a crypted message, it's just a trick to
# make $emucall regex-safe to use in the "pgrep -f" below.
emucall="$(sed '4!d; s/\([\\"]\|[[:alnum:]_]\+=[^ ]* \)//g; s/[][(){}^$*.|+? ]/\\&/g' /dev/shm/runcommand.info)"

# If there's an emulator running, we need to kill it and go back to ES
if [[ -n "$emucall" ]]; then
emupid="$(pgrep -f "$emucall" | tr '\n' ' ')"
pkill -P "$(echo $emupid | tr ' ' ',')"
kill "$emupid"
wait "$emupid"
sleep 5 # maybe it can be lesser
fi

kill "$espid"
wait "$espid"
sleep 5 # maybe it can be lesser

press control+x / press y / press enter after confirming the file name will be saved as killes.sh

send: sudo chmod a+x /etc/killes.sh
send: cd systemd/system
send: sudo nano killes.service

paste into the editor:

[Unit]
Description=Kill EmulationStation
After=autologin@tty1.service

[Service]
Type=oneshot
RemainAfterExit=true
ExecStop=/etc/killes.sh

[Install]
WantedBy=multi-user.target

press control+x / press y / press enter after confirming the file name will be saved as killes.service

send: sudo systemctl enable killes

Done! Try some shutdown commands via terminal or safe-shutdown switch feature to see if it works. I tested it with the lasted played feature in emulationstation which is now being saved.


Hm i did everything as you said but it didn't work. I also took the code from the link. Also the shutdown didn't take longer at all. Any idea i what i did wrong? :oops: