Page 1 of 4 1234 LastLast
Results 1 to 10 of 38

Hybrid View

  1. #1
    Join Date
    Apr 2013
    Location
    Milton, ON, Canada
    Posts
    893

    Default Handy utility for a West Mountain Radio RigRunner 4005i 12V DC web power switch

    Hi folks,
    I've created a little utility in javascript that will control a West Mountain Radio RigRunner 4005i power switch.
    Here's some details on this bad boy:
    http://www.westmountainradio.com/pro...ts_id=rr_4005i

    WMR doesn't document the protocol or offer a utility, so I figured it out, and created this little program.

    Let me know if you'd like to test it out, and I'll send you a copy.

    It lets me turn on and off any of the 5 ports to supply 12VDC to my PC, mount, dew heaters, roof, and accessories.
    The RR is great, because you can control it from a web page, like this:
    rr4005i.png
    I figured out how to control it from javascript, and so created a command-line utility that you could launch from your startup or shutdown scripts.
    It will also report on the voltage it sees, and will give an ERRORLEVEL status of 1 if the voltage is too low.

    You could also take the code and just stuff it directly into the startup/shutdown with some editting.

    If anybody is a javascript whiz, would appreciate some feedback/tweaks for my code.

    Also, it's been suggested I do an ASCOM Switch driver. I might need a bit of a hand with that... never written one.
    Thanks
    Colin

  2. #2
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    4,705

    Default

    Hi Colin,

    My new observatory is built - next comes trying to remember how to use the telescope/camera/accessories after six months off the air! All that alignment stuff, more flats, new focus offsets, .... I'm in the process now of getting all the instrumentation back online.

    In any case, I bought a Digital Logger power switch. There are eight IP switches. I'd love to see if I can adapt your script to this device. And I would think it would be easy to embed the script it in a tiddler. Not sure if I can help you with an ASCOM driver, though. It would be product specific on the switch end.

    The observatory is 490 feet from the house, so I've run a fiber optic cable to the observatory. I have a Zylex 8-port Ethernet switch, which in combination with an UPS and the power strip will (I think, and I hope) will give me fail-safe and gracious shutdown and startup, especially following a power outage.
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    w. focal reducer to f/5.3 ~ FL 1630mm
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XME
    FOV ~ 15' x 10'
    H-alpha, BVRI, RGB & Clear filters
    MaxIm and, of course, ACP!
    AAVSO Code: BRIC

  3. #3
    Join Date
    Apr 2013
    Location
    Milton, ON, Canada
    Posts
    893

    Default

    NOTE: I need to come back and edit this.. but laptop battery dying.

    Hi Dick,
    I think someone has tackled the Digital Logger switch already, and there is a bit of code in the SampleShutdown.js script for it.

    One handy thing I'm doing if things are really bad with power, is a nice PC shutdown, where at the end of the script, I'm invoking the windows shutdown command, and it will make a Windows event log entry in teh System Log, with an Information log entry with a comment explaining the reason.

    The essentials are:

    // Modify the shutdown parameters per below.
    // The /t parameter is 600 seconds = 10 minutes, should be enough time to park scope, close roof, etc.
    // The /c paramater is a comment explaining why shutdown, will be in the Windows Event Log System Log
    // the p:06:12 says its a planned shutdown due to Power Failure in the Environment.

    var shell = new ActiveXObject("WScript.Shell");
    shell.run("cmd /c shutdown /s /t 600 /c "RigRunner reported Low Voltage" /d p:06:12");

    and do whatever else you need.

  4. #4
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    4,705

    Default

    Thanks, Colin. You reminded me that there was a lot of chat on the Forum beginning in 2010 about the Digital Loggers power strip, so I was able to find all of that, plus the ASCOM driver. That should suit me. The code Bob added in the SampleStartupObs.js (in Scheduler) is also a useful stub.
    Last edited by Dick Berg; Nov 13, 2017 at 13:44. Reason: 2010, not 2014
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    w. focal reducer to f/5.3 ~ FL 1630mm
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XME
    FOV ~ 15' x 10'
    H-alpha, BVRI, RGB & Clear filters
    MaxIm and, of course, ACP!
    AAVSO Code: BRIC

  5. #5
    Join Date
    Nov 2013
    Location
    Herriman UT, USA
    Posts
    6

    Default

    Hi Colin,
    I just acquired a rigrunner 4005i and would very much appreciate copy of your javascript / command line utility to control it.
    Thanks,
    Tony
    www.tonysastrophotos.com

  6. #6
    Join Date
    Apr 2013
    Location
    Milton, ON, Canada
    Posts
    893

    Default RIGrunner 4005i control script Beta 0.3

    Hi all,
    I've attached the latest beta 0.3 version here.
    Let me know if you have any issues.
    You can shell out to a command line and run "csript rr.js".
    If you pass it nothing, it will report the voltage.
    If you pass it the 5 node values 1 0 or x it will turn each node on, off, or leave alone.
    Feedback welcome.
    Note that you have to edit the rr.js to put in the correct parameters for your West Mountain Radio RIGrunner 4005i IP address, etc.
    Cheers
    Colin
    Attached Files Attached Files

  7. #7
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    26,679

    Default

    I just looked at this -- You are a Javascript guru! I note the use of === and such. Bravo! Check this out:

    http://forums.dc3.com/showthread.php...9167#post69167
    -- Bob

  8. #8
    Join Date
    Apr 2013
    Location
    Milton, ON, Canada
    Posts
    893

    Default

    Thanks, you're too kind... I one day aspire to minor wizard on ye olde forum.

  9. #9

    Default

    Hi Colin,
    I know it's been a while since you worked on this. I'm having trouble getting the rr.js script to work on my setup. If you had a moment or two to take a look at my version of rr.js it would be very much appreciated. I'm getting Errors 3 & 7 on lines 194 and 247 which is where I'm to put in my settings. I've attached a copy inside a zipped folder. I've been trying everything to get past this so this latest version isn't necessarily my best try just my last try.
    Thanks,
    Attached Files Attached Files
    Dan Simpson
    Galisteo Observatory
    Santa Fe, NM

  10. #10
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    4,705

    Default

    Hi Dan,

    I hope Colin doesn't mind if I jump in here with some ideas for you. I hope you don't mind either. I'm sure Colin will respond when he sees your post.

    At your lines 193-4, here are the two statements:

    // OLD: u = "http://" + username + ":" + password + "@" + ip_address + url_page;
    u = "http:\\++:++@+192.168.1.18+192.168.1.18/index.htm";


    The question is - do you need to provide the username and password or not? If not, then simply build the URL this way:

    u = "http://192.168.1.18/index.htm";


    If you do need username and password, then just type them in place below (whatever they are). You may have to be careful about special characters in the password part:

    u = "http://username[colon]password@192.168.1.18/index.htm";

    In this version you have all the parts you need, the username, the password, the ip address (192.168.1.18), and the url page (index.htm).

    The statement you constructed won't work, as you discovered.
    - the double-backslash at the start will be interpreted as just a single backslash. This is a javascript construct. If you're curious about this, go to https://www.w3schools.com/js/js_strings.asp, and scroll down to "Escape Character".

    - the "pluses" in the OLD version indicate concatenation for the various string parts, and should only be used when you have mixed string literals and string variables. Your version has an IP address part that looks like "++:++@+192.168.1.18+192.168.1.18".

    Alternatively, you can just use the OLD format and put in your information in the variables at lines 59-61, and 68. If you do this, and don't need the username and password, Colin's line 194 will be sufficient.

    Similarly for your code at line 247.

    I hope this helps, but if you need more help understanding this, please ask.
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    w. focal reducer to f/5.3 ~ FL 1630mm
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XME
    FOV ~ 15' x 10'
    H-alpha, BVRI, RGB & Clear filters
    MaxIm and, of course, ACP!
    AAVSO Code: BRIC

 

 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ACP Web Utility for Controlling Observatory Power Strip over the Internet
    By Robert Capon in forum Add-Ons, Enhancements, and Helper Components
    Replies: 53
    Last Post: Feb 14, 2017, 15:28
  2. Web Switch/Windows 10
    By Steve Reilly in forum Hardware/Software/Driver Topics Not Directly Related to Our Software
    Replies: 18
    Last Post: Mar 25, 2016, 00:53
  3. IP Power Switch control over ACP Web interface
    By Josef Huber in forum Add-Ons, Enhancements, and Helper Components
    Replies: 2
    Last Post: Jan 13, 2015, 11:25

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
  •