Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to help or reproduce #1

Open
Sylvain-BROCAS opened this issue Feb 25, 2024 · 11 comments
Open

How to help or reproduce #1

Sylvain-BROCAS opened this issue Feb 25, 2024 · 11 comments

Comments

@Sylvain-BROCAS
Copy link

Hello,
I'm currently trying to build a small mount I want to fully control with nina for astrophotography. So standards like ascom or indi are necessary for my project. I tried do dig into both ascom drivers and indi, but it's quite difficult for a python developper.
I recently discovered alpyca and I just discovered your repo. I find it very interresting, because in addition to know python quite good, I have an ESP32 board that seems to be able to support an alpaca instance and micropython to drive all my actuators.
This is why I would try to implement my solution in a similar way to yours. I have a lot of questions, so is it possible to contact you to ask you more about your project ?
I'm interrested to reproduce quite the same tool, so maybe I could collaborate on your repo

@RunTJoe
Copy link
Owner

RunTJoe commented Feb 26, 2024

Hello Sylvain, of course you can contact me for questions. If these questions are interesting for the whole community, you can post them here. If the questions are very specific, it might be better to contact me directly. Unfortunately GitHub does not support private messages, but you might join the ASCOM Driver and Application Development Support Forum (this is anyhow a good place if you want to develop your driver). You can find me there with the same user name and can write me private messages.

@Sylvain-BROCAS
Copy link
Author

Hi,
Thank you very much, to be honnest my questions are both very specific and general, I have read a lot of Alpaca documentation but ther are still a lot of dark areas.

I will try to be as clear as possible, but everything is very messy in my head right now. However I will put my questions here so other (lost) people like me will maybe find interresting answers.

Here are some points I would like to enlighten :

  • I've read your scripts, and it seems that to make a driver for any other device, I should only change alpacaswith.py, myalpacaswitch.py and update server creds and example file am I right ?
  • It's saif in documentation of Alpyca that the responder classes should be decored with @before. I didn't see it in your files. Do I miss something ?
  • How does it work ? I mean, does your board create a hotspot on wich your computer is connected and once it's connected, Nina can see your device?

Do you have good ressources that could help me to developp the same tool but for a motorized mount ?

Thank you for your time and attention

@RunTJoe
Copy link
Owner

RunTJoe commented Feb 27, 2024

Hi,
If you want to follow my design idea, you should not modify alpacaswitch.py and mipyalpacaswitch.py as these files are implementing ASCOM switch devices. You should add a new file with a class derived from class AlpacaDevice providing the ASCOM telescope API (as this is the API for mounts) as used for all possible mounts and an additional file providing the hardware specific part for your mount (derived from your telescope API class).

image

You can find the description of the ASCOM telescope API here Telescope Specific Methods and here ITelescopeV3 Interface

My implementation does not use Alpyca. It is targeted on very small microcontrollers where only MicroPython is available.

The board can either create a hotspot (call AlpacaServer.startAccessPoint ) or connect to an existing access point (call AlpacaServer. connectStationMode). After this, the device can be found by any software supporting Alpaca Discovery. E.g. in example switchExample1.py you can find an example how to connect to an access point.

I have no resources for the hardware specific features of a mount. For general understanding of the Alpaca/ASCOM API you should read Alpaca API Reference and ASCOM Implementation Neutral Interface Definitions especially the parts for the device type “Telescope” as you will have to implement exactly this API.

@Sylvain-BROCAS
Copy link
Author

Ahhh ok, thank you, I missed that it was alpAca and not alpYca.

Thank you for the explanations, I better understand the global organisation.

I could run alpyca on a raspberry pi but since I have an ESP32, I think I will try to run the hardware parts and the driver on the same board to make an "fullstack" like device.

Another question, you seems to use Thonny IDE to developpe your µPython programmes, how do you install your packages like microdot ? I get an error everytime I try to use the package manager. Do you have to install everything manually too ?

Stay tuned for my future questions 😉

Thank you again

@Sylvain-BROCAS
Copy link
Author

I found the next question 🥳

It's about installation of the 2 additionnal packages. As I wrote in my last message, my package manager in Thonny IDE is brocken so I just downloaded packages sources as it's said for example in microdot documentation.

My question is how do you produce the XXXX_template ? I guess you use utemplate, but from wich file do you make these ?

I read your code again with your scheme and microdot docs aside and I understand waaay better how things are working, thanks !

@Sylvain-BROCAS
Copy link
Author

I found the next question 🥳

It's about installation of the 2 additionnal packages. As I wrote in my last message, my package manager in Thonny IDE is brocken so I just downloaded packages sources as it's said for example in microdot documentation.

My question is how do you produce the XXXX_template ? I guess you use utemplate, but from wich file do you make these ?

I read your code again with your scheme and microdot docs aside and I understand waaay better how things are working, thanks !

The answer is here : https://microdot.readthedocs.io/en/stable/migrating.html
Microdot V2 should be used now instead of V1. The new version has a new architecture fully asynchronous. That's why there were missing files in my instance of microdot.

@RunTJoe
Copy link
Owner

RunTJoe commented Mar 4, 2024

Maybe I should try to port the software to the latest versions of Microdot and Thonny, but this might take some time.

@Sylvain-BROCAS
Copy link
Author

Well, if it runs, it's a good software ... 😄
I just wanted to share this to anybody interrested in re doing this project.

I have made a lot of progress and I started a new topic on group.io to share the news around this project and ask for help. I'm just waiting for the forum moderators approval. My code is in this repository : https://github.com/Sylvain-BROCAS/Starget

@Sylvain-BROCAS
Copy link
Author

Hi,
I encounter a new issue. All the requests to /management/... are working fine but every request to /api/v1/...return a 404 error.
My files are here : https://github.com/Sylvain-BROCAS/Starget
Do you have an idea of what is happening ?

Here are the possibilities i'm suspecting :

  • packages leaking due to unsigned requests
  • problem with the server configuration
  • problem with ascom alpaca configuration on ASCOM device manager

Thanks for your help

@RunTJoe
Copy link
Owner

RunTJoe commented Mar 8, 2024

Hello,
as I`m on vacation the next few days it will take some days until I can have a look on this.

@Sylvain-BROCAS
Copy link
Author

Hello, as I`m on vacation the next few days it will take some days until I can have a look on this.

Problem solved,
It was linked to a bug in 2.0.4 Microdot release, upgrading it to 2.0.5 solved everything.

Now my device is connecting to Nina and i'm debugging the default functions of my telescope device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@Sylvain-BROCAS @RunTJoe and others