Page 1 of 3 123 LastLast
Results 1 to 15 of 32

Thread: Remote Control Thru Serial Port

  1. #1
    Join Date
    Dec 2001
    Location
    Earth
    Posts
    21

    Lightbulb Remote Control Thru Serial Port

    Is there a way to remote control the DirecTiVo thru the Bash shell or the serial port?

    Essentially I want to be able to send a command thru the serial interface to do something as simple as change the channels on the DirecTV..

    Any ideas?

    I know it is possible to do it with the regular DTV rcvrs thru their wideband, lowspeed, and home control ports.

    Thanks,

    -FactorOfX

  2. #2
    Join Date
    Jan 2002
    Posts
    19
    Have you checked Tivoweb.Not sure if it works with Directivo or not but it has a remote in it .search tivoweb and a few other things

  3. #3
    Join Date
    Dec 2001
    Posts
    33
    Yes there is, and I have it working as we speak. The method is slightly convoluted. I'll describe the items used and how it works below.

    What you will need:

    - The X10 mp3 Anywhere remote. This is a very cool RF remote with a reciever that plugs into the serial port of your PC

    - IRAssistant for Windoze. Gives you the ability to run macros on your PC based on the buttons pressed on the RF remote.

    - TivoWeb running on the Tivo via PPP on the serial port.

    - wget.exe for your Windoze machine. A simple command line app that retrieves the html from a web page. Very cool.

    Here is how all of this works together.

    1. A button is pressed on the X10 remote (from anywhere in the house, it's RF)

    2. The command is picked up by the RF reciever on the PC, and IRAssistant launches a .bat file corresponding to the button pressed. (for our example, Channel Up)

    3. The .bat file contains a wget.exe command to retrieve one of the TivoWeb pages on the virtual remote. (wget.exe http://192.168.10.2/sendkey/ChanUp)

    4. Hitting that page causes TivoWeb to pump the Channel Up command string into the IR tty port, causing the channel to change.

    Ok, I know this is a bit of a kludge, but it does work! I hope this helps!

    --ID_Man

  4. #4
    Join Date
    Dec 2001
    Location
    Earth
    Posts
    21

    Thread Revival

    That was a nice idea ID_Man.. But not exactly what I was looking for. What I really wanted to know if there was a set of commands that you can send thru the Serial port or even the bash prompt to make changes on the Unit..

    I.E.

    BASH# change channel up

    BASH# change channel 356

    etc etc...

    Know what I mean?

    Thanks,

    FactorOfX

  5. #5
    Join Date
    Sep 2001
    Posts
    889
    I recall seeing something like that in TCL somewhere, but you could roll your own too..
    basically a script like such:

    #!/bin/bash
    #channel changer script

    CH_up=<code for up>
    CH_down=<code for down>
    PF_0=<code for 0>
    ..
    PF_9=<code for 9>

    case [ $1 ]
    up:
    echo $CH_up >/dev/ttyS1
    down:
    echo $CH_down >/dev/ttyS1
    ??number??
    echo <appropriate sequence> >/dev/ttyS1
    esac

    obviously, this code isn't real, but with a bash programming manual and the appropriate codes, it should eb a breeze to get going.. (if you can't find TCL that already does it)

  6. #6
    Join Date
    Jul 2001
    Posts
    426
    Check out the sendkey script at http://tivo.samba.org/download/tridge/SendKey
    It allows you to use the tivosh SendKey utility from the bash prompt.

  7. #7
    Join Date
    Nov 2001
    Posts
    51

    Thumbs up

    I think this is what your looking for. Pretty cool util
    it'll work on my 4 gen sony but haven't looked at my dsr6k
    http://www.pcmx.net/dtvcon/

  8. #8
    Join Date
    Nov 2001
    Posts
    51

    Thumbs up

    dunno why it posted 2x?

  9. #9
    Join Date
    Dec 2001
    Location
    Earth
    Posts
    21

    Toadfish.. That's Close

    Yea I saw that program and that's what started this whole thing. My hughes doesn't have WideBand LowSpeed or Home Control ports on it, only the Serial for the BASH..

    I guess its easy to send the command to the thing thru the BASH prompt. Just type them in. Question is:

    What are the control commands?

    Thanks to BubbaJ I am on the right track. Now I just need to know where to find those control commands and we will be set.

    -FactorOfX

  10. #10
    Join Date
    Sep 2001
    Posts
    889
    Tridges sendkey loop should work..

    Thanks TheDoctor

    SendKey 2 4 5 enter

    would tune to 245

    and you could wrap it with something that breaks apart the keys and adds the enter


    //!!//Start
    #!/bin/bash
    #channel changer script - usage: cc <channel>

    mI=$1
    until [ "$mI" -eq 0 ]; do
    lM=$(($mI % 10))
    SendKey $lM
    mI=$(($mI / 10))
    done

    SendKey enter
    //!!//End


    should do the trick

  11. #11
    Join Date
    Jan 2002
    Location
    New York
    Posts
    2,406

    Yikes

    Originally posted by BubbaJ
    Tridges sendkey loop should work..

    Thanks TheDoctor

    SendKey 2 4 5 enter

    would tune to 245

    and you could wrap it with something that breaks apart the keys and adds the enter


    //!!//Start
    #!/bin/bash
    #channel changer script - usage: cc <channel>

    mI=$1
    until [ "$mI" -eq 0 ]; do
    lM=$(($mI % 10))
    SendKey $lM
    mI=$(($mI / 10))
    done

    SendKey enter
    //!!//End


    should do the trick
    Nice one....

    Except, this is my output....

    ------------------------------

    bash-2.02# cc 596
    <166>Jan 23 22:48:30 tcl[679]: Tcl created pool of 1458176 bytes
    <166>Jan 23 22:48:30 ContextTests[679]: 6
    6
    <166>Jan 23 22:48:31 tcl[680]: Tcl created pool of 1458176 bytes
    <166>Jan 23 22:48:32 ContextTests[680]: 9
    9
    <166>Jan 23 22:48:33 tcl[681]: Tcl created pool of 1458176 bytes
    <166>Jan 23 22:48:34 ContextTests[681]: 5
    5
    <166>Jan 23 22:48:35 tcl[682]: Tcl created pool of 1458176 bytes
    <166>Jan 23 22:48:36 ContextTests[682]: enter
    enter
    bash-2.02#

    ---------------------------------

    <giggle> It parses it backwards...

    JJ

  12. #12
    Join Date
    Jan 2002
    Location
    New York
    Posts
    2,406
    Instead of just complaining.. I was looking at the code that BubbaJ wrote above... I added 10 seconds worth of coding for those of you guys who want a "cooler" look.. Not much skill involved..

    ------------------

    #!/bin/bash
    #channel changer script - usage: cc <channel>

    mI=$1
    until [ "$mI" -eq 0 ]; do
    lM=$(($mI % 10))
    SendKey $lM > /dev/null
    mI=$(($mI / 10))
    done

    echo "Changing Channel to '$1' "

    SendKey enter > /dev/null

    -------------------------------

    It still parses backwards, but I'm looking at why. Hopefully BubbaJ will get here before my puny head explodes.

    If I knew an ounce about linux or tcl it would help. I think we could just load up an array with the channel numbers, and pick them up in reverse order..

    No ?


    JJ
    Last edited by JJBliss; 01-23-2002 at 07:44 PM.

  13. #13
    Join Date
    Jan 2002
    Location
    TX
    Posts
    31
    It's parsing backwards because from the logic:

    245 % 10 = 5 <--
    245/10 = 24

    24 % 10 = 4 <--
    24/10 = 2

    2 % 10 = 2 <--

    % means modulus
    -chinhster

  14. #14
    Join Date
    Sep 2001
    Posts
    889
    oops..

    and merely swapping the logic won't work either.. (it'll lose channels ending in 0)

    so.. here ti si..
    ------------------

    #!/bin/bash
    #channel changer script - usage: cc <channel>
    mI=$1

    mI3=$(($mI % 10))
    mI=$(($mI / 10))
    mI2=$(($mI % 10))
    mI=$(($mI / 10))
    mI1=$(($mI % 10))
    mI=$(($mI / 10))
    mI0=$(($mI % 10))
    mI=$(($mI / 10))

    echo "Changing Channel to '$1' "

    SendKey $mI0 > /dev/null
    SendKey $mI1 > /dev/null
    SendKey $mI2 > /dev/null
    SendKey $mI3 > /dev/null
    SendKey enter > /dev/null



    -------------------------------

  15. #15
    Join Date
    Jan 2002
    Location
    TX
    Posts
    31
    How about:

    ------------------

    #!/bin/bash
    #channel changer script - usage: cc <channel>

    num=$1
    div=1000
    until [ "$div" -eq 0 ]
    do
    key=$(($num / $div))
    SendKey $key > /dev/null
    num=$(($num % $div))
    div=$(($div / 10))
    done

    echo "Changing Channel to '$1' "

    SendKey enter > /dev/null

    -------------------------------

    Dominion insists that I mention that he fixed my syntax errors.

    Oops, BubbaJ beat me to it. I just took out the logic to remove the leading 0's.
    Last edited by chinhster; 01-23-2002 at 08:41 PM.
    -chinhster

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •