kodi.executebuiltin( ... ) not working
#1
Hi,

i have Problems with the autoexec.py in Kodi 14.2 on Raspberry Pi V2

My Code:

Code:
import kodi
kodi.executebuiltin('kodi.PlayMedia("/storage/videos/testvideo.mp4")')

I get the following error message:

File "autoexec.py", line 3, in <module>
kodi.executebuiltin('kodi.PlayMedia("/storage/videos/testvideo.mp4")')
AttributeError: 'module' object has no attribute 'executebuiltin'

Can you help me?

[/php]
Reply
#2
Hi boerti
Welcome to Kodi

I'm a newb but did quick google search and think this might be the solution

http://stackoverflow.com/questions/28327...on-raspbmc

QUESTION

"I'm trying to make the following script run at 17:00 everyday on Raspbmc using crontab. Cronjob scheduler is activated and running, but the script does not get executed. The crontab I used is: "

"0 17 * * * python /home/pi/.kodi/userdata/test.py"

Code:
import xbmc
xbmc.executebuiltin("PlayMedia(/home/pi/.kodi/userdata/playlists/music/test.m3u)")
xbmc.executebuiltin("PlayerControl(Random)")

ASNWER

I figured it out, I had to execute the following through SSH:

1).sudo apt-get install xbmc-eventclients-xbmc-send

2).xbmc-send --action='RunScript("/home/pi/.kodi/userdata/test.py")' (to test if the script works through SSH)

or

3).0 17 * * * xbmc-send --action='RunScript("/home/pi/.kodi/userdata/test.py")' (to set the crontab)

Of course you need to make the script executable (755 permissions) and set the python env, as previously mentioned.(check that link I attached at the beginning)

Thanks for the the replies!

NOTES:
I personally use filezilla, right click on file then choose "set permissions" and enter 755 in the code.
The google search term I used was
executebuiltin('kodi.PlayMedia

also have a look at the difference in syntax between yours and this one.

your code
('kodi.PlayMedia("/storage/videos/testvideo.mp4")')

his code
("PlayMedia(/home/pi/.kodi/userdata/playlists/music/test.m3u)")

maybe drop the "kodi." ?
report back with your solution if you found it so it may help others Smile
Reply
#3
Hi MediaPi,

when i type this: sudo apt-get install xbmc-eventclients-xbmc-send

i become this error message:

There is no working 'apt-get'.

'apt-get' is a command to install, update and remove software which
is stored in a non local repo. 'apt-get' does nothing then connecting to such
repo, downloads the software, unpacks the software, updates a big
local database with all filepaths and other informations about the
installed software or removes or updates installed Software.

With OpenELEC it is not possible to change the system for security and
stability reasons so even 'apt-get' would not be able to do this.
We also dont have and want to maintain such a repo for various other
great reasons.

Also Ubuntu or Debian packages are often outdated and not compatible
with OpenELEC

"xbmc" doesn't work with the new kodi
Reply
#4
(2015-04-12, 17:43)boerti Wrote: "xbmc" doesn't work with the new kodi

Try, "kodi-send"
Reply
#5
donwload filezilla

then type in your ip number
user name = root
password = openelec
port 22

locate your file

right click on file and chose "file permission"

in numeric value type 755 and enter
that should make it executable
Reply
#6
I have tested with "kodi-send", but it doesn't work: -> NameError: name 'send' is not defined.
Also set the rights "755" has no effect. Confused
Reply

Logout Mark Read Team Forum Stats Members Help
kodi.executebuiltin( ... ) not working0