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.
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.
So 1208 and 1209. Are voltage? The 1000 is minimum volts you’ve set? What is m2 and M3?
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
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.
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.
Ok found a bug in the shutter firmware where a '#' was missing at the end of the voltage response. fixing.
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
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 :
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.
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.
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
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.
The code always check and as there is no rain sensor I made the shield to report that it's not raining so that we don't have to make special firmware.
Of course you can always comment the rain check code from the firmware but I believe the log you're seeing is in the ASCOM driver which is really where it should be disabled.
when it does a NAME GET PDMnexdome, or a VERSION GET where is it "GETTING" from? from the firmware code?
Are we talking about ASCOM here ?
Version get is basicaly asking to the Arduino what code version it's running using the v# command (and also the V# for the shutter version).
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?
You're connecting to the shutter or the rotator ?
My last 2.1 code has all debug disabled ( here : https://github.com/nexdome/Automation ).
the F0 should only be sent every 30 seconds or so.
If I connect to the rotator Arduino it does nothing until I enter a command.
If I connect to the shutter Arduino and debug are enable I see the rain check every 30 seconds or so and if debug are disable I see nothing (it will respond to some commands).
So you shouldn't see anything from the rotator unless you enter a command, and certainly not a deluge of F0#
also when we see shutter get setup info Is that pulling out the motor settings we've entered previous? Speed, accel and steps?
internal void GetSetupInfo() line 899
it sends a set of command to get all the data and if canSetShutter is true it also get the shutter data.
So the answer is yes.
So in Driver.cs, all checks are done in this method :
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.
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?
solved.