Light Vortex Astronomy
  • Blog
  • Astrophotographs
  • Articles
  • Tutorials
  • Links
  • About Me
  • About e-EyE
 ​Send a Gift via PayPal:

Remote Hosting in Spain:
Picture

 

Tweet Remote Control


1. InTRODUCTION
Picture
​Tweet Remote Control is a Windows program written in Visual C# 2015, embedding the Tweetinvi and ASCOM​ references. It is meant to act as an inconspicuous safety backup, particularly useful to those with remote hosting for their astrophotography equipment. 

The main motivation behind Tweet Remote Control is for when you lose remote control of the remote computer. This can happen due to various reasons, including TeamViewer failing or their server encountering connectivity problems. It is sometimes necessary to restart the computer, or TeamViewer alone, for example, in order to recover remote control. When all else fails, parking your mount and closing your roof may become necessary measures to protect the equipment against possible collisions and from the elements. It is here that Tweet Remote Control can assist, provided the remote computer has an active Internet connection, of course. This stops you needing to have someone to immediately attend to the equipment physically. 

Put simply, Tweet Remote Control starts with Windows and runs in the background. It connects to a Twitter account of choice and therefore responds to specific commands, effectively sent by tweeting them via the connected Twitter account. The program monitors this connected Twitter account and reads new tweets made. If a tweet made matches a command written into the program, it deletes the tweet, executes the command received and tweets on your behalf (to update you on what is happening). Since all the program requires to function is a connection to a Twitter account, it need only be running on the remote computer with an active Internet connection - the rest is up to your tweet​ commands! Many features are supported, including control of ASCOM roofs, mounts and power relay switches (as well as Lunatico Astronomia's Seletek Dragonfly) and mounts connected via TheSkyX​ (e.g. Paramount​ mounts). 

Tweet Remote Control ensures it always starts automatically with Windows (once you connect a Twitter account, that is), and re-authenticates with Twitter automatically if the Internet connection drops out. This ensures the program is always active with minimum delay, even if the remote computer's Internet connection drops for a period of time. When Tweet Remote Control starts, if it is connected to a Twitter account, it does so minimised to your Windows system tray as a small, black and white icon labelled TRC. Here, the program will remain with no user input required and with no pop-ups whatsoever. The key is being always-on and always-ready​ without user input and without hassling the user with pop-ups or messages. 

It is better to have it and not need it, than to need it and not have it. 

2. DOWNLOAD AND VERSION HISTORY
Picture
Current Version: 1.5.2
Version History
  • 1.5.2:
    • Updated .NET Framework to version 4.6.1. 
    • ​Updated ASCOM reference to version 6.3. 
    • Updated Tweetinvi API reference to version 2.0. 
    • Improved robustness of Twitter re-authentication feature for more reliable post connection drop-out recovery. 
  • 1.5.1:
    • ​Re-coded Twitter re-authentication feature to only do so when the Internet connection to Twitter actually drops out. 
    • Fixed bug that led to unresponsiveness if there was an Internet connection drop-out (feature was not working after changes made in version 1.5). 
  • 1.5:
    • Added support for working with TheSkyX Serious Astronomer and Professional Editions (e.g. for Paramount mounts) using local (127.0.0.1) TCP connection on port 3040 (thanks to Anat Ruangrassamee for the continuous support and Beta testing).
    • Added command (TRC TheSkyX Park) to park a mount connected to TheSkyX (e.g. Paramount mount).
    • Added command (TRC TheSkyX Home) to find home on a mount connected to TheSkyX (e.g. Paramount mount).
    • Added command (TRC TheSkyX Check) to check the current status of a mount connected to TheSkyX (e.g. Paramount mount).
    • Added command (TRC Ping) to check Tweet Remote Control's status and report back if it is running and awaiting tweet commands.
    • Updated command (TRC TeamViewer) to wait five seconds between closing TeamViewer and restarting it, to ensure stability.
    • Updated all ASCOM mount and roof commands (TRC Park Mount, TRC Check Mount, TRC Close Roof, TRC Open Roof and TRC Check Roof) to include five-minute timeouts to avoid getting stuck waiting for status changes.
    • Updated commands (TRC Restart, TRC Shutdown and TRC TeamViewer) to include extra error catching and reporting.
    • Fixed a bug with the two-minute Twitter re-authentication timer leading to multiple instances.
    • Modularised and optimised code.
  • 1.4:
    • Added support for general ASCOM power relay switches (clicking the ASCOM button now prompts to connect one). 
    • Added command (TRC Switch Open) to open relays on the connected ASCOM power relay switch. 
    • Added command (TRC Switch Close) to close relays on the connected ASCOM power relay switch. 
    • Added command (TRC Switch Check) to check current status of relays on the connected ASCOM power relay switch. 
    • Added command (TRC Dragonfly Check) to check current status of Dragonfly power relays. 
    • Updated command (TRC Open Roof) to also allow for an alternative version (TRC Open Roof Stay), which will keep the ASCOM roof connected after opening (prevents automatic closing on disconnection, as some ASCOM roofs do). 
  • 1.3:
    • Embedded Lunatico Astronomia's Seletek Dragonfly reference. 
    • Added command (TRC Dragonfly Open) to open Dragonfly power relays. 
    • Added command (TRC Dragonfly Close) to close Dragonfly power relays. 
    • Added command (TRC Open Roof) to open the connected ASCOM roof. 
    • Added command (TRC Check Roof) to report back the connected ASCOM roof's current status. 
    • Added command (TRC Check Mount) to report back the connected ASCOM mount's current status. 
    • Updated ASCOM commands to prevent errors if devices cannot connect due to no physical connection or power. 
    • Refined Twitter updates further to be even more informative. 
  • 1.2:
    • Changed supported commands to need to include TRC in front (e.g. TRC Restart), as a precaution. 
    • ​Embedded ASCOM reference. 
    • Added command (TRC Close Roof) to close the connected ASCOM roof. 
    • Added command (TRC Park Mount) to park the connected ASCOM mount. 
    • Refined Twitter updates to be more informative. 
  • 1.1:
    • ​Added Twitter re-authentication timer that will re-authenticate with Twitter every two minutes to ensure always-on. 
    • Added command (TeamViewer) that restarts TeamViewer alone. 
  • 1.0:
    • ​Initial release. 
    • Support for two basic commands (Restart and Shutdown) to restart and shut down the computer. 
3. INSTALLATION
Once you have downloaded the latest version of Tweet Remote Control, simply double-click the file downloaded to start the installation process. What follows is the standard procedure to install any program in Windows. 
Picture
Picture
​​If you have installed a previous version of Tweet Remote Control in the past, you should first ensure it is uninstalled. This can be done normally through the Windows​ Control Panel. 
Picture
​​Once Tweet Remote Control is installed, run it. You will be greeted with its only window. If you have not connected a Twitter account to it before, it will simply state (Not Connected) in red. 
Picture
​To connect a Twitter account, simply click the Connect button. This will immediately open your default web browser and open up a Twitter App Authorization page. You may have to sign in to your Twitter​ account at this stage. This page provides security details about Tweet Remote Control, provided by Twitter, and allows you to authorise Tweet Remote Control to access and use your Twitter​ account. Simply click the Authorize app button and it will provide a seven-digit PIN. 
Picture
Picture
​The PIN should be entered or copy-pasted into Tweet Remote Control's prompt. Once done, click the OK button. Tweet Remote Control will then be authorised to access and use your Twitter account. Once authenticated, it will display your Twitter account name in green to indicate it is connected and working. 
Picture
Picture
​From now on, Tweet Remote Control has the credentials and authorisation to access and use your Twitter account. As such, it will start automatically with Windows​ and authenticate immediately. It will also start minimised in your Windows system tray. If you click the Hide button, it will minimise to the Windows system tray (just as it does when it starts with Windows). 
Picture
​You may double-click this icon or right-click it and click Open to display the Tweet Remote Control window. 

If at any point you would like to unauthorise Tweet Remote Control from accessing and using your Twitter account and would like to reset the program to defaults (including to not start automatically with Windows), click the Reset button. After you confirm you wish to reset Tweet Remote Control, it will return back to what it was when you first installed it. 

Please note that if you uninstall Tweet Remote Control and install a new version afterwards, if you did not reset the program prior to uninstalling the previous version, it will automatically authenticate with your Twitter account. This is because your credentials are stored in your Windows​ registry and thus do not get deleted when the program is uninstalled. 
​
4. USING TWEET REMOTE CONTROL
​​Tweet Remote Control can perform a few ASCOM functions. For this however, you first need to make sure that the ASCOM platform is installed on your remote computer (in all likelihood, it should already be). When you click the ASCOM button, Tweet Remote Control will ask if you want to select an ASCOM roof. If you click Yes, it will open the familiar ASCOM Chooser window. 
Picture
​Simply select your ASCOM roof as normal, ensure the Properties for the device are properly configured (they should be by default, if you have been using the device thus far, though the ASCOM Chooser ​may force you to check anyway) and click OK. 

Next, Tweet Remote Control will ask you if you want to select an ASCOM mount. Again, if you click Yes, it will open the familiar ASCOM Chooser​ window. 
Picture
Finally, Tweet Remote Control will ask you if you want to select an ASCOM power relay switch. Clicking Yes will open the familiar ASCOM Chooser​ window to do this. 

​Once ASCOM devices are selected, your selections are saved to your Windows registry. This means that when Tweet Remote Control next starts, it will not require you to reconfigure this and will be able to control your ASCOM roof, mount and power relay switch (as appropriate) on command. If you click the ASCOM button again, given that you already have selections made, the program will show you your current selection and ask if you want to make a change. It will do this for the roof, then for the mount and finally for the power relay switch. You may choose to make changes if you wish, or leave the current selections as they are. 

With your Twitter account connected and your ASCOM roof, mount and power relays switch selected (as appropriate), Tweet Remote Control is fully configured for use. Simply click the Hide button to minimise it to the Windows system tray and it will sit there running in the background. To make use of Tweet Remote Control, log in to your Twitter account from anywhere on any device (your remote computer, your home computer, your mobile phone, your tablet, etc) via the website or the mobile App and create a tweet with your account. The tweet must be one of the commands accepted by Tweet Remote Control​. The current ones are listed below. 
Tweet Command
   Effect
TRC Restart
   Restarts the computer (Windows imposes a one-minute delay).
TRC Shutdown
   Shuts down the computer (Windows imposes a one-minute delay).
​TRC TeamViewer
   Closes and restarts TeamViewer on the computer.
TRC Close Roof
   Issues a close shutter ASCOM command to close the ASCOM roof selected.
TRC Open Roof
or
TRC Open Roof Stay
   Issues an open shutter ASCOM command to open the ASCOM roof selected.                    The alternative version TRC Open Roof Stay will keep the ASCOM roof connected            after opening (prevents automatic closing on disconnection).
TRC Check Roof
   Checks and reports back the current status of the ASCOM roof selected.
​TRC Park Mount​​
​   Issues a park ASCOM command to park the ASCOM mount selected.
​TRC Check Mount
   Checks and reports back the current status of the ASCOM mount selected.
TRC Dragonfly Open #
   Connects to the Dragonfly power relay and opens (turns off) the relays indicated by        the user with # (e.g. TRC Dragonfly Open 123, or TRC Dragonfly Open 1, 2, 3 or              TRC Dragonfly Open 1 2 3, causes relays 1, 2 and 3 to be opened). # can contain            any characters but all characters that are not numbers 1 to 8 (inclusive) are ignored. 
TRC Dragonfly Close #
   Connects to the Dragonfly power relay and closes (turns on) the relays indicated by        the user with # (e.g. TRC Dragonfly Close 123, or TRC Dragonfly Close 1, 2, 3 or              TRC Dragonfly Close 1 2 3, causes relays 1, 2 and 3 to be closed). # can contain              any characters but all characters that are not numbers 1 to 8 (inclusive) are ignored. 
TRC Dragonfly Check #
   Connects to the Dragonfly power relay and checks and reports back the current              status of the relays indicated by the user with # (e.g. TRC Dragonfly Check 123, or          TRC Dragonfly Check 1, 2, 3 or TRC Dragonfly Check 1 2 3, checks relays 1, 2 and 3).    # can contain any characters but all characters that are not numbers 1 to 8 (inclusive)    are ignored. 
TRC Switch Open #
​   Connects to the ASCOM power relay switch selected and opens (turns off) the relays      indicated by the user with # (e.g. TRC Switch Open 123, or TRC Switch Open 1, 2, 3       or TRC Switch Open 1 2 3, causes relays 1, 2 and 3 to be opened). # can contain any      characters but all characters that are not numbers 0 to 9 (inclusive) are ignored. 
TRC Switch Close ​#
​   Connects to the ASCOM power relay switch selected and closes (turns on) the relays      indicated by the user with # (e.g. TRC Switch Close 123, or TRC Switch Close 1, 2, 3       or TRC Switch Close 1 2 3, causes relays 1, 2 and 3 to be closed). # can contain any        characters but all characters that are not numbers 0 to 9 (inclusive) are ignored. 
TRC Switch Check ​#
   Connects to the ASCOM power relay switch selected and checks and reports back the    current status of the relays indicated by the user with # (e.g. TRC Switch Check 123,      or TRC Switch Check 1, 2, 3 or TRC Switch Check 1 2 3, checks relays 1, 2 and 3). #        can contain any characters but all characters that are not numbers 0 to 9 (inclusive)        are ignored. 
TRC TheSkyX Park
   Issues a local (127.0.0.1) TCP command on port 3040 to instruct TheSkyX to park your    connected mount (e.g. Paramount mount).
TRC TheSkyX Home
   Issues a local (127.0.0.1) TCP command on port 3040 to instruct TheSkyX to find              home position (if supported) on your connected mount (e.g. Paramount mount).
​TRC TheSkyX Check
   Issues a local (127.0.0.1) TCP command on port 3040 to check and report back the          current status of the mount connected to TheSkyX (e.g. Paramount mount).
​TRC Ping
   Reports back if Tweet Remote Control is running and awaiting your tweet commands.
​Please note that the tweet commands are not case-sensitive. However, the tweet must only contain the command listed above and nothing more, otherwise it will be ignored by Tweet Remote Control. 

The program picks up the tweet command almost immediately. If it is confirmed to be a valid command, it will delete your tweet and tweet on your behalf to update you on the status of what is happening. Tweets made by the program generally have the current remote computer system time and date appended to them. 
Picture
Picture
These tweets can of course be deleted manually by yourself via your Twitter account. They can however effectively act as a log. 

Finally, please note that future versions of Tweet Remote Control may add further tweet commands. Please feel free to contact me to suggest/request some in particular, if you would like to see some particular function added.