Motorola Nyxboard – How to configure OS for use power button to shutdown?
#1
Here is a topic about the power button of the Motorola Nyxboard. Like redvenomweb & eihänder (on this post http://forum.xbmc.org/showthread.php?tid=80968) my pc doesn’t react to power button.

For power down:
I tried eihänder’s solution (http://forum.xbmc.org/showpost.php?p=910...tcount=460), but I miss something.
  • I don’t know where the logs he is talking about are.
  • Its look like my config_acpi_button is at yes (by default).
  • Acpid is running (I can see it in running “ps ax”Wink.
    Quote:>ps ax | grep acpi
    acpid –c /etc/acpi/events –s /var/run/acpid.socket
  • I configured the “etc/acpi/events/nyxboard”
  • But how to configure the listener? I tried “acpi-listen” but there are no reaction when the power button is press (or any button), is it normal?
    I tried
    Quote:>tail –f /var/log/messages |grep “ACPI event”
    and press power button but no reaction

For power “on”:
I guess is the same I need to use acpi and choose to witch button react? For now the pc wakes up when I press any button (or move the remote).

I’m on Ubuntu 10.04 and my kernel is 2.6.32-33 (with XBMC 10.1).
Reply
#2
I have a standard MCE remote right now, but is close to buy the Nyxboard because it uses RF and have a keyboard.

Anyway, back to the problem. To get the MCE remote to power on a Mac Mini running mythbuntu I had to enable all EHCx and OHCx in /proc/acpi/wakeup. They may have different names on your media center box. You can run cat /proc/acpi/wakeup to get the USB port names and state. To temporarily enable a USB port run echo EHC1 > /proc/acpi/wakeup.

This is what I have in /etc/rc.local before exit 0

ethtool -s eth0 wol umbg

echo EC > /proc/acpi/wakeup
echo OHC1 > /proc/acpi/wakeup
echo OHC2 > /proc/acpi/wakeup
echo EHC1 > /proc/acpi/wakeup
echo EHC2 > /proc/acpi/wakeup

This will ensure USB devices, including the USB remote receiver, has power when the box is in sleep mode. The ethtool is for remote wakeup.

For power off I found the power button in the xev program and added it to ~/.xbmc/userdata/keymaps/keyboard.xml as Suspend.

Example:
<keymap>
<global>
<keyboard>
<!-- My settings -->
<f4 mod="alt">Suspend</f4>

The MCE remote sends ALT+F4 when pushing the power button.

As my MCE remote sends keyboard signals it should theoretically also work for the Nyxboard remote.

I hope it helps.
Reply
#3
Alktlr thank you for your answer! Sorry to answer so late.

I tried your solution :
Quote:To get the MCE remote to power on a Mac Mini running mythbuntu I had to enable all EHCx and OHCx in /proc/acpi/wakeup. They may have different names on your media center box. You can run cat /proc/acpi/wakeup to get the USB port names and state.
nb: On my pc it is USBx

In pressing Alt + F4 (on my keyboard :-$) it suspends … but wakes up immediately. Which is strange because when I ‘let’ it sleep after inactivity there is no problems of suspension.
So I tried to use Hibernate mode way the keyword “Hibernate” instead of “Suspend” and wake up in the same way.

Here are an extract of /var/log/syslog :
Code:
Oct 24 11:38:14 localhost kernel: [   56.392901] PM: Entering mem sleep
Oct 24 11:38:14 localhost kernel: [   56.392922] Suspending console(s) (use no_console_suspend to debug)
Oct 24 11:38:14 localhost kernel: [   56.393288] pm_op(): usb_dev_suspend+0x0/0x20 returns -2
Oct 24 11:38:14 localhost kernel: [   56.393294] PM: Device usb6 failed to suspend: error -2
Oct 24 11:38:14 localhost kernel: [   56.393298] PM: Some devices failed to suspend
Oct 24 11:38:14 localhost kernel: [   56.393366] PM: resume of devices complete after 0.062 msecs
Oct 24 11:38:14 localhost kernel: [   56.552150] PM: resume devices took 0.160 seconds
Oct 24 11:38:14 localhost kernel: [   56.552183] PM: Finishing wakeup.
Oct 24 11:38:14 localhost kernel: [   56.552187] Restarting tasks ... done.

There is no error in /var/log/pm-suspend.log : but I can add it if it's useful?

Furthermore it is not exactly what I want to do : I want to suspend the pc when I press on the « power button » not on other customized button (ideally).

Thanks in advance,
Reply
#4
Hi,

Now I am able to suspend the pc without instantly wake up :-) ! But on the contrary I can’t wake it up :-( !

I follow this how to : http://wiki.xbmc.org/index.php?title=Ubu...end_/_Wake and this one too: http://wiki.xbmc.org/index.php?title=HOW...for_Ubuntu

Its look like the usb ports are also sleeping, no matter if I use the mouse, the keyboard or the Remote. I need to press on the power button of the box to wake it up.
And still, if I let it sleep by inactivity the usb ports stay awake so when I use the mouse it wakes up the pc!

I tried to enabled all usb port in "/proc/acpi/wakeup" (my remote/mouse/keyboard are supposed to be on USB0)
I tried to enabled them in "/etc/rc.local"

With etc/default/grub I tested:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash xbmc=autostart,noredir usbcore.autosuspend=-1"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1"
GRUB_CMDLINE_LINUX_DEFAULT=" splash quiet usbcore.autosuspend=-1 acpi-enforce-ressources=lax"

In the BIOS:
I put S3 (and even tested with S1), usb are enabled to wake it up.
Reading some post in the forum I tried to disabled USB3.0.

Oh, and I use "Suspend" in the ~/.xbmc/userdata/keymaps/keyboard.xml as Alktlr.

I don’t know what do I miss, or what to do now …
Do you have any ideas about what to do?

Thanks in advance,
Reply
#5
Got the remote today. Almost plug and play except for the power button. Added <xf86sleep>Suspend</xf86sleep> to keyboard.xml just below the <f4 mod="alt">Suspend</f4> line. Restarted XBMC and suspend is working again. Besides turning on with the power button, flipping the remote will also wake it up. Nice.

Your suspend problem seems to be related to a connected usb device. "PM: Device usb6 failed to suspend: error -2" Use lsusb and dmesg to see what is connect on usb6 and unplug it. I think the guide you have followed disables usb power when sleeping which makes it impossible for the remote to wake up again.

One thing I'm missing about the remote is the possibility to program the keys in MC mode. I want to control the volume on my sound system rather than in XBMC. Pushing the MC/TV before and after adjusting volume has a low WAF factor. I guess you cannot get the perfect remote.
Reply
#6
Thank you for your answer!
alktlr Wrote:Got the remote today. Almost plug and play except for the power button. Added <xf86sleep>Suspend</xf86sleep> to keyboard.xml just below the <f4 mod="alt">Suspend</f4> line. Restarted XBMC and suspend is working again. Besides turning on with the power button, flipping the remote will also wake it up. Nice.

I tested it and it still doesn't work Sad Does the MC/TV button of your remote flash in red when you press on power button?
I am beginning to think that maybe the button doesn’t work fine. I will test it with another receiver.

alktlr Wrote:Your suspend problem seems to be related to a connected usb device. "PM: Device usb6 failed to suspend: error -2" Use lsusb and dmesg to see what is connect on usb6 and unplug it. I think the guide you have followed disables usb power when sleeping which makes it impossible for the remote to wake up again.
I’ll go into that way in depth.

alktlr Wrote:One thing I'm missing about the remote is the possibility to program the keys in MC mode. I want to control the volume on my sound system rather than in XBMC. Pushing the MC/TV before and after adjusting volume has a low WAF factor. I guess you cannot get the perfect remote.
At least you don't have to get 2 remotes (which has a even smaller WAF Wink)
Are you sure you can't control Xbmc volume? Do you have that in your keyboard.xml?
Code:
<volume_down>VolumeDown<volume_down>
<volume_up>VolumeUp<volume_up>
Reply
#7
When the remote is in MC mode, the MC/TV button will flash every time a button is pushed. In TV mode the button will not flash. The MC/TV button flash when I push the power button to turn on the system. Are you able to suspend your PC with the pm-suspend command. It could be a permission issue. As I use Mythbuntu the suspend permission may already set by the developers.

Btw, I have this in /etc/sudoers

### XBMC-specific configuration ###
# XBMC
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/reboot, /sbin/halt # XBMC
Cmnd_Alias MOUNT_CMDS = /bin/mount, /bin/umount # XBMC
media ALL=(ALL) ALL # XBMC
media ALL=NOPASSWD: SHUTDOWN_CMDS, MOUNT_CMDS # XBMC

Where media is the user that runs XBMC.

To make sure all buttons work in XBMC copy /usr/share/xbmc/system/keymaps/keyboard.nyxboard.xml to ~/.xbmc/userdata/keymaps/keyboard.xml

The sound system remote is next to Nyxboard on the table in case surround mode or input needs to be changed.
Reply
#8
I had similar problems. pm-suspend worked fine for me, but the default keymappings for the nyxboard wouldn't allow the power button to do anything.

The nyxboard sends the VK_SLEEP key when hitting the power button, so I was able to add a custom button id to my local keyboard.xml file to map this button
to Suspend.

<button id="95">XBMC.Suspend()</button> <!-- Power: VK_SLEEP = 0x5F = 95 -->
Reply
#9
alktlr can you tell us what you exactly did to get it work?
And is it possible to power ON/OFF with this remote?
Nvidia Shield 2019 Pro, Nvidia Shield 2015
Reply
#10
This should work on any buntu installation.

~/.xbmc/userdata/keymaps/nyxboard/keyboard.xml

Code:
<!-- Mappings for the Motorola Nyxboard remote -->
<keymap>
  <global>
    <keyboard>
      <xf86sleep>XBMC.Suspend()</xf86sleep>
      <button id="95">XBMC.Suspend()</button> <!-- Power: VK_SLEEP = 0x5F = 95 -->
      <d mod="ctrl">ContextMenu</d>
      <home>FullScreen</home>
      <!-- home>XBMC.ActivateWindow(Home)</home -->
      <f3>OSD</f3>         <!-- EPG: same as Guide (ctrl-G) on MCE remote -->
      <f3 mod="shift">ActivateWindow(video)</f3>    <!-- Red -->
      <f4 mod="shift">ActivateWindow(music)</f4>    <!-- Green -->
      <f5 mod="shift">ActivateWindow(pictures)</f5> <!-- Yellow -->
      <f6 mod="shift">ActivateWindow(tv)</f6> <!-- Blue -->
    </keyboard>
  </global>
</keymap>


In /etc/rc.local before exit 0

Code:
echo EC > /proc/acpi/wakeup
echo OHC1 > /proc/acpi/wakeup
echo OHC2 > /proc/acpi/wakeup
echo EHC1 > /proc/acpi/wakeup
echo EHC2 > /proc/acpi/wakeup
echo 'ARPT S5 enabled pci:0000:03:00.0' > /proc/acpi/wakeup


In /etc/sudoers at the bottom

Code:
### XBMC-specific configuration ###
# XBMC
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/reboot, /sbin/halt, /sbin/poweroff # XBMC
Cmnd_Alias MOUNT_CMDS = /bin/mount, /bin/umount # XBMC
<xbmc user> ALL=(ALL) ALL # XBMC
<xbmc user> ALL=NOPASSWD: SHUTDOWN_CMDS, MOUNT_CMDS # XBMC

Remember to use visudo to edit the sudoers file and replace <xbmc user> with the user name that runs xbmc on your system.

I use the PVR branch and have mapped the Home button to FullScreen. You can swap the commented out home tag lines in keymaps.xml.

Reboot the system and you should be able to suspend and wake it up again on with the power button on the remote. The system must support S3 in the BIOS. And can be tested by doing a suspend from the command line.

sudo pm-suspend
Reply
#11
Thanks for you quick reply, and perfectly clear explanation, i go test it as soon i am home.

One more question, have you tried if it is possible to use power on/off this way?
I haven't found a clear answer that explains if it is possible, or why it isn't.
If i look at the WD TV Live i am able to power on/off from the IR remote. If i am right this OS is also linux based.
Nvidia Shield 2019 Pro, Nvidia Shield 2015
Reply
#12
If you mean power off by completely shutdown the system, then it depends on the BIOS to keep power on the nyxboard receiver and can wake up with a signal from the remote. Some BIOS's supports any key presses.

Suspend is easier to configure and faster to startup. So I do not see the point to complete shutdown the system.
Reply
#13
Hello Guys,

Putting this in the keyboard.xml make the power off button working well

<xf86sleep>XBMC.Suspend()</xf86sleep>
<button id="95">XBMC.Suspend()</button> <!-- Power: VK_SLEEP = 0x5F = 95 -->

The problem is now that flipping the remote to the keyboard side and back will also throw the command to suspend.
So command "95" or "xf86sleep" is also detected on flip back to the remote side

Has anybody a solution to avoid this ?

Thanks
Reply
#14
Hello Guys,

I found a solution for the Nyxboard remote to work with power button

Place this file to /home/xbmc/.xbmc/userdata/keymaps/nyxboard/keyboard.xml

Code:
<!-- Mappings for the Motorola Nyxboard remote -->
<keymap>
  <global>
    <keyboard name="Motorola Nyxboard Hybrid">
      <key id="61952">XBMC.ShutDown()</key> <!-- Power -->
      <f4>XBMC.EjectTray()</f4> <!-- User -->
      <d mod="ctrl">ContextMenu</d>
      <home>XBMC.ActivateWindow(Home)</home>
      <f3>OSD</f3>         <!-- EPG: same as Guide (ctrl-G) on MCE remote -->
      <f3 mod="shift">ActivateWindow(video)</f3>    <!-- Red -->
      <f3 mod="shift">ActivateWindow(Videos,MovieTitles)</f3>    <!-- Red -->
      <f4 mod="shift">ActivateWindow(music)</f4>    <!-- Green -->
      <f5 mod="shift">ActivateWindow(pictures)</f5> <!-- Yellow -->
      <f6 mod="shift">ActivateWindow(Videos,TvShowTitles)</f6> <!-- Blue -->
    </keyboard>
  </global>
</keymap>

I mapped the USER button to DVD/CD Eject

To make it work you need to deactivate "Enable switch side commands" in Sytem -> Input Devices -> Pheripherals -> Motorola Nyxboard Hybrid
Reply
#15
My Howto:

Suspend:
sudo nano /home/xbmc/.xbmc/userdata/keymap/nyxboard/keyboard.xml

My keymap:
Code:
<keymap>
  <global>
    <keyboard name="Motorola Nyxboard Hybrid">
      <xf86sleep>XBMC.Suspend()</xf86sleep>
      <f3 mod="shift">ContextMenu</f3>    <!-- Red -->
      <f4 mod="shift">AudioNextLanguage</f4>     <!-- Green -->
      <f5 mod="shift">ShowSubtitles</f5>  <!-- Yellow -->
      <f6 mod="shift">XBMC.ActivateWindow(PVROSDChannels)</f6>       <!-- Blue -->
      <f3>ZoomOut</f3>
      <f4>ZoomIn</f4>
    </keyboard>
</global>
<FullscreenVideo>
    <keyboard name="Motorola Nyxboard Hybrid">
      <left>SmallStepBack</left>
    </keyboard>
</FullscreenVideo>
</keymap>

To get it work only add
Code:
<xf86sleep>XBMC.Suspend()</xf86sleep>

About wakeup:

This link is a good startpoint XBMC Wiki
Don't forget the "Committing to rc.local" part. Else it will be disabled again after rebooting the system.
This makes the /etc/sudoers part of alktlr howto not needed.

One more tip to find the USB port the remote is using enable debug mode. Settings > System > Debugging
Look in the log for your remote. This makes it easy to just only enable the USB port needed. This does save some energie while in suspend.


Questions:

What is this row doing exactly in keyboard.xml
Code:
<button id="95">XBMC.Suspend()</button> <!-- Power: VK_SLEEP = 0x5F = 95 -->

When i only add this row to keyboard.xml The power button is already working.
Code:
<xf86sleep>XBMC.Suspend()</xf86sleep>

I don't think it hurts but i do get errors while debugging alktlr's howto:

Code:
14:01:31 T:139650561587072   ERROR: Keymapping error: no such action 'language' defined
14:01:31 T:139650561587072   ERROR: Keyboard Translator: Can't find button xf86sleep
14:01:31 T:139650561587072   ERROR: Keyboard Translator: Can't find button button
14:01:31 T:139650561587072   ERROR: Keyboard Translator: Can't find button xf86sleep
14:01:31 T:139650561587072   ERROR: Keyboard Translator: Can't find button button
Nvidia Shield 2019 Pro, Nvidia Shield 2015
Reply

Logout Mark Read Team Forum Stats Members Help
Motorola Nyxboard – How to configure OS for use power button to shutdown?0