Sitech II and ethernet


dan adi
 

Hello,
I was womdering if the Sitech II controller can be controled/connected trough a tcp/ip protocol? Like conecting the controller to a Lan network?

Thanks


Dan Gray
 

SiTechExe has a server built in.
Here's the protocol:

Starting with version 0.92e of SiTechExe, there is a TCP/IP interface to SiTechExe.

To get started, we have a C# project you can try:
http://siderealtechnology.com/TestSiTechTCP02.zip

First you set up the port number in the SiTechExe/Config/ChangeConfig/Misc.  
It's labeled "Indi Port Number"
Note, if something like INDI is connected when you change this, there will likely be an exception in the external app.
Best to disconnect all TCP processes before changing this SiTechExe config item.

You need to be running SiTechExe before connecting with your software.
Basically, you send an ASCII string as a command, SiTechExe possibly does something, and returns a string.
Nothing blocks in SiTechExe, the string is returned right away, even if the command will take a while to complete.
 
Unless otherwise stated, every command returns the standard return string. The command "ReadScopeStatus" returns "_" as the message.
Other commands return a message after the "_";

Parameters are separated by a ';' semi-colon.
As of version 0.92e, here is the standard return string description.
The type (int, double, or string) is a literal string, your software must convert these strings to an int or double if necessary.
int boolParms (Slewing, Tracking, Initialized, etc.)
double RightAsc (Hours, JNow)
double Declination (Degs, JNow)  
double ScopeAlititude (Degs)
double ScopeAzimuth (Degs)  
double Secondary Axis Angle (Degs) (if a RotatorComms command, this will be the ParallacticAngle) (if this is a ReadScopeDestination command, it is the destination RA)
double Primary Axis Angle (Degs) (if a RotatorComms command, this will be the ParallacticRate) (if this is a ReadScopeDestination command, it is the destination Dec)
double ScopeSidereal Time (Hours) (if a RotatorComms command, this will be the CameraSolvedAngle) (if this is a ReadScopeDestination command, it is the destination ScopeAltitude)
double Scope Julian Day  (if a RotatorComms command, this will be the Commanded Rotator GoTo position) (if this is a ReadScopeDestination command, it is the destination ScopeAzimuth)
double Scope Time( Hours)
double AirMass
String "_" followed by message.

The boolParms have bits in it that mean certain things as follows:
Bit 00 (AND with    1) Scope Is Initialized
Bit 01 (AND with    2) Scope Is Tracking (remains true when slewing)
Bit 02 (AND with    4) Scope is Slewing
Bit 03 (AND with    8) Scope is Parking
Bit 04 (AND with   16) Scope is Parked
Bit 05 (AND with   32) Scope is "Looking East" (GEM mount);
Bit 06 (AND with   64) ServoController is in "Blinky" (Manual) mode, one or both axis's
Bit 07 (AND with  128) There is a communication fault between SiTechExe and the ServoController
Bit 08 (AND with  256) Limit Swith is activated (Primary Plus) (ServoII and Brushless)
Bit 09 (AND with  512) Limit Swith is activated (Primary Minus) (ServoII and Brushless)
Bit 10 (AND with 1024) Limit Swith is activated (Secondary Plus) (ServoII and Brushless)
Bit 11 (AND with 2048) Limit Swith is activated (Secondary Minus) (ServoII and Brushless)
Bit 12 (AND with 4096) Homing Switch Primary Axis is activated
Bit 13 (AND with 8192) Homing Switch Secondary Axis is activated
Bit 14 (AND with 16384) GoTo Commanded Rotator Position (if this is a rotator response)
Bit 15 (AND with 32768) Tracking at Offset Rate of some kind (non-sidereal)
Bit 16 (AND with 65536) We are tracking a satellite now

COMMANDS:
"ReadScopeStatus\n"
Returns the above string, no other action taken

"ReadScopeDestination\n"
Returns the above string, but the axis angles secondary, primary, sidereal time,
julian day are RA, Dec, Alt, Az, are the final destination
of the telescope. No other action taken. This is for the dome control program.
Secondary Axis Angle (Degs) (if a ReadScopeDestination command, this will be the RA)
Primary Axis Angle (Degs) (if a ReadScopeDestination command, this will be the Dec)
ScopeSidereal Time (Hours) (if a ReadScopeDestination command, this will be the Altitude)
Scope Julian Day  (if a ReadScopeDestination command, this will be the Azimuth)


"RotatorComms IsMoving RotatorAngle\n"
IsMoving is 0 or 1.  RotatorAngle is the current rotator angle in degs.
Following is the difference from the standard response.
Returns the above string in RotatorComms mode, The string on the end is "RotatorComms"
Secondary Axis Angle (Degs) (if a RotatorComms command, this will be the ParallacticAngle)
Primary Axis Angle (Degs) (if a RotatorComms command, this will be the ParallacticRate)
ScopeSidereal Time (Hours) (if a RotatorComms command, this will be the CameraSolvedAngle)
Scope Julian Day  (if a RotatorComms command, this will be the Commanded Rotator GoTo position)


"SiteLocations\n"
returns a string separated by ';'
siteLatitude (deg's);
siteLongitude (deg's);
siteElevation (meters);
_SiteLocations

"ScopeInfo\n"
returns a string separated by ';'
ApertureDiameter;
ApertureArea;
FocalLength;
NameOfScope;
_ScopeInfo

siteLongitude (deg's);
siteElevation (meters);
_SiteLocations

"GoToAltAz Az Alt\n"
Az and Alt are a double number, converted to a string.  Example:
"GoToAltAz 180.0 80.0\n"
This will move the scope azimuth to the south, and the altitude to 80 deg's.  0 azimuth is north, and 90 azimuth is east.
If scope is parked, if in blinky mode, if alt/az is out of parameters, or if below horizon limit, an error will be returned after the "_".

"GoTo RA Dec <J2K>\n"
RA and Dec is a double number, converted to a string. Example:
"GoTo 12.0 45.0\n"
This will move the scope to 12 hours of right ascension and +45 deg's in declination, JNow.

Example:
"GoTo 12.0 45.0 J2K\n"
This will move the scope to 12 hours of right ascension and +45 deg's in declination, J2000.
If the coordinates are in J2000, then put an optional " J2K" before the \n.  SiTech will then perform precession, Nutation, and Aberration corrections.
If scope is parked, if in blinky mode, if RA/Dec is out of parameters, or if below horizon limit, an error will be returned after the "_".

"CookCoordinates 12.0 45.0"
The RA and Dec should be in J2000 epoch.
This will return the standard return string, and after the "_" will return the JNow coordinates, with Precession, Nutation, and Aberration applied.

"UnCookCoordinates 12.0 45.0"
The RA and Dec should be in JNow coordinates, with Precession, Nutation, and Aberration applied.
This will return the standard return string, and after the "_" will return the J2000 coordinates.

"SyncToAltAz Az Alt\n"
Az and Alt are a double number, converted to a string.  Example:
"SyncToAltAz 180.0 80.0\n"
This will tell sitechExe that the scope is pointed in azimuth to the south, and the altitude to 80 deg's.  0 azimuth is north, and 90 azimuth is east.
If scope is parked, if in blinky mode, if alt/az is out of parameters, or if below horizon limit, an error will be returned after the "_".
If successful, SiTechExe will believe that the scope is pointed to 180 az and 80 elevation.

"Sync 12.0 45.0 <n> <J2K>\n"
RA and Dec is a double number, converted to a string.
The <n> is optional, and is the type of sync.
0 = use SiTechExe standard Init Window.
1 = perform an instant Offset init (no init window comes up)
2 = perform an instant "load calibration" init (no init window comes up).
Example:
"Sync 12.0 45.0\n"
If successfu, this will tell sitechExe that the scope is pointed in RA to 12 hours, and the declination to plus 45 deg's, JNow.
SiTechExe will also use the default SiTechExe Init window.

"Sync 12.0 45.0 J2K\n"
This will tell sitechExe that the scope is pointed in RA to 12 hours, and the declination to plus 45 deg's, J2000.
SiTechExe will also use the default SiTechExe Init window.

"Sync 12.0 45.0 2 J2K\n"
This will tell sitechExe that the scope is pointed in RA to 12 hours, and the declination to plus 45 deg's, J2000.
SiTechExe will perform an add calibration point.

If scope is parked, if in blinky mode, if alt/az is out of parameters, or if below horizon limit, an error will be returned after the "_".

"Park\n"
If all is well (no blinky, and a park position has been specified), the mount will move to the park position, and then will officially be in the "parked" status.

"GoToPark 1\n"
If all is well (no blinky, and a park position has been specified for the park number (by right clicking on SetPark), the mount will move to the park position,
but will not be in the "parked" status.
You can specify park location: 1, 2, or 3.

"UnPark\n"
If the mount is officially parked, this will "unpark" the mount.  It will then be ready for goto's.

"Abort\n"
This will abort any slews, and stop the scope from tracking as well.

"SetTrackMode 1 1 0.0 0.0\n"
This will start tracking at the sidereal rate, or any other rate, or stop tracking altogether.
There are 4 parameters.
1. bool 1 equals track.  Any other value will  stop tracking.
2. 1 = use the following rates.  0 means track at the sidereal rate.
3. Right Ascension Rate (arc seconds per second).  A 0.0 will  track at the sidereal rate.
4. Declination rate (arc seconds per second) A 0.0 will track the declination according to the telescope model and refraction.
Example:
"SetTrackMode 1 0 0.0 0.0\n" will start the mount tracking at the sidereal rate.
"SetTrackMode 0 0 0.0 0.0\n" will stop the mount from tracking.


"PulseGuide Direction, Milliseconds\n"
This will nudge the mount in the direction specified, for the number of Milliseconds specified, at the Guide Rate stored in the servo controller configuration.
Direction:
 0=North, 1=South, 2=East, 3 = West
So the way that SiTechExe performs this, is it does some math on the current guide rate (stored in the controller configuration)
and figures how far the mount will move if guided at that rate for the time specified.
It then changes the RA and Dec setpoint by that amount.  

Example:
"PulseGuide 0 1000\n"
This will nudge the mount north by 5 arc seconds if the guide rate is set for 5 arc seconds per second.

"MotorsToBlinky\n"
This will force the motors to blinky mode (Manual Mode), in effect removing all power from the motors.  They will coast to a stop.

"MotorsToAuto\n"
This will put the motors back into Auto Mode.

"CookCoordinates 12 45"
This command will return the JNow coordinates after the "_" in the return string.  
They will be adjusted for Precession, Nutation, and Aberration.

"UnCookCoordinates 12 45"
This command will return the J2000 coordinates after the "_" in the return string.  
They will be adjusted for Precession, Nutation, and Aberration, from JNow to J2000.

"JogArcSeconds N 5.0"
Self explanatory, N, S, E, or W,

"OffsetDestinationBy 0.0 0.0"
Used for Satellite tracking to center a satellite.
Create a destination offset of hours right ascension and Degrees Destination.

"GetSatelliteInfo"
Returns the standard return string plus the following:
    Common name of object
    tle line 1
    tle line 2
    NORAD ID
    Sat ra
Sat dec
    Sat az
Sat al
    Sat EarthDistance

"MoveAxisPri dps"
Moves the Primary axis at the speed of dps.  
If dps is negative, it moves the axis the other way.
If dps is 0, it stops the move.
If there is not another MoveAxisPri command in a short time, this software will stop the move.
It returns something I think.

"MoveAxisSec dps"
same as MoveAxisPri, but the secondary axis

"SearchDatabaseGoto SearchString"
Skyview will search for the string, and perform a goto if it finds it.
It will goto the first object that passes the test that's above the horizon limit
I believe it returns data about the object

"SearchDatabase SearchString"
Same as above, but it doesn't perform the goto, but returns coordinates

"CloseMe"
Makes the server close the socket.  There is no response.

"PotsAndParkData"
Returns standard return string plus an ascii int.
if bit 0 is set, primary axis is at park;
if bit 1 is set, secondary axis is at park;
if bit 2 is set, primary axis pot agrees with the axis angle;
if bit 3 is set, secondary axis pot agrees with the axis angle;

"CloseSiTech"
This shuts down SiTechExe

The following are custom commands for the ATLAS project
"DoAPhotoInit"

"AtlasGetAllData"

"AtlasGetRedisData"

"AtlasGetFlipwillBe rtAsc"



On Tue, Nov 16, 2021 at 5:13 AM dan adi via groups.io <cioc.adriandan=yahoo.com@groups.io> wrote:
Hello,
I was womdering if the Sitech II controller can be controled/connected trough a tcp/ip protocol? Like conecting the controller to a Lan network?

Thanks


dan adi
 

Thank you Dan, but maybe I didn't express myself correctly. What I was wondering is if I can connect my controller-mount to a Local Area Network, and access my mount from a computer using an ip address. On the controller I though there was a RJ45 port, but it is actually a RS232 port. My mistake


jmgoldba
 

On Tue, Nov 16, 2021 at 09:17 AM, dan adi wrote:
but it is actually a RS232 port.
Back in my day we used terminal servers to connect to RS232 devices over a LAN. I suppose it might still be doable where you map the terminal sever port to a COM port that SiTech would recognize. -Jesse


dan adi
 
Edited

You mean something like this? https://www.netburner.com/virtual-com-port/

And this:
https://www.netburner.com/products/serial-to-ethernet/sb700-ex-serial-to-ethernet-server/


jmgoldba
 

Yes, if I understand you correctly. They're something of an Ethernet version of the ubiquitous USB to serial interfaces that are visible as COM ports on the operating system side. COM ports I believe you should be able configure SiTech to talk to. -Jesse


dan adi
 
Edited

I have been doing a little research today, and based on your idea the setup could look like this:
Sitech controller RS232---->SerialToEthernetServer---->LAN------>PC (the SerialToEthernetServer will have an application that will assign/map a comm port to the ip address of the serial server, then Sitech.exe can be made to listen to that comm port, as Dan Gray said earlier)

Looks like a fun project to try! The only small issue is that sitech controller doesn't use the standard db9 serial connector, but looks like rj12, so I guess I must make my own cable. Or maybe I could use the usb data port on the sitech controller and get a usb to serial cable .. those are easier to find online?!
Maybe Dan G. will see our discussion and correct me if I'm wrong. Would be cool to dich a USB cable and control my mount through ethernet.
Thanks jmgoldba


Don W
 

Hi Dan,
SiTech sells the comm cable from DB9 to RJ12 if you don't want to make your own cable.
Don W


dan adi
 

Hi Don, thanks for the info
Is it RJ12 or RJ11? I've found RJ11 to DB9 cables online, they are indeed cheap, but the RJ12 to DB9 is pretty hard to find. My guess is the port is RJ11
I've looked at sitech site but didn't find those cables ... 
Anyway, do you think the idea described above works? 


Don W
 

Hi Dan,

I probably mis-remembered the number as RJ12.  I think the RJ-11 is a 4 conductor which is what you need.

Don W


alansliski
 


dan adi
 

Thanks Alan, I have a Moxa Serial to Ethernet Server, wich is similar, I guess. If you used this configuration, what option did you use on the Serial Server regarding connection? Mine has these options: real com, tcp server, tcp client, udp . My guess is real com, but maybe I’m wrong. 


dan adi
 

Yesterday I received a RJ11 serial cable, but the RJ11 plug doesn't fit in the sitech ii rs232 port on the controller. The serial port on the controller is narrower, so my guess it is a RJ9 ... 
I also have a usb->serial cable that fits, and tomorrow I will have time to try connecting directly from the sitech ii USB port to the SerialServer RS232 port. Since I've read (in the manual) that the USB type B port on the controller is actually a serial to usb converter, I don't see any reason why a USB type B to Serial cable won't work, thus eliminating the need to use the adjacent rs232 port.
Do you know what the baud rate should I set? In the manual I see both 9600 and 19200 coming up.
Also, from where do I change the values?
Thanks


Don W
 

Hi Dan,

The Servo II controller can use either a serial cable OR a USB cable, but there is a jumper inside the controller case to tell it which to use.  I believe the controllre is sent to you with the jumper set for USB.  There is a USB to serial adapter built-in to the controller, so using the USB cable, SiTech will tell the PC what com port to use (you will see that in the PC device manager/com Ports).

Using a serial cable, you need the 4 connector type RJ connector.

Don W


dan adi
 

Yes, there is a jumper on the board. For usb connection the jumper is not installed, it just rests on a pin. To use the serial connection, you have to install the jumper and reboot the controller. 
Tomorrow I will connect everything up to the serial server, and test it out. 
What I don't know is what baud rate to use, but I will test both 9600 and 19200 on the serial server, and see what happens


Don W
 

Hi Dan

Set the PC for 9600 baud.  SiTech will probably run at 19200 baud automatically.  In any event you don't have to specify it.

Don W


dan adi
 

A small update, I made a serial cable with a RJ9 4C4P plug and it works. I installed the jumper on the controller board, and the serial connection works OK too. I was able to connect to my mount through a local area network! 
A RJ10 plug will work as well, as per Taj intructions.
Also thanks Taj for pointing me to the serial wiring diagram in the manual, I've totally missed it.
So for everyone who wants to connect to a  Sitech controller through a local network, it can be done easily with a simple Serial Server and a little DIY work to make a RJ10/9 to DB9 cable.