Solved RunScript not working after upgrade to Gotham
#1
I used the setup below to have the volume up & down keys send volume commands to my Onkyo receiver, and it was working fine in Frodo. No luck with Gotham Beta 2 however.

~/.xbmc/userdata/keymaps/keyboard.xml
Code:
<keymap>
  <global>
    <keyboard>
      <volume_down>XBMC.RunScript(special://xbmc/userdata/volume_down.py)</volume_down>
      <volume_up>XBMC.RunScript(special://xbmc/userdata/volume_up.py)</volume_up>
     </keyboard>
  </global>
</keymap>

~/.xbmc/userdata/volume_down.py
Code:
#!/usr/bin/python
import eiscp
receiver = eiscp.eISCP('192.168.0.102')
receiver.raw('MVLDOWN')

with open("/home/pitpat/scratch/test.txt", "a") as myfile:
    myfile.write("volume down\n")

The volume control scripts work correctly when executed locally, and the debug prints get appended to the test.txt file.


When I look at the debug log, I see the keypresses, the correct action, and no errors.
Code:
12:07:49 T:140340192778112   DEBUG: Keyboard: scancode: 0x7a, sym: 0x00ae, unicode: 0x0000, modifier: 0x0
12:07:49 T:140340192778112   DEBUG: OnKey: volume_down (0xf0b8) pressed, action is XBMC.RunScript(special://xbmc/userdata/volume_down.py)
12:07:49 T:140340192778112   DEBUG: Keyboard: scancode: 0x7a, sym: 0x00ae, unicode: 0x0000, modifier: 0x0
12:07:49 T:140340192778112   DEBUG: OnKey: volume_down (0xf0b8) pressed, action is XBMC.RunScript(special://xbmc/userdata/volume_down.py)
12:07:49 T:140340192778112   DEBUG: Keyboard: scancode: 0x7a, sym: 0x00ae, unicode: 0x0000, modifier: 0x0
12:07:49 T:140340192778112   DEBUG: OnKey: volume_down (0xf0b8) pressed, action is XBMC.RunScript(special://xbmc/userdata/volume_down.py)
12:07:49 T:140340192778112   DEBUG: Keyboard: scancode: 0x7a, sym: 0x00ae, unicode: 0x0000, modifier: 0x0
12:07:49 T:140340192778112   DEBUG: OnKey: volume_down (0xf0b8) pressed, action is XBMC.RunScript(special://xbmc/userdata/volume_down.py)

The debug prints are not written to "test.txt", which leads me to belive the scripts aren't being run at all.
Reply
#2
did you ever find a solution to this?
Reply
#3
Nope.
Reply
#4
Have you tested with only a simplified myfile.write (none of the eiscp stuff) or some other method to log if the script is actually run?

Could be your keyboard.xml. Here's mine:
Code:
<keymap>
  <global>
    <keyboard>
      <F1 mod="ctrl">RunScript(/storage/volume_down.py)</F1>
  </global>
</keymap>

My volume down script for my Denon is a bit simpler:

Code:
import urllib
urllib.urlopen("http://192.168.1.20/MainZone/index.put.asp?cmd0=PutMasterVolumeBtn/<")
Reply
#5
Got it working! I had to give the scripts '.py' extensions. Before the scripts had no extension w/a shebang pointing to /usr/bin/python.
Reply

Logout Mark Read Team Forum Stats Members Help
RunScript not working after upgrade to Gotham0