1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HME for Python

Discussion in 'Developers Corner' started by wmcbrine, Jan 28, 2008.

  1. Mar 2, 2012 #201 of 231
    jwagner010

    jwagner010 New Member

    73
    0
    Dec 8, 2007
    I will take a look at HME/VLC. Thanks

    I want to do this for two reasons, both very similar:

    1) From my Tivo I want to be able to turn on and off my lights in the house. My home automation controller has a REST interface so I want to send HTTP GET requests (preferrably through wget) to turn on and off my lights based on menu selections on the Tivo.

    2) Simlar to 1) above I would like to be able to control my home audio system that also has a similar interface.
     
  2. Mar 2, 2012 #202 of 231
    lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    Hey, that's rather cool. It would be nice to be able to control the lights and the projector sreen in the theater.
     
  3. Mar 2, 2012 #203 of 231
    wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
    No, I mean, why do you want to do it in Python, if you don't know Python anyway? Why not just use David Blackledge's program?
     
  4. Mar 3, 2012 #204 of 231
    jwagner010

    jwagner010 New Member

    73
    0
    Dec 8, 2007
    For two reasons:

    1). David's program doesn't let you pass user id and password with the URL get

    2) I run the server on a nas that doesn't have java but does have python

    On a seperate note I installed HMEVLC. Very cool. Has anyone connected an IP camera to this? I might try stream the mjpeg from a couple of Foscam cameras at home
     
  5. Mar 3, 2012 #205 of 231
    jwagner010

    jwagner010 New Member

    73
    0
    Dec 8, 2007
    I figured out the http to get the mjpeg stream from my camera but I cannot get vlc to run on my synology nas due to the way vlc and dbus are installed. I was told that I need to use the following syntax: "dbus-launch cvlc -I http://playlist.yahoo.com/makeplaylist.dll?id=1368162"

    Any suggestions on the python code that needs to change to make this happen?
     
  6. Mar 3, 2012 #206 of 231
    wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
    You shouldn't need to modify the code. Just add a line to config.ini, in the hmevlc section:

    vlc = cvlc

    (but give the full path). I don't think you should need dbus. (?)
     
  7. Mar 4, 2012 #207 of 231
    jwagner010

    jwagner010 New Member

    73
    0
    Dec 8, 2007
    I tried your suggestion but I think I need the dbus syntax. When I add vlc=/fullpath/cvlc it throws the following errors. My (very limited) understanding is the x11 error is due to this being run on a NAS

    192.168.0.5:49832 - - [04/Mar/2012 00:12:13] Ending HME: hmevlc
    192.168.0.5:50850 - - [04/Mar/2012 00:39:58] "GET /hmevlc/ HTTP/1.1" 200 -
    192.168.0.5:50850 - - [04/Mar/2012 00:39:58] Starting HME: hmevlc
    VLC media player 0.9.9a Grishenko
    [00000001] main libvlc debug: VLC media player - version 0.9.9a Grishenko - (c) 1996-2009 the VideoLAN team
    [00000001] main libvlc debug: libvlc was configured with ./configure '--build=i386-pc-linux-gnu' '--host=i686-linux-gnu' '--target=i686-linux-gnu' '--prefix=/opt' '--enable-v4l' '--disable-v4l2' '--enable-bonjour' '--enable-x264' '--enable-dvbpsi' '--enable-a52' '--enable-dvdnav' '--with-dvdnav-config-path=/home/slug/optware/syno-i686/staging/opt/bin' '--enable-faad' '--enable-flac' '--disable-gnutls' '--enable-mpc' '--enable-ncurses' '--enable-ogg' '--enable-png' '--disable-remoteosd' '--enable-shout' '--enable-speex' '--enable-vorbis' '--disable-alsa' '--disable-dca' '--disable-glx' '--disable-gnomevfs' '--disable-libcdio' '--disable-libcddb' '--disable-screen' '--disable-sdl' '--disable-wxwidgets' '--disable-skins2' '--disable-x11' '--disable-nls' '--disable-static' 'build_alias=i386-pc-linux-gnu' 'host_alias=i686-linux-gnu' 'target_alias=i686-linux-gnu' 'CC=/home/slug/optware/syno-i686/toolchain/gcc-4.2.1-glibc-2.3.6/i686-linux-gnu/bin/i686-linux-gnu-gcc' 'LDFLAGS= -L/home/slug/optware/syno-i686/staging/opt/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link,/home/slug/optware/syno-i686/staging/opt/lib ' 'CPPFLAGS=-O2 -O2 -pipe -I/home/slug/optware/syno-i686/staging/opt/include -I/home/slug/optware/syno-i686/staging/opt/include/ncurses' 'CPP=/home/slug/optware/syno-i686/toolchain/gcc-4.2.1-glibc-2.3.6/i686-linux-gnu/bin/i686-linux-gnu-gcc -E' 'CXX=/home/slug/optware/syno-i686/toolchain/gcc-4.2.1-glibc-2.3.6/i686-linux-gnu/bin/i686-linux-gnu-g++' 'PKG_CONFIG_PATH=/home/slug/optware/syno-i686/staging/opt/lib/pkgconfig'
    [00000001] main libvlc debug: translation test: code is "C"
    [00000298] inhibit interface error: Failed to connect to the D-Bus session daemon: /opt/bin/dbus-launch terminated abnormally with the following error: Autolaunch requested, but X11 support not compiled in.
    Cannot continue.


    [00000298] main interface error: no suitable interface module
    [00000001] main libvlc error: interface "inhibit,none" initialization failed
    [00000300] dummy interface: using the dummy interface module...
    [00000306] main access out: creating httpd
    [00000306] main access out error: socket bind error (Permission denied)
    [00000306] main access out error: socket bind error (Permission denied)
    [00000306] main access out error: cannot create socket(s) for HTTP host
    [00000306] access_output_http access out error: cannot listen on port 9028
    [00000305] stream_out_standard stream out error: no suitable sout access module for `http/ps://:9028'
    [00000303] stream_out_transcode stream out error: cannot create chain
    [00000302] main stream output error: stream chain failed for `transcode{vcodec=mp2v,vb=2048,acodec=a52,ab=384,audio-sync,samplerate=48000,fps=30}:std{access=http,dst=:9028,mux=ps}'
    [00000301] main input error: cannot start stream output instance, aborting

    Any suggestions on what I need to change in the python code in order to be able to use the dbus syntax (dbus-launch cvlc -I http://urltocall) in the call to cvlc ?
     
  8. jpolk5000

    jpolk5000 New Member

    2
    0
    May 1, 2010
    Greetings All,

    I was unaware of pyHME until today....Hats off to Mr. McBride!

    I've been using Python and Qt for several years, and having been a TiVo user
    for over 15 years, I, like many others I'm sure, have a lot of ideas I'd like to try
    to implement.

    Where can I download the pyHME module?

    Cheers,
     
  9. wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
    Thanks, but it's McBrine.

    It's linked from the first post in the thread, and in my sig...
     
  10. lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    That seems unlikely, since the TiVo was introduced in 1999. Even if you participated in one of the service trials in 1998, that would still only be a little over 13 years.
     
  11. johnh123

    johnh123 New Member

    429
    0
    Dec 7, 2000
    Over there
    OK, so i've got it running on my synology nas, and a couple of the apps work, but then I try tic tac toe and get this:

    Exception happened during processing of request from ('192.168.1.112', 35176)
    Traceback (most recent call last):
    File "/opt/lib/python2.5/SocketServer.py", line 464, in process_request_thread
    self.finish_request(request, client_address)
    File "/opt/lib/python2.5/SocketServer.py", line 254, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    File "/usr/local/pyhme/start.py", line 141, in __init__
    client_address, server)
    File "/opt/lib/python2.5/SocketServer.py", line 522, in __init__
    self.handle()
    File "/opt/lib/python2.5/BaseHTTPServer.py", line 316, in handle
    self.handle_one_request()
    File "/opt/lib/python2.5/BaseHTTPServer.py", line 310, in handle_one_request
    method()
    File "/usr/local/pyhme/start.py", line 232, in do_GET
    self._page(True)
    File "/usr/local/pyhme/start.py", line 186, in _page
    appinst.mainloop()
    File "/usr/share/pyhme/hme.py", line 1134, in mainloop
    self.startup()
    File "/usr/share/pyhme/tictactoe/__init__.py", line 32, in startup
    File "/usr/share/pyhme/hme.py", line 1040, in set_image
    self.set_resource(Image(self.app, name, f, data), flags)
    File "/usr/share/pyhme/hme.py", line 735, in __init__
    f = open(name, 'rb')
    IOError: [Errno 2] No such file or directory: 'tictactoe/bg.jpg'


    and I checked, and bg.jpg is in fact there...

    any thoughts?
     
  12. wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
    I see that you've split it into two directories. I'm not sure if that's going to work, but if it is, you'll at least need this in your config.ini:

    basepath = /usr/share/pyhme

    Edit: Actually, as I look at it, tictactoe doesn't even check the basepath (nor the datapath), just assumes that the starting directory is the one above the app directory (in your case, /usr/share/pyhme). I guess I might do something about that... but in the meantime, you should probably start up like this:

    cd /usr/share/pyhme
    /usr/local/pyhme/start.py
     
  13. johnh123

    johnh123 New Member

    429
    0
    Dec 7, 2000
    Over there
    Ah, I see that. There are two directories because the way I originally installed it it went to share, then I saw that others were using local so I switched it - i'll have to try and track down any mentions of share and change to local. Thanks.
     
  14. johnh123

    johnh123 New Member

    429
    0
    Dec 7, 2000
    Over there
    OK, so I started over. Got hme running with all the apps. Have installed vidmgr there. I get this when it runs:

    192.168.1.125:41301 - - [18/Apr/2012 22:23:16] Starting HME: vidmgr
    Vidmgr thread entering startup
    ----------------------------------------
    Exception happened during processing of request from ('192.168.1.125', 41301)
    Traceback (most recent call last):
    File "/opt/lib/python2.5/SocketServer.py", line 464, in process_request_thread
    self.finish_request(request, client_address)
    File "/opt/lib/python2.5/SocketServer.py", line 254, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    File "start.py", line 141, in __init__
    client_address, server)
    File "/opt/lib/python2.5/SocketServer.py", line 522, in __init__
    self.handle()
    File "/opt/lib/python2.5/BaseHTTPServer.py", line 316, in handle
    self.handle_one_request()
    File "/opt/lib/python2.5/BaseHTTPServer.py", line 310, in handle_one_request
    method()
    File "start.py", line 232, in do_GET
    self._page(True)
    File "start.py", line 186, in _page
    appinst.mainloop()
    File "/usr/local/pyhme/hme.py", line 1134, in mainloop
    self.startup()
    File "/usr/local/pyhme/vidmgr/__init__.py", line 108, in startup
    raise ConfigError("No Tivos found - exiting")
    ConfigError: No Tivos found - exiting

    the pyhme config.ini is like so:

    [hmeserver]
    apps=vidmgr

    [vidmgr]
    exts=.mpg .mp4 .avi .wmv .m4v .mkv
    descsize=16

    [tivos]
    tivo1.name=Basement
    tivo1.tsn=xxx-xxxx-xxxx-xxxx

    [pytivos]
    pytivo1.config=/usr/local/pyTivo/pyTivo.conf
    pytivo1.ip=192.168.1.113
    pytivo1.port=9032

    what next?
     
  15. wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
    That's not an HME for Python issue. Please take it to the VidMGR thread.
     
  16. windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    Like wmcbrine said this should be in the vidmgr thread, but it looks like you've got the wrong stuff in your ini file. The config.ini file for HME for Python should only contain the [hmeserver] section. The [vidmgr] and [pytivos] sections should be in the vidmgr.ini in the vidmgr folder and the [tivos] section should be in your pyTivo.conf.
     
  17. May 6, 2012 #217 of 231
    wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
    is now available. Only minor changes.
     
  18. wsware

    wsware New Member

    45
    0
    Jan 27, 2003
    Charlotte, NC
    Does this work on the Tivo Premiere? I could not get anything to show up using just a clean install using the SD or HD menus. I didn't spend a lot of time on it so I can play with the config next. I just installed it and left it running then checked my Tivo a few hours later.

    Also, Are there just not many HME apps out there? I seem to have a hard time finding any. Would there happen to be a list of them?

    PlayOn under pyTivo is ok, but it seems like it would make a much better HME app.
     
  19. wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
    Yes.

    It would make more sense to check it immediately.

    There are any number of reasons why it might fail -- firewall issues, unreliable wi-fi, a brand-new TiVo or a TiVo otherwise not set up to allow network apps... and the classic, users looking in the wrong menus. :)

    Indeed there are not.

    http://apps.tv/
     
  20. lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    Vidmgr is not on that list, adn IMO it is a terrific app. 'Blows the NPL away (for content on the server).
     

Share This Page