Hello Guest, if you are reading this it means you have not registered yet. Please take a second, Click here to register, and in a few simple steps you will be able to enjoy our community and use our OpenViX support section.
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 37

Thread: Remote Control Scripts and Assorted Oddities

  1. #16

    Title
    Junior Member
    Join Date
    Sep 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the bluetooth module but I think it was able to bypass that because I'm still having problems. I found that it was missing a readline module so I found one and installed that which seems to have helped with progress.

    Next, i found that the script sticks to the 127 subnet but mine is 192 so I managed to update the sweep file and it recompiled.

    Although it gets stuck on the first computer it finds, it still won't scan my vu+ box. There is something about dcpd.rwi failing because a comedi module is missing and this is where I got stuck.

    Log File:

    Before thatDEBUG:root:Constructing universe
    DEBUG:root:Registering base as Base device
    DEBUG:root:Registering base as default device
    DEBUG:root:Commands available: {'blue': 'Turns on the bluetooth server', 'map': 'Device ui map', 'help': 'List of commands', 'selected': 'Identify selected device', 'sweep': 'Sweep activation and status', 'devices': 'List known devices.', 'security': 'Security information', 'select': 'Select a device'}
    ERROR:root:Unable to load dcpd.rwi - failed with No module named comedi
    DEBUG:root:client.shell BEGINS
    ERROR:root:VLC failure on 127.0.0.1: [Errno socket error] (10061, 'Connection refused')

  2. #17

    Title
    Junior Member
    Join Date
    Dec 2010
    Posts
    27
    Thanks
    0
    Thanked 10 Times in 5 Posts
    The only module you need to load from dcpd is dbox - the failure to load rwi shouldn't matter (fwiw, it's for controlling electrics using a usb board - my mate's using it to control the lights in his house - idea being that he can have one remote control application for everything and we have vague plans to allow 'mood' definitions which set various devices in pre-defined ways through a single button on the remote control app).

    I also thought the default readline (which is restricted on windows I think) should have served its purpose - lacks things like command line history/searching, tab completion and the like, but allows your basic command entry (not that it really matters, as the whole command line thing isn't really used - it's mostly there for testing the comms protocol and generally, client apps are intended to wrap it).

    I'm unsure why sweep isn't reporting correctly though - I guess I can try firing up a virtual box with xp to take a quick look at it. Probably not today though. Will ping if I find anything.

  3. #18

    Title
    Junior Member
    Join Date
    Dec 2010
    Posts
    27
    Thanks
    0
    Thanked 10 Times in 5 Posts
    Luckily my youngest decided to have a quick snooze - late night last night taking it's toll .

    Fired up the vbox - you were right - readline was required, along with PyBluez and BeautifulSoup. For the latter, I used:

    Code:
    http://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.2.0.tar.gz
    Unpacked under cygwin, and ran the 'python setup.py install' procedure to install it.

    After that, just running 'python dcpstart' worked - detecting both the engima1 dreambox and engima2 duo (and prompting me for a user/password on my router which I ignored ).

  4. #19

    Title
    Junior Member
    Join Date
    Sep 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I removed the rwi python files and it now doesn't report an error. I still can't get it to connect to my dreambox though and I've turned off the intenal firewalls to make sure thats not the problem. Is there something that needs to be configured on the vu+ duo box? I'm running the latest vix image.


    DEBUG:root:Constructing universe
    DEBUG:root:Registering base as Base device
    DEBUG:root:Registering base as default device
    DEBUG:root:Commands available: {'blue': 'Turns on the bluetooth server', 'map': 'Device ui map', 'help': 'List of commands', 'selected': 'Identify selected device', 'sweep': 'Sweep activation and status', 'devices': 'List known devices.', 'security': 'Security information', 'select': 'Select a device'}
    DEBUG:root:client.shell BEGINS
    ERROR:root:VLC failure on 127.0.0.1: [Errno socket error] (10061, 'Connection refused')
    DEBUG:root:client.send BEGINS with input: sweep on 192.168.2.10
    DEBUG:root:client.receive BEGINS
    DEBUG:root:Executing sweep on 192.168.2.10 on Base device
    DEBUG:root:Generated and executing result = self.sweep( client_, "on", "192.168.2.10" )
    DEBUG:root:client.send BEGINS with input: devices
    DEBUG:root:client.receive BEGINS
    DEBUG:root:Executing devices on Base device
    DEBUG:root:Generated and executing result = self.devices( client_ )
    ERROR:rootreambox failure on 192.168.2.10: [Errno socket error] timed out
    ERROR:rootreambox failure on 192.168.2.10: [Errno socket error] timed out
    ERROR:rootCP failure on 192.168.2.10: (10061, 'Connection refused')
    ERROR:rootCP failure on 192.168.2.10: (10061, 'Connection refused')
    ERROR:root:VLC failure on 192.168.2.10: [Errno socket error] (10061, 'Connection refused')
    ERROR:root:VLC failure on 192.168.2.10: [Errno socket error] (10061, 'Connection refused')
    ERROR:root:Xine failure on 192.168.2.10: (10061, 'Connection refused')
    ERROR:root:Xine failure on 192.168.2.10: (10061, 'Connection refused')
    DEBUG:root:client.send BEGINS with input: select base
    DEBUG:root:client.receive BEGINS
    DEBUG:root:Executing select base on Base device
    DEBUG:root:Generated and executing result = self.select( client_, "base" )

  5. #20

    Title
    Junior Member
    Join Date
    Dec 2010
    Posts
    27
    Thanks
    0
    Thanked 10 Times in 5 Posts
    What's the ip address of the dreambox?

    Edit:

    Ah - it's the 192.168.2.10 address that you tried to sweep on - hmm - how big is your channel list then?

    The timeout there would indicate that it is being found, but it times out before the download is complete I think...

    Try this - on line 18 of dcpstart, there's a line which reads:

    socket.setdefaulttimeout( 10 )

    Try upping 10 to 20 and try again...
    Last edited by lilo_booter; 01-01-11 at 15:35.

  6. #21

    Title
    Junior Member
    Join Date
    Sep 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    VU+ duo = 192.168.2.10
    For some reason the program automatically scans 127.

  7. #22

    Title
    Junior Member
    Join Date
    Dec 2010
    Posts
    27
    Thanks
    0
    Thanked 10 Times in 5 Posts
    Wonder if you missed the edit I made on the last post regarding the timeout?

  8. #23

    Title
    Junior Member
    Join Date
    Sep 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The timeout seems to have made a difference. It's still not working exactly like you say it should - for example it scans the 127 subnet and seems to find devices but my PC is on a 192 subnet. No matter what I do it won't change.

    However, at least now I can find the dbox and issue commands such as issue a channel list or bouquest list. Whats next ?

  9. #24

    Title
    Junior Member
    Join Date
    Dec 2010
    Posts
    27
    Thanks
    0
    Thanked 10 Times in 5 Posts
    Kinda puzzled by that... would like to get to the bottom of it as it should only check 127.0.0.1 - it'll look for VLC running a web server for example (again with the idea being that the handheld device which is running the client to the dcp server can control this for scheduling playout and various transport type controls). It should then determine the ip address of the box and scan for any which respond in the rest of the subnet (using a rather natty ping approach - would have preferred arp or bonjour, but the former requires privelige escalation and the latter only works for components which announce themselves via that mechanism - and it's a bitch from a cross platform point of view).

    Anyway, techie ramblings aside, are you perhaps running two subnets? Like your PC on 192.168.1.x and the Duo on 192.168.2.x? The automatic sweep definitely won't attempt to dig that far... alternatively, it's just that python is failing to recognise the non-loopback address. Am very curious either way - would like to know what's going on there .

    I guess you need to do the 'sweep on 192.168.2.10' each time you start the dcp server? Or does it automatically reconnect once it's been found once? (Can't recall which way I implemented that ).

    Anyway, on to ps3mediaserver by way of twistd...

    You need to install one more python module:

    Code:
    http://twistedmatrix.com/trac/wiki/Downloads
    Once installed, you'll need to run the following:

    set PYTHONPATH=<full-path>\dcp\src
    twistd web --port=57739 --path=%PYTHONPATH%/dcpwww

    I hope that'll work on windows - create a .bat or .cmd file if it does (sorry - only just realised that the dcptwist script which does this is a bourne shell thing). Afaik, this should just create a background process, so it should terminate immediately and free up your command prompt. What it's doing is creating a small http server on port 57739 which is running a couple of cgi scripts which ps3mediaserver will communicate with.

    You now need to edit the pms WEB.conf file. In here we place some entries which query the http server for channels (and it, in turn, queries the dcp server using the same commands you've already seen on the dcp command line). This is a bit fugly, but should work OK - Rather than have one huge listing, I split mine up alphabetically so it adds 26 lines to the WEB.conf, like:

    videofeed.TV,Duo=http://localhost:57739/rdf.cgi?box=dbox&search=%5EA&title=A
    videofeed.TV,Duo=http://localhost:57739/rdf.cgi?box=dbox&search=%5EB&title=B
    videofeed.TV,Duo=http://localhost:57739/rdf.cgi?box=dbox&search=%5EC&title=C
    etc

    (The %5E is an url quoted ^ - the search is a regular expression, so it says 'names beginning with A').

    If you have a Bouquet called 'Favourites' you can try this too:

    videofeed.Bouquets=http://localhost:57739/rdf.cgi?box=dbox&type=view%20Favourites&title=Duo

    Restart your ps3mediaserver, and go to the General Configuration tab - uncheck the 'HTTP Engine v2' checkbox (if v2 is running, it works, but the start up times are enormous... it's a bit snappier with v1). You may need to restart ps3mediaserver again (can't recall).

    Turn on PS3, navigate to Video, select ps3mediaserver entry - and, umm, hopefully your Duo should be listed?

    (touches wood, shakes voodoo stick and holds breath...)

    Edit, while I still can - couple of pointers:

    To revisit a channel, you need to use the triangle and select play from start (otherwise it tries to seek to somewhere and it all goes horribly, horribly wrong ).

    Occassionally, things go a bit glitchy and you end up with two lists under the Letter/Bouquet - no idea why this happens. Sometimes one set disappears before your eyes, sometimes it's random as to which channel entry works.

    Second bug is definitely on the ps3mediaserver side (and doesn't seem to happen under http v2), first isn't a bug, it's a feature (which doesn't work for this non-cached streaming content.. sigh).
    Last edited by lilo_booter; 02-01-11 at 07:43. Reason: A couple of gotchas...

  10. #25

    Title
    Junior Member
    Join Date
    Sep 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK, I'm moving forward slowly. I had problems gettings twistd to work yesterday but I now have it working. Next, I modified the web.conf file but I'm not getting anything returned to the ps3. I'm thinking the webserver isn't finding the cgi scripts that you have in dcpwww. With the web server running, my PC web browser just returns 'no such resource'. I was expecting to have some type of challenge to the browser.

    Command Shell Log:
    C:\Python25\Scripts>twistd.py web --port=57739 --path=%PYTHONPATH%/dcpwww
    C:\Python25\lib\site-packages\twisted\web\tap.py:246: DeprecationWarning: Unqualified strport description passed to 'service'.Use qualified endpoint descriptions; for example, 'tcp:57739'. strports.service(config['port'], site).setServiceParent(s)
    2011-01-02 10:05:17+0000 [-] Log opened.
    2011-01-02 10:05:17+0000 [-] twistd 10.2.0 (C:\Python25\python.exe 2.5.0) starting up.
    2011-01-02 10:05:17+0000 [-] reactor class: twisted.internet.selectreactor.SelectReactor.
    2011-01-02 10:05:17+0000 [-] twisted.web.server.Site starting on 57739
    2011-01-02 10:05:17+0000 [-] Starting factory <twisted.web.server.Site instance at 0x010222B0>
    2011-01-02 10:08:12+0000 [HTTPChannel,0,127.0.0.1] 127.0.0.1 - - [02/Jan/2011:10:08:11 +0000] "GET /rdf.cgi?box=dbox&search=%5EB&title=B HTTP/1.1" 404 145 "-" "Java/1.6.0_22"

  11. #26

    Title
    Junior Member
    Join Date
    Sep 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK, so the path was wrong for dcp. \ for windows and / for linux
    Next problem ... I think I need to find pywin32 because I'm getting

    <type 'exceptions.NotImplementedError'>: spawnProcess not available since pywin32 is not installed.




    Command Shell Log:
    2011-01-02 10:31:39+0000 [HTTPChannel,0,127.0.0.1] 127.0.0.1 - - [02/Jan/2011:10
    :31:39 +0000] "GET /rdf.cgi?box=dbox HTTP/1.1" 500 30288 "-" "Mozilla/5.0 (Windo
    ws; U; Windows NT 5.1; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET
    CLR 3.5.30729; .NET4.0E)"
    2011-01-02 10:32:36+0000 [HTTPChannel,1,127.0.0.1] Unhandled Error
    Traceback (most recent call last):
    File "C:\Python25\Lib\site-packages\twisted\protocols\basic.py", line
    564, in dataReceived
    why = self.lineReceived(line)
    File "C:\Python25\Lib\site-packages\twisted\web\http.py", line 1573, i
    n lineReceived
    self.allContentReceived()
    File "C:\Python25\Lib\site-packages\twisted\web\http.py", line 1641, i
    n allContentReceived
    req.requestReceived(command, path, version)
    File "C:\Python25\Lib\site-packages\twisted\web\http.py", line 807, in
    requestReceived
    self.process()
    --- <exception caught here> ---
    File "C:\Python25\Lib\site-packages\twisted\web\server.py", line 125,
    in process
    self.render(resrc)
    File "C:\Python25\Lib\site-packages\twisted\web\server.py", line 132,
    in render
    body = resrc.render(self)
    File "C:\Python25\Lib\site-packages\twisted\web\twcgi.py", line 124, i
    n render
    self.runProcess(env, request, qargs)
    File "C:\Python25\Lib\site-packages\twisted\web\twcgi.py", line 147, i
    n runProcess
    os.path.dirname(self.filename))
    File "C:\Python25\Lib\site-packages\twisted\internet\posixbase.py", li
    ne 335, in spawnProcess
    raise NotImplementedError, "spawnProcess not available since pywin32
    is not installed."
    exceptions.NotImplementedError: spawnProcess not available since pywin32
    is not installed.

  12. #27

    Title
    Junior Member
    Join Date
    Dec 2010
    Posts
    27
    Thanks
    0
    Thanked 10 Times in 5 Posts
    Quote Originally Posted by daz500 View Post
    OK, so the path was wrong for dcp. \ for windows and / for linux
    Next problem ... I think I need to find pywin32 because I'm getting

    <type 'exceptions.NotImplementedError'>: spawnProcess not available since pywin32 is not installed.
    Mutter, mutter, windows, mutter.



    Still not working after installing that?

  13. #28

    Title
    Junior Member
    Join Date
    Sep 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No because thats another set of problems. I found an installer but it didn't like me not having Visual Studio 2003 to build the files it needed. I found another version but now python complains when starting up:

    C:\DCP>python dcpstart
    c:\python25\lib\platform.py:475: RuntimeWarning: Python C API version mismatch f
    or module win32api: This Python has API version 1013, module win32api has versio
    n 1012.
    import win32api
    dcp@localhost:577Alternative ReadLine 1.7 -- Copyright 2001, Chris Gonnerman

    There were lots of errors when browsing to the web server from my PC:

    http://localhost:57739/rdf.cgi?box=d...y_UK&title=Duo




    web.Server Traceback (most recent call last):

    <type 'exceptions.TypeError'>: an integer is required
    C:\Python25\Lib\site-packages\twisted\web\server.py, line 125 in process
    123 try:
    124 resrc = self.site.getResourceFor(self)
    125 self.render(resrc)
    126 except:


    C:\Python25\Lib\site-packages\twisted\web\server.py, line 132 in render
    130 def render(self, resrc):
    131 try:
    132 body = resrc.render(self)
    133 except UnsupportedMethod, e:
    Locals
    resrc
    twisted.web.twcgi.CGIScript instance @ 0x12b96c0 <twisted.web.twcgi.CGIScript instance at 0x012B96C0>
    self
    twisted.web.server.Request instance @ 0x1246760 <GET /rdf.cgi?box=dbox&type=view%20Numbered_As_Sky_UK&ti tle=Duo HTTP/1.1>
    Globals
    UnsupportedMethod <class 'twisted.web.error.UnsupportedMethod'>


    There were lots more on the page but all similar to this

  14. #29

    Title
    Junior Member
    Join Date
    Dec 2010
    Posts
    27
    Thanks
    0
    Thanked 10 Times in 5 Posts
    yick - ok, doesn't seem to be a good route - can you uninstall pywin32 and have the warnings on dcpstart disappear? If not, you might need to reinstall python I guess.

    Shouldn't be too much trouble to do the twistd thing properly or perhaps switching to tornado (which is a much better python based http platform anyway). Will give it a go this evening and post back with the results.

    Sorry about this, but thanks a lot for the feedback so far - much appreciated.

  15. #30

    Title
    Junior Member
    Join Date
    Sep 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I tried a different pwywin32 so don't get the error when Python starts up. This time the error when using the web service is:

    <type 'exceptions.OSError'>: (3, 'CreateProcess', 'The system cannot find the path specified.')
    C:\Python25\Lib\site-packages\twisted\web\server.py, line 125 in process
    123 try:
    124 resrc = self.site.getResourceFor(self)
    125 self.render(resrc)
    126 except:

    I'm going to try the other web server now I have Python working again.

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.