Read the statement by Michael Teeuw here.
Error Installing MMM-Keybindings
-
So MMM-Keybinding is working for me now with Keyboard but does not work with the Apple IR Remote
The remote is linked to /dev/input/event6 and evtest sees all the keys which I have added to the Keymap in the config, but MMM-Keybindings does not see the event (I installed MMM-ViewNotifications to see what is detected)
If I enable the keyboard MMM-Keybindings actually see some of the remotes keys but as keyboard input
I also have tried to use ip-keytable to map other keyboard keys to the rremote but ip-keytable does NOT see the remote (/sys/class/rc/rc No such file or directory), looks like the remote is recognized as keyboard input but not actually an ir remote
Anyonw has any experience with the Apple IR and how to use it in Magic Mirror?
-
@JcMarin said in Error Installing MMM-Keybindings:
Apple IR Remote
can u give more info on the remote? is this just a typical Apple tv remote?
-
Yes, this is an Apple Metalic Remote (model A-1294) and receiver is the embedded MacBook Pro IR Receiver (old MacBook Pro 15" Core 2 Duo 2.33 - late 2006)
For now, I have worked around MMM-Keybindings not seeing the remote keys by installing lirc and using irxevent to send Keys to MMM-Keybindings
This is the config I was trying:
module: “MMM-KeyBindings”,
config: {
enabledKeyStates: [“KEY_PRESSED”, “KEY_LONGPRESSED”],
evdev: { enabled: true, eventPath: “/dev/input/btremote”},
enableKeyboard: true,
KeyMap: {
Home: “KEY_HOMEPAGE”,
Enter: “KEY_ENTER”,
ArrowLeft: “KEY_LEFT”,
ArrowRight: “KEY_RIGHT”,
ArrowUp: “KEY_VOLUMEUP”,
ArrowDown: “KEY_VOLUMEDOWN”,
Menu: “KEY_MENU”,
MediaPlayPause: “KEY_PLAYPAUSE”,
MediaNextTrack: “KEY_FORWARD”,
MediaPreviousTrack: “KEY_BACK”,
Return: “KEY_BACKS”
},
actions: [{
key: “ArrowUp”,
state: “KEY_PRESSED”,
instance: “SERVER”,
mode: “DEFAULT”,
notification: “REMOTE_ACTION”,
payload: { action: “TOGGLE”, module: “module_2_clock”},
}]
}btremote is pointing to /dev/input/event6 and as I said evtest does see the remote
I also tried ir-keytables but although I can force it to look at the event6 dev there is no /dev/rc directory and it gives an error
I guess lirc is not a bad solution while combining it with MMM_Keybindings, little more work and things to configure but I could not get it to work directly
-
SOLVED
I finally figured out why MMM-Keybindings was not seeing the remote, after looking at some logs from pm2 I saw some errors reporting no permission to open /dev/input/btremote (which points to /dev/input/event6)
After further troubleshooting, I saw that the MM process in PM2 for some reason was not running as root
I recreated the pm2 startup script
pm2 startup
and that fixed the permissions and now MMM-Keybindings sees the remote clicks no problem.thought to post in case this could help someone with same problem
-
@JcMarin nice debugging!!!.. thanks for the update… others will find this useful.