Page 1 of 6 123456 LastLast
Results 1 to 10 of 54
  1. #1
    Join Date
    Feb 2012
    Location
    Charlottesville, VA
    Posts
    885

    Default ACP Web Utility for Controlling Observatory Power Strip over the Internet

    Hi Everyone:

    Now that my Digital-Loggers power strip is operational, I thought it would be neat to create a little utility to access the power strip through the ACP web browser so that I could log into the PowerStrip over the Internet. The utility provides two ways to log in, through the LAN using the local IP address (192.xxx.xxx.xxx), and over the Internet using http://observatory.my-sky.com:nnn, where nnn is an external port assigned to the power strip and "observatory" is the name of your my-sky observatory. The benefit of using my-sky is that the apparatus is already in place to manage a dynamic IP address through the NoIPDUC application. So if your ISP provider doesn’t assign you a unique IP address, your my-sky account already solves that problem.

    This posting provides a screen shot of the utility along with instructions for setting it up.

    1) I decided to leave the power strip on the original port. That means that my startup and shutdown scripts can be left alone. The default for the power strip is to listen on port 80. If you change your default port, you have to remember to change your startup and shutdown scripts.

    2) When you log into the Digital Loggers web application, go to “Setup”, then “Network” and uncheck the box “Same Subnet Access Only.” You will now want to access the Digital Loggers power strip from any subnet.

    3) Remember, if you get hung up and make a change and can no longer log into the power strip, you can push a little button on the left side of the device next to the LCD window, and that will reset the device to factory defaults, but will preserve the name of all of your devices. When you press the reset button, the username and password are restored to the original default, so always remember to reset your username and password, and to match that with the username and password in your Startup and Shutdown scripts.

    4) The next step is to set up Port Forwarding in your router. You want to set it up so that the power strip listens on port 80 on the LAN, but listens on another port from the Internet (or WAN). The Digital Logger user’s guide suggests using port 366 (which we’ll call nnn), but you can choose your own port. To set up Port Forwarding, you’ll have to go into your router and play with the settings. On my router, the IP address is the address for the power strip (192.xxx.xxx.xxx). The LAN port, in the example above is 80, and your router might provide for a Start and an End, but you can use the same port for both. The Protocol is TCP. The remote port is where you define the port that the device will listen for on the WAN, nnn. On my router, the Destination Port and the Starting Port were both set to nnn. There was also an opportunity to set the Remote IP address, which I left blank.

    5) The next step is to create a new tiddler to set up the utility, which I named “Observatory Power Strip”. Here’s the example:

    Click here to access the login for the observatory power strip:

    [[From inside the local area network|http://192.xxx.xxx.xxx]]

    [[From outside the network over the Internet|http://observatoryname.my-sky.com:nnn]]

    6) If you want to display this utility as a startup item, be sure to add it to the “StartupItems” tiddler.

    Below, please find a screen shot of the utility. (You may have to click on it to enlarge it.) With this little utility, you can now access your Digital-Loggers power strip from anywhere in the world.

    Best,

    Rob

    Attachment 4899
    Attached Images Attached Images
    Rob Capon
    (Self-appointed) "Executive Director"
    Stillhouse Mountain Observatory
    Charlottesville, VA
    ----------------------------------
    RCOS 12.5 with SBIG STL11000M
    Televue NP101is with SBIG ST8300
    Paramount ME with SkyX
    Techn. Innovations PD10 with Digital Domeworks
    Robofocuser
    ACP with MaximDL and FocusMax

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

    Default

    Hi Rob, Neato! Did you know that you can test which address (LAN or WAN) your connection comes from? With that information you can then direct the correct type of command to give the power switch. I do this for myself for looking at the observatory webcam. If I'm remote from somewhere else on Earth, it uses the my-sky form of the request; if I'm on the LAN, is uses the ....192 form. I don't have the code in hand right now, but I'll post it here when I get home later this afternoon. This code, a little more complicated than what you devised, would all go in the tiddler. Then you only need ONE "click here" instead of two.
    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
    Feb 2012
    Location
    Charlottesville, VA
    Posts
    885

    Default

    Hi Dick:

    That's a neat variation. When you post the code, I'll give it a try. Yes, the power strip utility is the same idea as using a web cam. One can imagine situations where you might like to access these resources over the Internet, and the my-sky solution gives you a great platform for doing so!

    Best,

    Rob
    Rob Capon
    (Self-appointed) "Executive Director"
    Stillhouse Mountain Observatory
    Charlottesville, VA
    ----------------------------------
    RCOS 12.5 with SBIG STL11000M
    Televue NP101is with SBIG ST8300
    Paramount ME with SkyX
    Techn. Innovations PD10 with Digital Domeworks
    Robofocuser
    ACP with MaximDL and FocusMax

  4. #4
    Join Date
    Sep 2013
    Location
    AZ, WI
    Posts
    181

    Default

    There is an ASCOM driver for the Digital Loggers Switch that greatly simplifies controlling the power strip in ACP. If interested I can post the code I wrote for using the driver.


    Sent from my iPad using Tapatalk

  5. #5
    Join Date
    Feb 2012
    Location
    Charlottesville, VA
    Posts
    885

    Default

    Jeff-

    That would be great. Could you also describe the advantages of using the ASCOM driver? As I understand it, if you use the driver you no longer need the ECP2.exe program. Is that correct?

    At present, I have the switch working with my startup and shutdown scripts, so I'm in the mode "if it ain't broke, don't fix it." But I'd definitely like to learn more.

    Thanks,

    Rob
    Rob Capon
    (Self-appointed) "Executive Director"
    Stillhouse Mountain Observatory
    Charlottesville, VA
    ----------------------------------
    RCOS 12.5 with SBIG STL11000M
    Televue NP101is with SBIG ST8300
    Paramount ME with SkyX
    Techn. Innovations PD10 with Digital Domeworks
    Robofocuser
    ACP with MaximDL and FocusMax

  6. #6
    Join Date
    Sep 2013
    Location
    AZ, WI
    Posts
    181

    Default

    I will post the code tonight when I get home. As to advantages, no ECP2 program, no need for network port forwarding ( up side is you don't expose your power control directly to the internet), allows for reading outlet state data (on/off), provides discovery ( read the names of your outlets and the number of outlets). It is more reliable, since you don't have to rely on the successful running of another program. You can easily write code to monitor the state of individual outlets and me notified if something goes offline. Less support code, easier to maintain, you can actually handle exceptions should they be thrown, with ECP2 you have little information on what might have gone wrong.
    Easily incorporated in to user actions, for example I power up my mirror cover and close it before dark frames, open afterward and then power off again. Faster running, more responsive weather safety scripts, you can verify that anything that gets turned off or on is actually off or on. If using scheduler startup and shutdown scripts are much much cleaner,. I could go on but you get the idea, anytime you can remove an external run process from the equation the better.


    Sent from my iPad using Tapatalk

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

    Default

    Hi Rob,

    Here's my tiddler for a webcam interface. It's the REMOTE_ADDR and SERVER_NAME variable that reads the "source" location. So I have three paths through the code. One is for the NAT (192...), the second for the local observatory, and the third for the my-sky route. You will get the idea and modify your own code appropriately:
    Code:
    <html>
    <div align="left">
    <% if(Request.ServerVariables("REMOTE_ADDR").substr(0 , 3) == "192") { %>
       <iframe src="http://192.168.1.194:port/img/snapshot.cgi?size=2&quality=1" frameborder="0"
          width="340" height="260"></iframe>
    <% } else if(Request.ServerVariables("SERVER_NAME").substr(0 , 5) == "local") { %>
       <iframe src="http://192.168.1.194:port/img/snapshot.cgi?size=2&quality=1" frameborder="0"
          width="340" height="260"></iframe>
    <% } else { %>
       <iframe src="http://ObservatoryId.my-sky.com:port/img/snapshot.cgi?size=2&quality=1" frameborder="0"
          width="340" height="260"></iframe>
    <% } %>
    </div>
    </html>
    <<RefreshTiddler 'Update' 'Get a new image' 10>>
    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

  8. #8
    Join Date
    Feb 2012
    Location
    Charlottesville, VA
    Posts
    885

    Default

    Dick-

    Thanks for posting the code.

    best,

    Rob
    Rob Capon
    (Self-appointed) "Executive Director"
    Stillhouse Mountain Observatory
    Charlottesville, VA
    ----------------------------------
    RCOS 12.5 with SBIG STL11000M
    Televue NP101is with SBIG ST8300
    Paramount ME with SkyX
    Techn. Innovations PD10 with Digital Domeworks
    Robofocuser
    ACP with MaximDL and FocusMax

  9. #9
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    26,422

    Default

    Wouldn't you know it... Chris Rowland (one of the ASCOM developers and the father of the Switch interface standard) released this thing just weeks after I worked with you on your start/shut script??? I'm going to change the sample scripts for Scheduler 3.7 to show using the driver.
    -- Bob

  10. #10
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    26,422

    Default

    Very helpful!! I noted that 'port' appears in place of a numerical port number. I assume that is to keep people from knowing how to get to your camera, ha ha.
    -- Bob

 

 

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. 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, 10:25
  2. Power control for CPS power strip?
    By Joel Hatfield in forum Hardware/Software/Driver Topics Not Directly Related to Our Software
    Replies: 2
    Last Post: Aug 16, 2010, 13:35

Posting Permissions

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