Solved Issue - RunScript not working after upgrade to Gotham

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
pitpat Offline
Junior Member
Posts: 3
Joined: Jan 2014
Reputation: 0
Post: #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.
(This post was last modified: 2014-07-16 17:46 by pitpat.)
find quote
drewcovi Offline
Junior Member
Posts: 1
Joined: Jul 2012
Reputation: 0
Post: #2
did you ever find a solution to this?
find quote
pitpat Offline
Junior Member
Posts: 3
Joined: Jan 2014
Reputation: 0
Post: #3
Nope.
find quote
doug Offline
Donor
Posts: 148
Joined: Apr 2012
Reputation: 4
Post: #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/<")
find quote
pitpat Offline
Junior Member
Posts: 3
Joined: Jan 2014
Reputation: 0
Post: #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.
find quote