Page 2 of 3

Re: 2.4GHz Airmouse as remote

PostPosted: 04 Aug 2017, 16:20
by SlF
yeongheon wrote:Hi,
I am trying to setup 2.4GHz Airmouse too. According to your guide, I installed empcd and base-devel. And it seems that the Airmouse remote identified. But only volumeup and down are working.

So, I need to find Key name of mouse button to describe in empcd.conf. But I dont know.

How can I get the Keyname?


I posted a guide on my website. It's in German. You may want to use google translator.
https://ole-hellmers.de/2017/03/24ghz-f ... runeaudio/

https://translate.google.de/translate?s ... t=&act=url

best regards

ole

Re: 2.4GHz Airmouse as remote

PostPosted: 05 Aug 2017, 07:30
by yeongheon
Thanks, SIF


I found that my AirMouse already working with runeaudio(raspberry pi3) as mouse before installing empcd. especially volumeup/down.
I guess that it should be disabled for using mpd remote control. But i dont know how.

it is my airmouse.
https://www.aliexpress.com/item/Free-Sh ... 0.0.ODnJoJ

Please help me to use this remote control for runeaudio. and the airmouse could not be used for runeaudio remote?

Mentioned from SIF, background service for empcd did not working properly. Once I opened terminal and login the runeaudio, and run command "empcd -f", it is working perfectly during the command(empcd -f) is running.

Re: 2.4GHz Airmouse as remote

PostPosted: 11 Aug 2017, 10:52
by SlF
yeongheon wrote:Thanks, SIF


I found that my AirMouse already working with runeaudio(raspberry pi3) as mouse before installing empcd. especially volumeup/down.
I guess that it should be disabled for using mpd remote control. But i dont know how.

it is my airmouse.
https://www.aliexpress.com/item/Free-Sh ... 0.0.ODnJoJ

Please help me to use this remote control for runeaudio. and the airmouse could not be used for runeaudio remote?


You need to control MPD in order to control Runeaudio. Runeaudio gets the current status of MPD and displays it.
Focus on the last part of my guide:
"Mit evtest habe ich ausmachen können, welche Signale die Tastatur sendet."
You need to use evtest to find out the commands, that your remote is sending.
e.g. "KEY_HOMEPAGE" which is the home button. Just press a button and see what key gets send. "UP" "DOWN" "REPEAT" means if the button is pressed, released or hold.

You may want to use my config file, most buttons should work since our remotes are very similar.

Edit: since there is no mouse in shell you don't need to disable the air mouse function. Just use the keys.

Code: Select all
##################################################
# ecmpd.conf by Jeroen Massar <jeroen@massar.ch>
# Example empcd configuration file
#
# Lines starting with ‚#‘ or ‚//‘ are comment lines
# Repeating spaces and tabs are trimmed
##################################################

##################################################
# MPD settings
##################################################
# Run empcd under the ‚mpd‘ account
user mpd

# mpd_host [<password>@]<host> (defaults to „localhost“)
mpd_host localhost

# mpd_port <port> (defaults to 6600)
mpd_port 6600

# Device to read events from
//eventdevice /dev/input/event0

# Exclusive (default) / Non-Exclusive device access
//exclusive

##################################################
# Key configuration
##################################################
#
# key <key-id> up|down|repeat <function> [arguments]
#
# down   = key gets pressed down
# up     = key goes up (after being pressed down)
# repeat = key is kept down and sends repeat events
#
# functions (also see ‚empcd –list-functions‘):
# exec <shellcmd>       Execute a shell command (eg exec mount /dev/sdb2 /mnt)
# mpd_next              MPD Next Track
# mpd_play              MPD Previous Track
# mpd_stop              MPD Stop Playing
# mpd_play              MPD Start Playing
# mpd_pause [on|off]    MPD Pause Toggle (no options) or set
# mpd_seek              MPD Seek
#                       „mpd_seek 0“   – begin of track
#                       „mpd_seek 100“ – begin of track
#                       „mpd_seek +10“ – advance 10 seconds
#                       „mpd_seek -20“ – backward 20 seconds
# mpd_random            MPD Random Toggle (no options) or set
#
#
###################################################
# Play/Pause
key KEY_ENTER             UP      mpd_pause
key KEY_MUTE    UP    mpd_play
key KEY_POWER    UP    mpd_stop

# Prev/Next
key KEY_LEFT         UP      mpd_prev
key KEY_RIGHT          UP      mpd_next

# Volume
key KEY_VOLUMEDOWN    DOWN    mpd_volume -5%
key KEY_VOLUMEUP      DOWN    mpd_volume +5%
key KEY_VOLUMEDOWN    REPEAT    mpd_volume -1%
key KEY_VOLUMEUP    REPEAT    mpd_volume +1%

# key KEY_MUTE    UP    mpd_volume -100%

# Seek to the beginning of the current song
key KEY_HOMEPAGE       UP      mpd_seek 0

#  2 seconds back/forward on 1 hit,
# 10 seconds back/forward when holding
key KEY_DOWN         UP      mpd_seek -2
key KEY_DOWN         REPEAT  mpd_seek -10
key KEY_UP      UP      mpd_seek +2
key KEY_UP      REPEAT  mpd_seek +10

Re: 2.4GHz Airmouse as remote

PostPosted: 19 Aug 2017, 03:05
by yeongheon
Hi, SIF

Thanks your kindly guide.

And I would like to ask about "empcd in daemon not working".
Does it need start manually yet? or Resolve it?


Regards
Yeong

Re: 2.4GHz Airmouse as remote

PostPosted: 05 Oct 2017, 20:46
by SlF
yeongheon wrote:Hi, SIF

Thanks your kindly guide.

And I would like to ask about "empcd in daemon not working".
Does it need start manually yet? or Resolve it?


Regards
Yeong


Hi! Sorry for the very late reply!
yeah... I haven't figured out how to get the daemon working yet...

empcd -d

run this command after every reboot.

regards

Re: 2.4GHz Airmouse as remote

PostPosted: 05 Oct 2017, 21:16
by hondagx35
Hi,

starting it after each boot should be straightforward.
Rune uses systemd to handle services so you need a service file (https://github.com/massar/empcd/blob/master/debian/empcd.service) .

Try:
Code: Select all
systemctl enable empcd.service

and reboot.

Frank

Re: 2.4GHz Airmouse as remote

PostPosted: 06 Oct 2017, 12:43
by SlF
hondagx35 wrote:Hi,

starting it after each boot should be straightforward.
Rune uses systemd to handle services so you need a service file (https://github.com/massar/empcd/blob/master/debian/empcd.service) .

Try:
Code: Select all
systemctl enable empcd.service

and reboot.

Frank


Did that. It worked for one reboot and stopped working.

Re: 2.4GHz Airmouse as remote

PostPosted: 06 Oct 2017, 13:57
by hondagx35
Hi,

you can check the status with:
Code: Select all
systemctl status empcd.service

this should give you also some debugging info.

If
Code: Select all
systemctl restart empcd.service

works, then you have a timing issue.

Frank

Re: 2.4GHz Airmouse as remote

PostPosted: 07 Oct 2017, 12:26
by SlF
hondagx35 wrote:Hi,

you can check the status with:
Code: Select all
systemctl status empcd.service

this should give you also some debugging info.

If
Code: Select all
systemctl restart empcd.service

works, then you have a timing issue.

Frank


* empcd.service - Startup empcd
Loaded: loaded (/usr/lib/systemd/system/empcd.service; enabled)
Active: inactive (dead) since Thu 1970-01-01 01:00:10 CET; 47 years 9 months ago
Main PID: 117 (code=exited, status=0/SUCCESS)

:shock: :shock:

Re: 2.4GHz Airmouse as remote

PostPosted: 07 Oct 2017, 15:01
by hondagx35
Hi,

for me it looks like a timing issue.
Seems like it gets started before mpd and then exits because no server is available.

Please try to modify the empcd.service file :
Code: Select all
[Unit]
Description=Event Music Player Client daemon
After=network.target sound.target mpd.service
Requires=mpd.service

[Service]
Type=simple
ExecStart=/usr/sbin/empcd
# restart the service if it stops for any failure
Restart=on-failure

[Install]
WantedBy=default.target


Frank