×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Intergrating ESP32 microcontroller into NDI/Ekos/KStars

  • Posts: 29
  • Thank you received: 5
Hi All,

I have been tinkering with an ESP32 and a Cytron MD30C R2 Motor Driver board to drive a WheelChair geared motor for my roll-off observatory with the intention of automating my imaging sessions.
I started in Arudino IDE and then moved onto Platform IO still using the Arduino framework (as the libraries for the Cytron driver board were pretty much useless).

I am at a stage now when I can control the ESP32 from serial monitor and from an instance of Node-Red running on the cloud (maximising the WiFi capabilities of the ESP32 which are proving to be reliable).
However, I would like to bring everything under one control panel in INDI/Ekos/KStars.

So, my questions are:
1. Is there a way for INDI/Ekos/KStars to ‘see’ my ESP32 running a sketch in C++?
2. If not, how can I go about integrating an ESP32 into INDI/Ekos/KStars?
3. Is it important that I try to learn micropython/Python so that INDI/Ekos/KStars see the same programming language as my device?
4. How do I go about looking for drivers or writing my own custom drivers.

Indiduinopage: indilib.org/develop/arduino/110-welcome-to-indiduino.html, left me no better off and still confused.

Many thanks in advance.
Will.
4 years 5 months ago #45002

Please Log in or Create an account to join the conversation.

So you need to develop a roll-off INDI driver. You can start from the simulator here: github.com/indilib/indi/blob/master/drivers/dome/roll_off.cpp

If you can communicate with the ESP32 over serial port, then you can use the regular serial port controls in INDI drivers. You can also connect over WiFi/Ethernet and issue any arbitrary commands. I guess it depends on what is exactly running on the other end.

The ESP32 needs to probably expose the following API:

1. Open (rotates motors in one direction, say CW)
2. Close (same as above but CCW)
3. isOpen (check limit switch status on the fully opened position). If true then roof is "unpaked"
4. isClosed (check limit status on the fully closed position), If true then roof is "parked"

That's all you need. I have a rolloff observatory and that's all I needed but I use a networked relay controller that exposes a REST API to control motor relays.
4 years 5 months ago #45019

Please Log in or Create an account to join the conversation.

  • Posts: 29
  • Thank you received: 5
Hi Again,

I have been working on this over the last week but I think I went into the deep end too quickly. I think there are things in C++ i'm still learning.
Jasem I followed your link and looked at the roll-off INDI driver simulator and I can't get my head around the code to make my own driver.

Jasem can you explain a bit more what you meant by "If you can communicate with the ESP32 over serial port, then you can use the regular serial port controls in INDI drivers. You can also connect over WiFi/Ethernet and issue any arbitrary commands. I guess it depends on what is exactly running on the other end."

As such I have been trying to adapt this project on Github to my ESP32: github.com/dokeeffe/indi-aldiroof.git

I have modified the Arduino sketch and the associated libraries under that folder (Firmata) and compiled all code successfully to the ESP32 board.

I also followed the "Setting Development Tutorial", installed Qt Creator and attempted to followed the videos but I'm stuck at this point. Apologies if i use the wrong terminologies as i ask for help.

1. Can someone explain to me, as dumb-downed as possible, how to add this Github custom driver (aldi-roof) to the main indilib drivers so that I can compile and test in Kstars?
2. Is Firmata absolutely necessary (over serial or WiFi) for the driver to work?
3. Is anyone willing to walk me through writing a driver for my original sketch? - attached in .txt file.

Many thanks in advance.
4 years 4 months ago #45440
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 29
  • Thank you received: 5
Hi again,

Concerning point number 1. from last post: is the method under "installing dependencies" from this page github.com/magnue/indi_usbrelay2_roof the one I should use to install custom drivers?
It looks like this the same method which i tried by Jasem from this page: www.indilib.org/forum/general/210-howto-...st-libindi-ekos.html
4 years 4 months ago #45441

Please Log in or Create an account to join the conversation.

  • Posts: 29
  • Thank you received: 5
Apologies all, I didn't have libindi-dev installed.

Oops. Did learn some things while I was going rounds in circles.

One hurdle cleared.

Now the esp32 board and my custom Firmata kmementation is seen by Ekos as incompatible. I'll investigate more and update.
4 years 4 months ago #45459

Please Log in or Create an account to join the conversation.

Time to create page: 0.202 seconds