Intergrating ESP32 microcontroller into NDI/Ekos/KStars #45002
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.
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.
Intergrating ESP32 microcontroller into NDI/Ekos/KStars #45440
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."
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.