Kodi Community Forum

Full Version: [RELEASE] MythBox for XBMC - a MythTV Front-end Python Script for XBMC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
earlneath Wrote:Thanks for all the hard work in getting this out analogue! This is a great solution for anyone running xbmc with a mthtv backend on their machine. For anyone running xbmc on Linux give it a whirl - buy a usb tuner, install mythtv backend and continue to enjoy your xbmc frontend!

I've checked Wiki and google and didnt find MythTV ( easy to install ) back end for Windows nor Mac. I have 3 macs and 1 Windows at home and no time at the moment to experiment with Linux so i'm looking for win/mac mythtv back end tutorial. Anybody done it ?
analogue Wrote:just posted a new beta..svn 1558 on the download page. enjoy!

I can't get this to work with XBMC SVN r24108 on Fedora 11. It appears that the Python interpreter doesn't set the current working directory properly, so os.getcwd() returns "/", here is the relevant output from ~/.xbmc/temp/xbmc.log

Code:
00:33:12 T:140274176379040 M:3569508352   DEBUG:   ParentPath = [special://home/scripts]
00:33:12 T:140274049186064 M:3569405952  NOTICE: -->Python Interpreter Initialized<--
00:33:12 T:140274049186064 M:3569405952   DEBUG: Process - The source file to load is special://home/scripts/MythBox/default.py
00:33:12 T:140274049186064 M:3569405952   DEBUG: Process - Setting the Python path to /home/myth/.xbmc/scripts/MythBox:/usr/lib64/python26.zip:/usr/lib64/python2.6/:/usr/lib64/python2.6/plat-linux2:/usr/lib64/python2.6/lib-tk:/usr/lib64/python2.6/lib-old:/usr/lib64/python2.6/lib-dynload
00:33:12 T:140274049186064 M:3569405952   DEBUG: Process - Entering source directory /home/myth/.xbmc/scripts/MythBox
00:33:12 T:140274049186064 M:3569303552  NOTICE: Traceback (most recent call last):
00:33:12 T:140274049186064 M:3569303552  NOTICE:   File "/home/myth/.xbmc/scripts/MythBox/default.py", line 33, in <module>
00:33:12 T:140274049186064 M:3569303552  NOTICE: from mythbox.bootstrapper import BootStrapper
00:33:12 T:140274049186064 M:3569303552  NOTICE: ImportError
00:33:12 T:140274049186064 M:3569303552  NOTICE: :
00:33:12 T:140274049186064 M:3569303552  NOTICE: No module named mythbox.bootstrapper

I know that the current working directory isn't set correctly because into default.py I inserted:
Code:
print "os.getwcd= %s" % os.getcwd()

the log output is:

Code:
00:37:39 T:140273734633744 M:3470557184   DEBUG: Process - Entering source directory /home/myth/.xbmc/scripts/MythBox
00:37:39 T:140273734633744 M:3470557184  NOTICE: os.getwcd= /
00:37:39 T:140273734633744 M:3470557184  NOTICE: Traceback (most recent call last):

I can work around this to some extent by hard-coding the path everywhere os.getcwd()is found but that's a very hacky solution as it is used in a lot of places.


Let me know if you want me to open up a bug on the google code tracker (although I'd prefer not to have to create a google account just to submit the bug).
Hmm, even if I do a global search-and-replace of os.getenv() with the hardcoded path, I get as far as printing out the (correct) MythTV settings, but then it crashes XBMC completely Sad Here is the contents of mythbox.log, which is also the last thing that appears in ~/.xbmc/temp/xbmc.log.

Code:
INFO | mythtv.core | bootstrapper.py | MainThread | Line 67 | Mythbox Logger Initialized
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[0] = /home/myth/.xbmc/scripts/MythBox
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[1] = /usr/lib64/python26.zip
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[2] = /usr/lib64/python2.6/
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[3] = /usr/lib64/python2.6/plat-linux2
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[4] = /usr/lib64/python2.6/lib-tk
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[5] = /usr/lib64/python2.6/lib-old
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[6] = /usr/lib64/python2.6/lib-dynload
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[7] = /home/myth/.xbmc/scripts/MythBox/resources/src
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[8] = /home/myth/.xbmc/scripts/MythBox/resources/lib/pyxcoder
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[9] = /home/myth/.xbmc/scripts/MythBox/resources/lib/decorator
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[10] = /home/myth/.xbmc/scripts/MythBox/resources/lib/odict
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[11] = /home/myth/.xbmc/scripts/MythBox/resources/lib/elementtree
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[12] = /home/myth/.xbmc/scripts/MythBox/resources/lib/tvdb_api
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[13] = /home/myth/.xbmc/scripts/MythBox/resources/lib/themoviedb
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[14] = /home/myth/.xbmc/scripts/MythBox/resources/lib/IMDbPY
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[15] = /home/myth/.xbmc/scripts/MythBox/resources/lib/simplejson
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[16] = /home/myth/.xbmc/scripts/MythBox/resources/lib/shove
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[17] = /home/myth/.xbmc/scripts/MythBox/resources/lib/durus
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[18] = /home/myth/.xbmc/scripts/MythBox/resources/lib/mysql-connector-python
INFO | mythtv.core | bootstrapper.py | MainThread | Line 74 | Mythbox Platform Initialized
INFO | mythtv.core | util.py | MainThread | Line 640 |  ============ MythBox Started ================
DEBUG | mythtv.core | bootstrapper.py | MainThread | Line 107 | Settings =
mythtv_host = 192.168.xx.yy
mythtv_port = 6543
mythtv_minlivebufsize = 4096
mythtv_tunewait = 60
mysql_host = localhost
mysql_port = 3306
mysql_database = mythconverg
mysql_user = ****
mysql_password = ****
paths_recordedprefix = /var/video
paths_ffmpeg = /usr/bin/ffmpeg
recorded_view_by = 2
upcoming_view_by = 2
confirm_on_delete = True
fanart_tvdb = True
fanart_tmdb = True
fanart_imdb = True
fanart_google = True
lirc_hack = False
logging_enabled = True
fiveisalive Wrote:Hmm, even if I do a global search-and-replace of os.getenv() with the hardcoded path, I get as far as printing out the (correct) MythTV settings, but then it crashes XBMC completely Sad Here is the contents of mythbox.log, which is also the last thing that appears in ~/.xbmc/temp/xbmc.log.

Code:
INFO | mythtv.core | bootstrapper.py | MainThread | Line 67 | Mythbox Logger Initialized
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[0] = /home/myth/.xbmc/scripts/MythBox
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[1] = /usr/lib64/python26.zip
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[2] = /usr/lib64/python2.6/
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[3] = /usr/lib64/python2.6/plat-linux2
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[4] = /usr/lib64/python2.6/lib-tk
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[5] = /usr/lib64/python2.6/lib-old
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[6] = /usr/lib64/python2.6/lib-dynload
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[7] = /home/myth/.xbmc/scripts/MythBox/resources/src
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[8] = /home/myth/.xbmc/scripts/MythBox/resources/lib/pyxcoder
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[9] = /home/myth/.xbmc/scripts/MythBox/resources/lib/decorator
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[10] = /home/myth/.xbmc/scripts/MythBox/resources/lib/odict
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[11] = /home/myth/.xbmc/scripts/MythBox/resources/lib/elementtree
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[12] = /home/myth/.xbmc/scripts/MythBox/resources/lib/tvdb_api
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[13] = /home/myth/.xbmc/scripts/MythBox/resources/lib/themoviedb
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[14] = /home/myth/.xbmc/scripts/MythBox/resources/lib/IMDbPY
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[15] = /home/myth/.xbmc/scripts/MythBox/resources/lib/simplejson
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[16] = /home/myth/.xbmc/scripts/MythBox/resources/lib/shove
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[17] = /home/myth/.xbmc/scripts/MythBox/resources/lib/durus
DEBUG | mythtv.core | platform.py | MainThread | Line 67 | syspath[18] = /home/myth/.xbmc/scripts/MythBox/resources/lib/mysql-connector-python
INFO | mythtv.core | bootstrapper.py | MainThread | Line 74 | Mythbox Platform Initialized
INFO | mythtv.core | util.py | MainThread | Line 640 |  ============ MythBox Started ================
DEBUG | mythtv.core | bootstrapper.py | MainThread | Line 107 | Settings =
mythtv_host = 192.168.xx.yy
mythtv_port = 6543
mythtv_minlivebufsize = 4096
mythtv_tunewait = 60
mysql_host = localhost
mysql_port = 3306
mysql_database = mythconverg
mysql_user = ****
mysql_password = ****
paths_recordedprefix = /var/video
paths_ffmpeg = /usr/bin/ffmpeg
recorded_view_by = 2
upcoming_view_by = 2
confirm_on_delete = True
fanart_tvdb = True
fanart_tmdb = True
fanart_imdb = True
fanart_google = True
lirc_hack = False
logging_enabled = True

So it looks like you've built XBMC using --enable-ext-python (or whichever flag uses your distro's python installation). I can't really do much about that since it is still in development and I have no idea as to the robustness and maturity of with the whole "external python" feature. As a workaround, you can build with XBMC's builtin python for the time being. Feel free to log it as a bug for tracking purposes, though.
analogue Wrote:So it looks like you've built XBMC using --enable-ext-python (or whichever flag uses your distro's python installation). I can't really do much about that since it is still in development and I have no idea as to the robustness and maturity of with the whole "external python" feature. As a workaround, you can build with XBMC's builtin python for the time being. Feel free to log it as a bug for tracking purposes, though.

Thanks, I rebuilt XBMC using internal Python and now it gets launches the settings screen, however I still get a problem connecting with the MySQL database when using "Test Settings".
Code:
Connect to MySQL failed: 1156 (08S01): Got packets out of order

Note that this XBMC runs on the same machine as the mythtv backend, and I have configured the firewall etc. to allow access and I have successfully accessed mythtv using the built-in mythtv:// protocol with the same database settings.
fiveisalive Wrote:Thanks, I rebuilt XBMC using internal Python and now it gets launches the settings screen, however I still get a problem connecting with the MySQL database when using "Test Settings".
Code:
Connect to MySQL failed: 1156 (08S01): Got packets out of order
Note that this XBMC runs on the same machine as the mythtv backend, and I have configured the firewall etc. to allow access and I have successfully accessed mythtv using the built-in mythtv:// protocol with the same database settings.

See Q14 in the FAQ and see if that fixes your mysql problem.
I am trying to switch to XBMC from Mythtv (switch frontend only) and this script works better than the native support. My daughter did not like it for one reason, When you view recordings it shows them all or you choose which show to see the episodes. My daughter (and I) prefer when you see the shows on the left and the episodes on the right Ala Mythtv. Not a deal breaker but it does make scanning quicker not sure if this would be a hard display option to implement or if any one else even prefers i that way.

Great script though!

Craig
analogue Wrote:See Q14 in the FAQ and see if that fixes your mysql problem.

Installed phpMyAdmin and clicked the "Change password" under the "Actions", and then retyped my myth password with the "MySQL 4.1+" item checked. Then restarted XBMC, but doesn't help. Still get the same error:

Code:
Connect to MySQ failed: 1156 (08S01): Got packets out of order
Hi.
I am using XBMC 9.04.1 r20763M in archlinux 64bit and installed the lastests version beta6 of mythbox.
When I want view LiveTV, recive this error in mythbox.log:

Line 400 | CATCHALL_UI: Caught exception 'ascii' codec can't encode characters in position 50-51: ordinal not in range(128) on method <function onInit at 0x310d070>

I have the system in Spanish language... but the Mythbox plugin not appear in spanish. I suspected that this errors are ocurred by the spanish accents..

Do you know how resolve this?

Thanks!!
fiveisalive Wrote:Installed phpMyAdmin and clicked the "Change password" under the "Actions", and then retyped my myth password with the "MySQL 4.1+" item checked. Then restarted XBMC, but doesn't help. Still get the same error:

Code:
Connect to MySQ failed: 1156 (08S01): Got packets out of order

What version of mysql server are you running?
iscraigh Wrote:I am trying to switch to XBMC from Mythtv (switch frontend only) and this script works better than the native support. My daughter did not like it for one reason, When you view recordings it shows them all or you choose which show to see the episodes. My daughter (and I) prefer when you see the shows on the left and the episodes on the right Ala Mythtv. Not a deal breaker but it does make scanning quicker not sure if this would be a hard display option to implement or if any one else even prefers i that way.

Great script though!

Craig

Thanks! I'm redoing the Recordings screen at the moment. It is kind of an interesting problem supporting that type of selection with the screen real estate. Actually, that screen in mythtv kind of looks weird to me to tell you the truth but it does come in handy when you have 100+ recordings to scroll through. Will take into account with the new design. Thanks for the feedback.
jokstation Wrote:Hi.
I am using XBMC 9.04.1 r20763M in archlinux 64bit and installed the lastests version beta6 of mythbox.
When I want view LiveTV, recive this error in mythbox.log:

Line 400 | CATCHALL_UI: Caught exception 'ascii' codec can't encode characters in position 50-51: ordinal not in range(128) on method <function onInit at 0x310d070>

I have the system in Spanish language... but the Mythbox plugin not appear in spanish. I suspected that this errors are ocurred by the spanish accents..

Do you know how resolve this?

Thanks!!

Can you log a defect @ the googlecode site and attach your log file. Unicode/ascii errors are a PITA!
I got a little bored today and made a version of the logo using the XBMC x instead of the default danube font one. Feel free to use it or ignore it your choice

New
Image

Original
Image
analogue Wrote:What version of mysql server are you running?

5.1.37. This is the default version in Fedora and the version that the mythtv packages (from Fedora-compatible RPM Fusion repository) are built against.

Code:
$ rpm -qa|grep ^mysql
mysql-5.1.37-1.fc11.x86_64
mysql-embedded-5.1.37-1.fc11.x86_64
mysql-libs-5.1.37-1.fc11.x86_64
mysql-server-5.1.37-1.fc11.x86_64
mysql-devel-5.1.37-1.fc11.x86_64
Hi !

Have the same problem with mysql connectivity as fiveisalive at FC11.