Announcement

Collapse
No announcement yet.

Skin commands to control USB relay

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Skin commands to control USB relay

    I am using RR from 01-01-10 and am trying to figure out how to control a USB relay when I select HD Radio and when the audio source changes to something other than HDRadio. The relay board will control the power antenna. I want it to extend only when HD Radio is selected.

    I have looked for a skin how-to and can't find it. I have done a number of searches in these forums and found nothing applilcable.

    Can someone give me some insight on how to execute an external command to control the relay?

  • #2
    Do you have an external board or anything like that to control the relay ? how do you have the relay hooked up ?

    At the least you're going to need the SerialSwitch plugin with the relay hooked up to the serial port (output pin) -- probably using a transistor+resistor at the least.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

    Comment


    • #3
      It is a board that has a USB interface that appears to the computer as a serial port. I already wrote a small util to open the serial port and turn the realy on or off. I just want to know how to call the program I wrote when I select HD Radio and then again when the audio source changes.

      Comment


      • #4
        You already did the hardest part.. you just need to use the RUNQ command to execute your application when going in/out of the screen.. simplest way is to edit the .skin files:

        in menu.skin -- change "RADIO" for "RUNQ;c:\myapp\antennaup.exe||RADIO"
        in radio_player.skin -- change "EXIT" for "EXIT||RUNQ;c:\myapp\antennadown.exe"

        Alternatively, you can put the antenna down command on the buttons for the audio/video in menu.skin so that it only lowers the antenna when you switch the source of audio.
        Ride Runner RR's Myspace

        "Being happy is not about having what you want, it's about wanting what you have."
        "The best things in life are always free - but that doesn't mean money can't buy you good things."

        Comment


        • #5
          Great...that's what I needed!! Thanks!

          Comment


          • #6
            Hmmm...one more problem. When I go to radio (antenna goes up...yea!), back to main menu, then go to video (antenna goes down), when I stop the video it automatically goes back to radio, but the antenna up command is not executed again.

            Any thoughts?

            Comment


            • #7
              yes, that's a typical thing using the resume feature.

              Try adding the following to your exectbl.ini (replace with your command):

              "ONSCREENCHANGE","RUNQ;c:\myapp\antennaup.exe" ,fm

              be sure to remove the "antennaup" command from the RADIO button (as it should no longer be needed). You may want to put a check on your app so it doesn't try to raise the antenna when it's already "up".
              Ride Runner RR's Myspace

              "Being happy is not about having what you want, it's about wanting what you have."
              "The best things in life are always free - but that doesn't mean money can't buy you good things."

              Comment


              • #8
                Originally posted by guino View Post
                yes, that's a typical thing using the resume feature.

                Try adding the following to your exectbl.ini (replace with your command):

                "ONSCREENCHANGE","RUNQ;c:\myapp\antennaup.exe" ,fm

                be sure to remove the "antennaup" command from the RADIO button (as it should no longer be needed). You may want to put a check on your app so it doesn't try to raise the antenna when it's already "up".
                Is there a place to find a reference for these commands? The above command works great for putting the antenna back up when resuming the radio. But when the system comes out of standby and the radio was the last source (so it continues as the computer wakes up), the antenna doesn't go up.

                I am guessing there's an ONRESUME command. Any chance of that? Would the text be the same? i.e.:

                "ONRESUME","RUNQ;c:\myapp\antennaup.exe",fm

                Thanks for the help Guino!!

                Comment


                • #9
                  you can try exactly what you posted:

                  "ONRESUME","RUNQ;c:\myapp\antennaup.exe",fm

                  in any case, the events "ONxxxxx" are listed on exectbl.ini and everything else is described in Skin commands.txt (Docs folder).
                  Ride Runner RR's Myspace

                  "Being happy is not about having what you want, it's about wanting what you have."
                  "The best things in life are always free - but that doesn't mean money can't buy you good things."

                  Comment


                  • #10
                    but that would put the antenna up, even if radio not the ACTIVESOURCE

                    i think a BYVAR;ACTIVESOURCEID

                    is your key
                    -Thanks
                    Mitch
                    www.rush2112.net

                    "Did you test it in carwings??"

                    Sun, Come shine my way
                    May healing waters bury all my pain
                    Wind, Carry me home
                    The fabric of reality is tearing apart
                    The piece of me that died
                    Will return To live again

                    Comment


                    • #11
                      prob a handy ONSourceChange could be added
                      -Thanks
                      Mitch
                      www.rush2112.net

                      "Did you test it in carwings??"

                      Sun, Come shine my way
                      May healing waters bury all my pain
                      Wind, Carry me home
                      The fabric of reality is tearing apart
                      The piece of me that died
                      Will return To live again

                      Comment


                      • #12
                        Well, the ONRESUME command was doing nothing at all. It wasn't until I set hibernateaware=false. Then the ONRESUME command began working.

                        But now, I do not get audio from the HD or XM radios upon resume. If I restart RR, then it works fine. But lose audio upon the next resume. MP3s work fine.

                        But, the antenna up/down works fine now! That onresume command works.

                        EDIT: Should have mentioned that I can communicate with the HD or XM radios via the serial link. I get the name of the artist or signal strength (in XM). Just no audio.

                        Comment


                        • #13
                          very odd... the ONRESUME command should always work but the hibernateaware should be true for most cases. Just make sure you're not using forcehibernate or something like that... how are you hibernating anyway ?
                          Ride Runner RR's Myspace

                          "Being happy is not about having what you want, it's about wanting what you have."
                          "The best things in life are always free - but that doesn't mean money can't buy you good things."

                          Comment


                          • #14
                            Actually, I'm not hibernating. I am suspending and resuming. (S3 to S5).

                            I actually used RRConfig, so I am not sure what ini settings it changed. I will check to be sure.

                            Comment

                            Working...
                            X