×

INDI Library v1.9.6 Released (21 May 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

Developing Driver for Arduino

  • Posts: 29
  • Thank you received: 2
Lacking experienced with the tools; my goal is to produce drivers for some Arduino devices. The first project is a DC motor focuser. I know that there are templates for INDI Arduino drivers but first I must learn how to use the tools.

QtCreator 5.7.0 and related Qt tools are installed. Including Qt5Network. (But not Cmoc and Ctest) on Ubuntu MATE 16.04

Reference:
www.indilib.org/develop/developer-manual...ent-environment.html

So I have ~/Projects/indi directory structure

I also have ~/Projects/training where qt-tutorial-01 is stored. This tutorial gives a very basic grasp of how the Qt tool can be used.

I have read the INDI White Paper so that also teaches a lot.

After several hours of exploration and tests, some questions arise.

Is it possible to have KStars-Ekos using the indiserver etc. on the /Projects/indi/libindi-build path rather than the /usr/bin ? My attempts failed (using the webserver localhost:8264) when I disabled the /usr/bin/indiserver in favour of the /Projects/indi/libindi-build and rebooting….)

If this problem can be solved, then the next issue can be the availability of a “test driver” to add to the list to test in Ekos. I would start with the indi driver tutorial examples. How are these builds to be included in the list categories for device drivers? (Probably via the development environment configuration …..?)
5 years 7 months ago #11808

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

If you're developing a driver, there is no need to care about indiserver. The way drivers are displayed in Ekos is via XML files (see /usr/share/indi). To use a self-contained 3rd party example driver, check out Generic CCD , you can see once you compile and run sudo make install that it installs indi_generic_ccd.xml to /usr/share/indi and then you'll find "Generic CCD" in your drivers list in Ekos.

Ok I made another video and posted it here: indilib.org/develop/developer-manual/163...ent-environment.html

So that it becomes super clear and easy on what to do!! I hope that helps
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
The following user(s) said Thank You: Sébastien
Last edit: 5 years 7 months ago by Jasem Mutlaq.
5 years 7 months ago #11810

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

  • Posts: 29
  • Thank you received: 2

Replied by VTVL on topic Developing Driver for Arduino

Jasem,
Thanks for the additional video.
Some learning observations with the QT Creater tool:

1)
Cannot configure via QT Tools/Options/ Build & Run the build dirctory WITH the build parameters in the lower field. So it is only home/john/Projects/build/generic-ccd/

2)
kdesudo -c “make install” is not correct for Ubuntu MATE 16.04
apt-get install kdesudo fixes this.

3)
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/bin/indi_generic_ccd
Why is the path not /usr/bin for indi_generic_ccd ? I copied the file to the /usr/bin
-- Installing: /usr/share/indi/indi_generic_ccd.xml
This directory is correct.

4)
Debug Monitor Icon near bottom left of QT (above green run button) has indiserver
and indiserver(2) . I do not know why and I do not know how to delete indiserver(2).

I can however start the indiserver and the indi_generic_ccd .
The Run button invokes
/usr/bin/indiserver -v indi_generic_ccd
The snooping is reported in the application output window.
I can then confirm the start of indiserver and the indi_generic_ccd via connect via the Kstars-Tools-Device Manager Client Localhost port 7624. Then I see the panel for the generic_ccd which has Generic_ccd Model 1 and Generic_ccd Model 2.
The INDI Web Manager also works.
5 years 7 months ago #11939

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

You must changed CMAKE_INSTALL_PREFIX to /usr as explained in the guide. I made it in bold and red if it wasn't clear before. To delete build targets, go to Projects --> Run --> then you can find a list and edit/add/delete
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
5 years 7 months ago #11940

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

  • Posts: 29
  • Thank you received: 2

Replied by VTVL on topic Developing Driver for Arduino

Progressing:…….
NFocus and Moonlite were examined. MoonLite appears to be easier to adapt to the command set in the arduino. I copied moonLite .cpp and .h and renamed them to arduinoDCfocus (indi_arduinoDC_focus). Using the Cmake procedure as in the tutorials I tested the arduinoDCfocus after editing .h and .cpp. It worked! The arduino focuser responded to many of the basic commands.
Next I want to edit “moonLite” to “arduinoDCfocus”. So I did find and replace.

When debugging the following error message is given.


#include "arduinoDCfocus.h"
#include "indicom.h"
#include <stdio.h>
#include <termios.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include <math.h>
#include <memory>
#define ARDUINODCFOCUS_TIMEOUT 3
#define POLLMS 250
std::unique_ptr<arduinoDCfocus> arduinoDCfocus(new arduinoDCfocus());

Issues

/home/john/Projects/indi/libindi/drivers/focuser/arduinoDCfocus.cpp:37: error: expected type-specifier before 'arduinoDCfocus'
std::unique_ptr<arduinoDCfocus> arduinoDCfocus(new arduinoDCfocus());


So I have done some more exploring of the library and I have Googled.

I cannot see why this message occurs. Please help.
5 years 7 months ago #12496

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

you can't create an object that has the same name as the class!! Call it something else like ardfocus or whatever
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
5 years 7 months ago #12497

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

Time to create page: 0.241 seconds