So I recompiled the current driver and here are my findings so far when testing from TheSkyX Pro using the mount simulator and the ASCOM dome driver:
- Slewing (GoTo) works fine (end in the same positions as the X2 plugin so that's a good sign).
- Find home works.
- Park/unpark works.
- Open/close shutter works but both reports an error 206 in TSX which is ERR_CMDFAILED, even though the dome does open and close properly.
So I need to see what is causing the shutter error.
solved.
HELP please. I'm using a couple scripts to close the dome down and I need to tell Ascom DEVICE HUB to unslave. (anyone know the syntax/command?
So in Driver.cs, all checks are done in this method :
private void OnStatusUpdateTimer(object source, EventArgs e) { SendSerial(POSITION_ROTATOR_CMD); SendSerial(HOMED_ROTATOR_STATUS); SendSerial(SEEKSTATE_GET); SendSerial(SLEW_ROTATOR_STATUS); if (canSetShutter == true) { Thread.Sleep(INTER_COMMAND_PAUSE_MS); SendSerial(POSITION_SHUTTER_GET); Thread.Sleep(INTER_COMMAND_PAUSE_MS); SendSerial(STATE_SHUTTER_GET); } if (slowUpdateCounter >= 30) { tl.LogMessage("Slow update", "Get"); SendSerial(RAIN_ROTATOR_GET); SendSerial(VOLTS_ROTATOR_CMD); slowUpdateCounter = 0; if (canSetShutter) { Thread.Sleep(INTER_COMMAND_PAUSE_MS); SendSerial(VOLTS_SHUTTER_CMD); } } slowUpdateCounter++; }
The bold line is the line that sends the command to the rotator sensor to check for the sensor status.
If you don't want it to check you need to disable this line.
You might want to get the version of the ASCOM code and the firmwares from the new repo as a few things have changed (hopefully for the better) : https://github.com/nexdome/Automation
This is now the official place for the firmware and ASCOM driver. I'm not updating any of the old PDM code.
also when we see shutter get setup info Is that pulling out the motor settings we've entered previous? Speed, accel and steps?
Also when I run the terminal to Arduino... and connect to the com port. I use to sit and wait for a command. What it does now is continually reports back Shutter rain status F0#... OVER AND OVER non stop? I Can't even send a command. Any idea what could cause this? If I clear output it continues. I get no CR or LF though I select I want one. Just one line of shutter rain status F0#shutter rain status F0#.... over and over non stop?
when it does a NAME GET PDMnexdome, or a VERSION GET where is it "GETTING" from? from the firmware code?
Question - in my logs there is a aweful lot ot time spent polling the rain sensor. I don't have the hardware for it so I'd rather it never check. Might there be a way we could rem out the rainsensor in our firmware? 90% of my logs are rain status F0.
I fixed a few things and apparently now the shutter open/close also works in TheSkyx Pro using the ASCOM driver.
I still see some crashes when clicking on "Cancel" in the ASCOM dome chooser in TSX. Not sure why yet.
I'm also not sure why TSX can't display the proper settings dialog once connected whereas POTH can.
We still need the help of a proper ASCOM coder and C# coder (I kind of can do some as it's very close to C++ but I'm sure a real C# coder would find and fix the issues in no time).
New code is here : https://github.com/nexdome/Automation
Rodolphe
I did a big cleanup in the new official repo.
I renamed all the PDM Dome to NexDome, fix the Inno Setup installer file so that install, upgrade and uninstall now works.
So now the ASCOM driver is called 'NexDome Driver' in the ASCOM chooser instead of 'PDM NexDome Driver'.
Pat did a great job of getting us there and as the code is moving to the official NexDome Github, renaming was needed. Pat still has his name in the code and the commit logs.
Now that I can do a clean compile and install we have a better chance of figuring out how to fix the shutter state reporting issue.
So I spent the last 2 hours trying to figure out the shutter issue. As far as I can tell the ASCOM driver is not updating the shutter status for the app in a timely manner. I tested with TheSkyX Pro and see this :
000000 12/30/2018 18:16:01.407 Link Established with ASCOM Dome 000001 12/30/2018 18:16:02.924 Alt=00:00:00, Az=000:00:00 000002 12/30/2018 18:16:07.527 Alt=00:00:00, Az=000:00:00 (Polled 4 times since last logged) 000003 12/30/2018 18:16:12.454 Alt=00:00:00, Az=000:00:00 (Polled 4 times since last logged) 000004 12/30/2018 18:16:13.473 OpenShutter() Command Issued 000005 12/30/2018 18:16:13.477 ShutterStatus is now shutterClosed/1 000006 12/30/2018 18:16:13.478 ...value is not yet valid following OpenShutter(). Waiting 500ms... (attempt 1 of 10) 000007 12/30/2018 18:16:14.054 ShutterStatus is now shutterClosed/1 000008 12/30/2018 18:16:14.071 ...value is not yet valid following OpenShutter(). Waiting 500ms... (attempt 2 of 10) 000009 12/30/2018 18:16:14.469 ShutterStatus is now shutterClosed/1 000010 12/30/2018 18:16:14.484 ...value is not yet valid following OpenShutter(). Waiting 500ms... (attempt 3 of 10) 000011 12/30/2018 18:16:15.087 ShutterStatus is now shutterClosed/1 000012 12/30/2018 18:16:15.108 ...value is not yet valid following OpenShutter(). Waiting 500ms... (attempt 4 of 10) 000013 12/30/2018 18:16:15.469 ShutterStatus is now shutterClosed/1 000014 12/30/2018 18:16:15.482 ...value is not yet valid following OpenShutter(). Waiting 500ms... (attempt 5 of 10) 000015 12/30/2018 18:16:15.970 ShutterStatus is now shutterClosed/1 000016 12/30/2018 18:16:15.982 ...value is not yet valid following OpenShutter(). Waiting 500ms... (attempt 6 of 10) 000017 12/30/2018 18:16:16.470 ShutterStatus is now shutterClosed/1 000018 12/30/2018 18:16:16.485 ...value is not yet valid following OpenShutter(). Waiting 500ms... (attempt 7 of 10) 000019 12/30/2018 18:16:16.970 ShutterStatus is now shutterClosed/1 000020 12/30/2018 18:16:16.983 ...value is not yet valid following OpenShutter(). Waiting 500ms... (attempt 8 of 10) 000021 12/30/2018 18:16:17.490 ShutterStatus is now shutterClosed/1 000022 12/30/2018 18:16:17.509 ...value is not yet valid following OpenShutter(). Waiting 500ms... (attempt 9 of 10) 000023 12/30/2018 18:16:17.970 ShutterStatus is now shutterClosed/1 000024 12/30/2018 18:16:17.984 ...value is not yet valid following OpenShutter(). Waiting 500ms... (attempt 10 of 10) 000025 12/30/2018 18:16:19.553 Alt=00:00:00, Az=000:00:00 (Polled 1 times since last logged) 000026 12/30/2018 18:16:24.493 Alt=00:00:00, Az=000:00:00 (Polled 4 times since last logged) 000027 12/30/2018 18:16:29.520 Alt=00:00:00, Az=000:00:00 (Polled 4 times since last logged) 000028 12/30/2018 18:16:34.540 Alt=00:00:00, Az=000:00:00 (Polled 4 times since last logged)
When testing with POTH, I can open/close but the actual status doesn't update for a good 30 seconds.. Not sure why and where to fix this.
We really need someone that understand ASCOM to help fixing this.
so now more K1208,1000M2 in the log, one more bug gone :)
Now we need to figure out why the ASCOM code is not getting the shutter state.
It looks like a timer thing and some value not set somewhere.
We do get the shutter status :
serialMessageList part M1
M1 = CLOSED
I'm going to stop there for today,
I've committed all my code so feel free to look into the ASCOM code. Most of what we care about is in Driver.cs
Ok found a bug in the shutter firmware where a '#' was missing at the end of the voltage response. fixing.
So now with more debug, we get the M2 status on its own :
16:38:13.931 Slow update Get
16:38:13.932 serialMessageList part m0
16:38:13.934 serialMessageList part P12417
16:38:13.937 serialMessageList part M2
16:38:13.939 serialMessageList part F0
16:38:13.941 serialMessageList part k1195,1000
16:38:13.943 serialMessageList part K1208,1000M2
This shows that it's present on its own but also mangled with the voltages for the shutter.
I need to check the shutter firmware code.
more breaking... now open/close is no longer doing anything in ASCOM (still works with X2 so I know the shutter is seen by the rotator arduino).
Oh.. I looked at the profile and the "canSetShutter" is back to false ! .. I HATE ASCOM !!!!
Now the interesting thing is that in this state I get the 206 error in TSX very quickly.
I then reset the canSetShutter to true and I can open/close in TSX but still get that error.
yes : 1208 = 12.08V, 1209 = 12.09V, M2 = opening, M3 = closing
I try adding some more check in the firmware to try to read response from the shutter as command are sent but I still see the above messages..
16:05:51.839 Shutter Voltage Invalid (1202,1000M2)
16:06:21.917 Shutter Voltage Invalid (1202,1000M3)
So it really looks like it's something in the ASCOM driver that mangles the responses as I don't see this error in TSX with the X2 driver.
I've made some cleanup in the repo so I'm going to commit this for now (I removed the extra stuff and moved some things around so it's less confusing as to what directory contains what).
Rodolphe
So, I found some clues :
15:25:59.615 Shutter Voltage Invalid (1208,1000M2)
15:26:59.663 Shutter Voltage Invalid (1209,1000M3)
so the driver ask for the voltage but also get the shutter status in the same buffer apparently.
So that's another synchronous vs asynchronous issue.
So probably more fixes in the firmware for all shutter commands to read the response on each command sent.