Stellarium / stellarium

Stellarium is a free GPL software which renders realistic skies in real time with OpenGL. It is available for Linux/Unix, Windows and macOS. With Stellarium, you really see what you can see with your eyes, binoculars or a small telescope.
https://stellarium.org
GNU General Public License v2.0
7.38k stars 804 forks source link

Telescope Control: ASCOM Driver #406

Closed alex-w closed 4 years ago

alex-w commented 5 years ago

Original report by Mi.Holzner: https://bugs.launchpad.net/stellarium/+bug/1082196

Hi,

I would like to control differen Telescopes with Stellarium, as it is my favourite Sky-Software. Many Drivers are available within the ASCOM project, i am sure, you know ASCOM.

So, is Stellarium TelescopeControl PlugIn would have a option for ASCOM-Driver in the telescope-Driver list - it would be possible to use it with every scope, where an Ascom driver exists.

Maybe advanced users have already written their own ascom-driver for use with different software - they would can use this driver then also with stellarium.

I saw this in the astrosurf c2a software - and it works great - but i would prefer to use Stellarium.. :-)

thanks, Michael

gzotti commented 5 years ago

271 indicates demand for ASCOM control. We can close this.

rederikus commented 5 years ago

I realize that you closed this thread but StellariumScope has not been updated for years. ASCOM is the de-facto worldwide telescope control standard. Yes, it only runs on Windows. So what? I use Cartes du Ciel on Windows and Linux, CdC uses Ascom where it is is available. I use Starry Night on Windows and that uses ASCOM on WIndows but not on other platforms. Finally I use Sky Tools 3 and Virtual Moon. Both use ASCOM only under Windows. bOviously where ASCOM is not available, it is not used.

Why oh why cannot Stellarium do the same? Where a tool is available, USE IT.

I and I suspect many others would like the consistency of ASCOM across software platforms. When using Stellarium I am denied focuser control, camera features and at least two of my telescopes are just not supported by Stellarium. It NEEDS ASCOM.

Please do not get me wrong. I love Stellarium. However I would love it more if it supported ASCOM on Windows.

Please make this happen.

Thanks

gzotti commented 5 years ago

I had closed this as duplicate of #271. Maybe we can close #271 instead?

The problem is that no developer has an ASCOM controlled telescope, and no ASCOM controlled telescope owner was so far able to develop a patch and send it to us. Stellarium has supported two widespread protocols for many years and has recently been enhanced to use RTS2 and INDI. I understand INDI as superior to ASCOM, and maybe your gear also supports INDI?

rederikus commented 5 years ago

I am sorry I caused you to reopen a closed thread. I was Googling the web to find an Ascom to Stellarium solution and this showed up in my search results.

I have heard of Indi but I can tell you that at the Charlotte Amateur Astronomers Club http://charlotteastronomers.org/ of 200 + members almost everybody who does not have a turnkey scope or a pushto device uses Ascom.

Almost all the major manufacturers support the platform. Regardless of whose system is the best I truly feel it is better to support common standards. Ascom, like Stellarium is free and for different telescopes and other devices many independent developers provide enhancements and drivers.

I shall certainly look at Indi again now you have mentioned it but honestly Ascom seems the way most people have already gone.

I hope you can find a way forward.

As an aside, I have been a user of Stellarium since the mid 2000s and I have just bought Starry Night 8. My decision to buy SN8 was based entirely upon the fact that it supported Ascom.

gionkunz commented 4 years ago

@gzotti I understand it's sometimes difficult if your users use hardware that the developers don't have access to. However, in case of ASCOM this is not a valid excuse :-) ASCOM has the concept of simulators built into its core. Almost all devices (scopes, focuser, dome etc.) have a simulation counterpart. In the case of ASCOM Scope, this includes positions, sync and all other features that a real mount would present. I think, given the high demand of ASCOM support in Stellarium, this would be a huge benefit for your users. Stellarium Scope is a great Workaround, but it's a workaround let's face it. Also, it presents other issues and requires maintenance outside of the Stellarium release cycle.

I'm a developer myself, however, I've written my last C++ code back in the university and I think I'd introduce more anti-patterns and bugs than anything else if I'd try to contribute here. However, if I can help with anything, please tell me.

Best regards Gion

gzotti commented 4 years ago

@gionkunz Having forgotten most of C++ is no excuse either -- this can be freshened up. :-)

Most development is driven by personal needs and interests of developers. The original developers of the telescope plugin unfortunately left the project. Two users have contributed INDI and RTS2, probably because they needed those connections themselves. My little telescope does not need ASCOM, so I have no personal ambition to spend several weekends of my spare time on this, to get a solution that does not more than the existing, and I am very sure users with advanced telescopes would then come with demands of focuser, CCD and filter wheel control (which I could not develop without the experience about how such control program should look like!). You would "just" have to understand the plugin code and extend the code if built on Windows. If there is a library to link, there are other examples to see in the code (e.g. spout). Yes, indeed, I would welcome an ASCOM solution contributed by somebody. Unfortunately that somebody has not volunteered yet.

gionkunz commented 4 years ago

Well, if you help me with testing the code and help me check that I don't cross any boundaries, I'd love to check if I could contribute from myside. Are there any guides how to start development / architecture docs or anything similar?

Cheers Gion

Georg Zotti notifications@github.com schrieb am Di., 6. Aug. 2019, 12:46:

@gionkunz https://github.com/gionkunz Having forgotten most of C++ is no excuse either -- this can be freshened up. :-)

Most development is driven by personal needs and interests of developers. The original developers of the telescope plugin unfortunately left the project. Two users have contributed INDI and RTS2, probably because the needed those connections themselves. My little telescope does not need ASCOM, so I have no personal ambition to spend several weekends of my spare time on this, to get a solution that does not more than the existing, and I am very sure users with advanced telescopes would then come with demands of focuser, CCD and filter wheel control (which I could not develop without the experience about how such control program should look like!). You would "just" have to understand the plugin code and extend the code if built on Windows. If there is a library to link, there are other examples to see in the code (e.g. spout). Yes, indeed, I would welcome an ASCOM solution contributed by somebody. Unfortunately that somebody has not volunteered yet.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Stellarium/stellarium/issues/406?email_source=notifications&email_token=AAQ2AODTCVSUGJD2HRG34XDQDFI6XA5CNFSM4FXHVFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3UXRWI#issuecomment-518617305, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQ2AOD6STAPRTWCJFKB3TDQDFI6XANCNFSM4FXHVFQQ .

gzotti commented 4 years ago

Great! The wiki here includes startup guides (Compilation on Windows), and https://stellarium.org/doc/head/ is the Doxygen documentation. You cannot break the program, as development will be done in your private clone. When you have something to show, you make a "pull request" on github. All you need to edit is inside plugins/TelescopeControl, and maybe some cmake config files. If you come across other issues, please don't try to silently add them with this branch.

I cannot promise permanent and immediate availability for testing, though, it may take a few weeks sometimes. And I am afraid I cannot answer too detailed questions related to the code of that plugin, as it is not my code and I hardly use the plugin myself. I guess @alex-w will have more insight, although he mostly uses Linux, not sure if he would be willing/able to test... In any case all ASCOM-related code must be excluded from build on non-Windows systems.

gionkunz commented 4 years ago

Okay, guys, I've started this journey 😄

image

YahaGr commented 4 years ago

Good luck! Thousands of amateur astronomers are hoping for you!

gionkunz commented 4 years ago

I'm having slow but steady progress ;-)

YahaGr notifications@github.com schrieb am Di., 27. Aug. 2019, 02:26:

Good luck! Thousands of Amateur astronomers are hoping for you!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Stellarium/stellarium/issues/406?email_source=notifications&email_token=AAQ2AOEEEXCANE2KI4L7ZSTQGRYBVA5CNFSM4FXHVFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5GCM4I#issuecomment-525084273, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQ2AOFFWOYNVOTVATJDAF3QGRYBVANCNFSM4FXHVFQQ .

rederikus commented 4 years ago

I am amazed. My request has been answered. Thank you. Now, where can I get my hands on this to test it.

Thank you guys. You have just done the whole world of amateur astronomers a HUGE favour.

Wonderful

rederikus commented 4 years ago

I'll help anyway I can. I have ASCOM telescopes available and so do some of my fellow astronomers at our club. I am pretty much a hardware guy and an old one at that. With regards to writing code I am like a fish with a bicycle so to test I really would like a Windows executable if I am to help out which, I would really like to do.

Again thanks you very much for this.

gzotti commented 4 years ago

I feel there is lots of demand, and many volunteers to test this.

Not sure if @gionkunz can provide installers. Maybe you can try building his repository from sources. This does not require you to write code, just follow the instructions in our wiki: Install Cmake, MS Visual C (free community edition), install Qt 5.13 (OpenSource version, free; don't forget to install the deprecated QtScript module!), git, clone Gion's repository, load in QtCreator, build, and execute. If you are generally OK with operating a Windows system, this should work within a few hours or maybe days. And whoever is able to help Gion with coding can try to fix what does not work on his/her particular equipment.

rederikus commented 4 years ago

Thanks for your reply. I shall try and attempt not to break it. I am so pleased that I caused this thread to be re-opened and to see ASCOM coming to Stellarium. I use CdC, Starry Night and Sky Tools. CdC is great for telescope handling and its built-in ASCOM features. They are far better than those on Starry Night. Stellarium's support is also more responsive than Starry Night where they only help if they think it is worthwhile. It is a shame because it is an expensive program. Once Stellarium has working ASCOM I can drop Starry Night entirely.

gzotti commented 4 years ago

Not so much reopening this (and closing the other) request, but Gion's activity is bringing ASCOM to Stellarium. Let's hope for the best now!

gionkunz commented 4 years ago

Okay, I think I'm nearly done with implementing the feature. I have tested it already with two different Simulators and with my EQ6-R mount. However, more sophisticated testing is required for testing the ASCOM coordinate systems and Stellariums way of calculating atmospheric refraction when using JNow and the mount does not do it by itself. This Saturday, it looks like there's a Starry Night (pardon the pun), and I'll take my scope for a detailed pointing test including the new sync functionality (ctrl + shift + <scope#>).

I never built the installer, but I think I should learn how to do it, since I also have a few people who would be very much interested to test this feature. Please bear with me, since I only have limited time to work on this.

I'm very certain we will soon have ASCOM support in Stellarium, since I won't stop until this is accepted and agreed by all involved parties.

Cheers Gion

gzotti commented 4 years ago

Sounds good. I can hopefully test it next weekend with my NEQ3. Maybe @alex-w could quickly build trial installers from your sources (or is the "Making the Installer" in the wiki Build instructions for Windows still up-to-date? Then just follow that.), so that Windows users can send you feedback. What about the win32/win64 issues, what is the recommended process now? Does a single 32bit ASCOM driver require you to use Stellarium 32bit, or do you handle all these cross-bittiness properly? (Not sure, are there still 32bit systems in wide use for telescope guiding systems?)

gionkunz commented 4 years ago

Well, the 32bit / 64bit issue seems to be fine. At least with the EQ ASCOM simulator and the ASCOM.Telescope.Simulator I do not notice any issues with either the 32 or the 64 bit version of my build. However, this could potentially be an issue with other ASCOM drivers which were compiled for a specific architecture. My latest commits include better error tolerance and I guess the effect of such an issue would currently be that the telescope would always show as "connecting..." similar to all the other telescope types, when you enter invalid parameters.

gionkunz commented 4 years ago

I have managed to build the installer. You can download the installer files for 32 and 64 bit here: https://drive.google.com/drive/folders/1hgTWKgmOgYq2OFNchOLdZxLgpZlKXPi7?usp=sharing

alex-w commented 4 years ago

On Windows the plugin has issue in the GUI when ASCOM platform is not installed. I think the better choice here will be add the persistent GUI elements and manage enable/disable state for it on Windows.

rederikus commented 4 years ago

Will this help? I asked in the ASCOM forum how to detect an ASCOM install in Windows. Here's the replies. I tried to post a link but it didn't work twice. Here's the full text.

Is there a way for a Windows program to detect the presence of an ASCOM installation before any connections are attempted.  To explain further, I need to see if ASCOM is even installed on a Windows PC when I run a program.  It does not matter if ASCOM is being used or not, just installed.There is probably a registry lookup or a folder/filename combo that I can use but I would rather the ASCOM devs pointed me in the right direction before I make mistakes.Thank you.

Reply Like More Rick B.17:52   #41531  You could read HKEY_LOCAL_MACHINE\SOFTWARE\ASCOM\PlatformVersion from the Windows Registry to get the version number of the installed platform version.However, I would wait until Peter Simpson has replied since he may have a better suggestion.Rick B Reply Like More John Eccles18:05   #41532  On my WIN7 Professional machine the key is at: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ASCOM\Platform Reply Like More Rick B.18:30   #41533  The WOW6432Node only exists on 64-bit versions of windows. The OP did not say the bitness of his Windows version.Some registry keys are shared by both 32-bit and 64-bit software. The Registry Redirector takes care of re-directing registry access to the correct location. So, the location that I specified is good for any application running on either a 32-bit or a 64-bit version of Windows. I just don't know if it is the best, definitive location to determine if the Platform is installed.Here is a link to more info about the Registry Redirector --> https://docs.microsoft.com/en-us/windows/win32/winprog64/registry-redirectorRick Btoggle quoted messageShow quoted text Reply Like More Pete20:07   #41534  Thanks guys.  Most helpful.

gionkunz commented 4 years ago

@rederikus I think instead of polluting to code even more with windows specific code, we keep it as we have it solved right now. We simply try to connect to the ASCOM.Util COM object and if that fails, we know that there's no ASCOM. Also this is great because it allows us to get the ASCOM version and also fail if it's significantly outdates (< version 6).

gionkunz commented 4 years ago

But anyways, thanks so much for this clarification and valuable inputs!

rederikus commented 4 years ago

I can do very little to help this project but I feel some responsibility for having pushed you guys in this direction. I know it is not true but I kind of feel you are doing this for me. I am many things but not a coder.

I understand why you might not wish to put in Windows specific code to poke about in the registry.

gionkunz commented 4 years ago

I can only speak for myself, but you did certainly not push me into any direction 😄 I wanted this feature since I have installed Stellarium and Stellarium Scope the first time, but never took the initiative to start development. I was re-using this ticket because that's what you should do on Github, instead of opening new tickets for the same topic. Also this issue was originally reported by someone else Mi.Holzner: https://bugs.launchpad.net/stellarium/+bug/1082196 . And I guess there are a bunch of other astronomy people who wish for this feature for a long time 😄 So really nothing you should feel responsible about in a negative way...

rederikus commented 4 years ago

Oh it is not in any negative sense at all. I was happy to find another thread. Mi.Holzner's that was also asking for ASCOM.

I am super happy to have helped to precipitate this sub-project. No wish to push anybody in any direction that they did not already want to go. This is great,

rederikus commented 4 years ago

Without asking for even more work to be done, I number of people I know use IP (either via LAN cable or WiFi) to control their telescopes. I found that I was limited to COMx ports using Stellarium's built-in scope control.

Will it be very hard to include IP address connectivity? Just askin' , no mor'n that. Thanks Pete

gzotti commented 4 years ago

This is why I asked whether StellariumScope is completely obsolete now. Maybe network connectivity is available by ASCOM? (I never had the need for it.)

rederikus commented 4 years ago

I know that some ASCOM drivers do support IP connectivity as well as COMx connections. This is because I have used them on telescopes.

From what I have searched for and read StellariumScope looks, at best, to be no longer updated or maintained which is a shame. More I do not know.

rederikus commented 4 years ago

This amazing. Whilst I have only tested Stellarium/ASCOM on my bench system it worked perfectly. I shall try it out this weekend at the club observatory. Even the TCP/IP connection works along with (obviously) the COM ports.

When do you think this will be released for all to use? Will there soon be a 32 bit version? I have discovered that some ASCOM drivers are 32bit compatible only and will only run with a 32 bit compile.

gionkunz commented 4 years ago

Hi

There is still some documentation work and a bit of testing due to some issues we habe discovered which need clarification. I need to check when I will find time but its a matter of weeks Id say.

Cheers Gion

rederikus notifications@github.com schrieb am Di., 29. Okt. 2019, 02:00:

This amazing. Whilst I have only tested Stellarium/ASCOM on my bench system it worked perfectly. I shall try it out this weekend at the club observatory. Even the TCP/IP connection works along with (obviously) the COM ports.

When do you think this will be released for all to use? Will there soon be a 32 bit version? I have discovered that some ASCOM drivers are 32bit compatible only and will only run with a 32 bit compile.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Stellarium/stellarium/issues/406?email_source=notifications&email_token=AAQ2AODVM2C55AV6K6QGY23QQ6DKLA5CNFSM4FXHVFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECO4GNI#issuecomment-547210037, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ2AOE6AUIIEAV4AYB22HDQQ6DKLANCNFSM4FXHVFQQ .

rederikus commented 4 years ago

Great. Thanks Gion.

This update is going to make a lot of people happy I think. I am still amazed at how quickly this has been brought to alpha testing stage.

What a great team.

rederikus commented 4 years ago

Two night ago I took my 8" Dob on its home made goto mount to the observatory. I id a 3 star align and turn control over to Stellarium + ASCOM via a HC-05 Bluetooth connection on the scope. It worked flawlessly. I used a 32mm eyepiece and every time I did a goto the object appeared in the eyepiece. It was just the same a using the OnStep hand controller. I am super impressed.

I know I have said this before but I genuinely believe that you have done the world of amateur astronomy a great favor by putting ASCOM into Stellarium. Thank you all once more. Pete

gzotti commented 4 years ago

Some things take time. See https://sourceforge.net/p/stellarium/feature-requests/60/ for probably the oldest ASCOM request, for version 0.8.0, and Johannes' call for participation.

gionkunz commented 4 years ago

If all astronomers have one thing in common, it's probably (to be forced to learn) to be patient... :-)

gionkunz commented 4 years ago

@rederikus that's awesome! So far we have had very good response with the alpha version. I'm writing on the documentation as we speak.

rederikus commented 4 years ago

@gionkunz I realize that I was not by, far the first to request this but it seems that my little ask came at just the right moment to kick the rock off the cliff and then, of course, there came the splash as the rock hit the water. Many rocks fall but sometimes, just sometimes the time is right for the splash.

As to patience, the cry is often, "Give me patience but, I want it now." Either way, I am really happy that you all did what you did. I await the official release eagerly.

Cheers Pete