×
INDI Library v1.8.1 Released (09 Sep 2019)

Monthly maintenance release INDI v1.8.1

Intergrating ESP32 microcontroller into NDI/Ekos/KStars

2 weeks 6 days ago
AstroWill
Junior Boarder
Junior Boarder
Posts: 26
More
Topic Author
Intergrating ESP32 microcontroller into NDI/Ekos/KStars #45002
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.

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

2 weeks 6 days ago
knro
Administrator
Administrator
Posts: 7343
Karma: 51
Intergrating ESP32 microcontroller into NDI/Ekos/KStars #45019
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.

Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info

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

1 week 1 day ago
AstroWill
Junior Boarder
Junior Boarder
Posts: 26
More
Topic Author
Intergrating ESP32 microcontroller into NDI/Ekos/KStars #45440
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.
Attachments:

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

1 week 1 day ago
AstroWill
Junior Boarder
Junior Boarder
Posts: 26
More
Topic Author
Intergrating ESP32 microcontroller into NDI/Ekos/KStars #45441
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

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

1 week 18 hours ago
AstroWill
Junior Boarder
Junior Boarder
Posts: 26
More
Topic Author
Intergrating ESP32 microcontroller into NDI/Ekos/KStars #45459
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.

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

Time to create page: 0.160 seconds