×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

help for starting to build simple INDI driver

  • Posts: 5
  • Thank you received: 1
Hello

I am new to INDI driver and fairly unexperienced with programming. However, I want to make an INDI driver for my telescope, that is home made and has electronics that are anything but standard. Yet simple: with appropriate signals sent on the serial port of my computer, I can tell the telescope to go north, south, east or west. And that is all I want to do! The goal being to use this driver with Ekos or phd2 for autoguiding. Is it possible to do that? Is it a correct way of proceeding?

I am now going through the tutorial of INDI development. I have the example on my computer, and I cannot manage to build the simplest example. For instance the tutorial_one example (the one that does nothing, just connect, disconnect)

Rather than a long explanation, the list of commands I typed:
sronayet@sappcr62:~$ cd /home/sronayet/Documents/libindi/examples/tutorial_one/
sronayet@sappcr62:~/Documents/libindi/examples/tutorial_one$ ll
total 24
drwxrwxr-x 2 sronayet sronayet 4096 juil. 21 21:14 ./
drwxrwxr-x 9 sronayet sronayet 4096 juil. 21 10:01 ../
-rw-rw-r-- 1 sronayet sronayet  136 juil. 21 10:01 CMakeLists.txt
-rw-rw-r-- 1 sronayet sronayet 4227 juil. 21 10:01 simpledevice.cpp
-rw-rw-r-- 1 sronayet sronayet  822 juil. 21 20:25 simpledevice.h
sronayet@sappcr62:~/Documents/libindi/examples/tutorial_one$ cmake .
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sronayet/Documents/libindi/examples/tutorial_one
sronayet@sappcr62:~/Documents/libindi/examples/tutorial_one$ make
Scanning dependencies of target tutorial_one
[100%] Building CXX object CMakeFiles/tutorial_one.dir/simpledevice.cpp.o
In file included from /home/sronayet/Documents/libindi/examples/tutorial_one/simpledevice.cpp:24:0:
/home/sronayet/Documents/libindi/examples/tutorial_one/simpledevice.h:25:36: fatal error: indibase/defaultdevice.h: Aucun fichier ou dossier de ce type
 #include "indibase/defaultdevice.h"
                                    ^
compilation terminated.
make[2]: *** [CMakeFiles/tutorial_one.dir/simpledevice.cpp.o] Erreur 1
make[1]: *** [CMakeFiles/tutorial_one.dir/all] Erreur 2
make: *** [all] Erreur 2
 

ok, so first, it doesn't know where the incudes are. (the folder indibase is in /home/sronayet/Documents/libindi/libs/indibase/) How can I tell it?

In the end, I tried brutaly to do it manually which returned a bunch of insults:
g++ -I/home/sronayet/Documents/libindi/libs -I/home/sronayet/Documents/libindi -I/home/sronayet/Documents/libindi/libs/indibase simpledevi/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 0 a un index de symbole 11 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 1 a un index de symbole 12 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 2 a un index de symbole 2 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 3 a un index de symbole 2 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 4 a un index de symbole 11 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 5 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 6 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 7 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 8 a un index de symbole 12 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 9 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 10 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 11 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 12 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 13 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 14 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 15 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 16 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 17 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 18 a un index de symbole 13 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): réadressage 19 a un index de symbole 21 invalide
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_line): réadressage 0 a un index de symbole 2 invalide
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: dans la fonction « _start »:
(.text+0x20): référence indéfinie vers « main »
/tmp/cc9f4r6K.o: dans la fonction « SimpleDevice::SimpleDevice() »:
simpledevice.cpp:(.text+0x234): référence indéfinie vers « INDI::DefaultDevice::DefaultDevice() »
/tmp/cc9f4r6K.o: dans la fonction « SimpleDevice::Connect() »:
simpledevice.cpp:(.text+0x25e): référence indéfinie vers « INDI::BaseDevice::getDeviceName() »
simpledevice.cpp:(.text+0x270): référence indéfinie vers « IDMessage »
/tmp/cc9f4r6K.o: dans la fonction « SimpleDevice::Disconnect() »:
simpledevice.cpp:(.text+0x294): référence indéfinie vers « INDI::BaseDevice::getDeviceName() »
simpledevice.cpp:(.text+0x2a6): référence indéfinie vers « IDMessage »
/tmp/cc9f4r6K.o: dans la fonction « INDI::DefaultDevice::getDriverName() »:
simpledevice.cpp:(.text._ZN4INDI13DefaultDevice13getDriverNameEv[_ZN4INDI13DefaultDevice13getDriverNameEv]+0xb): référence indéfinie vers « me »
/tmp/cc9f4r6K.o: dans la fonction « SimpleDevice::~SimpleDevice() »:
simpledevice.cpp:(.text._ZN12SimpleDeviceD2Ev[_ZN12SimpleDeviceD5Ev]+0x1f): référence indéfinie vers « INDI::DefaultDevice::~DefaultDevice() »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0x20): référence indéfinie vers « INDI::DefaultDevice::deleteProperty(char const*) »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0x28): référence indéfinie vers « INDI::DefaultDevice::setConnected(bool, IPState, char const*) »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0x30): référence indéfinie vers « INDI::DefaultDevice::TimerHit() »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0x40): référence indéfinie vers « INDI::DefaultDevice::ISGetProperties(char const*) »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0x48): référence indéfinie vers « INDI::DefaultDevice::ISNewSwitch(char const*, char const*, ISState*, char**, int) »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0x70): référence indéfinie vers « INDI::DefaultDevice::loadConfig(bool) »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0x78): référence indéfinie vers « INDI::DefaultDevice::saveConfig() »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0x80): référence indéfinie vers « INDI::DefaultDevice::saveConfigItems(_IO_FILE*) »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0x88): référence indéfinie vers « INDI::DefaultDevice::loadDefaultConfig() »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0x90): référence indéfinie vers « INDI::DefaultDevice::debugTriggered(bool) »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0x98): référence indéfinie vers « INDI::DefaultDevice::simulationTriggered(bool) »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0xa0): référence indéfinie vers « INDI::DefaultDevice::initProperties() »
/tmp/cc9f4r6K.o:(.rodata._ZTV12SimpleDevice[_ZTV12SimpleDevice]+0xa8): référence indéfinie vers « INDI::DefaultDevice::updateProperties() »
/tmp/cc9f4r6K.o:(.rodata._ZTI12SimpleDevice[_ZTI12SimpleDevice]+0x10): référence indéfinie vers « typeinfo for INDI::DefaultDevice »
collect2: error: ld returned 1 exit status
ce.cpp -o tutorial_one

Sorry for my ignorance, and thanks a lot if you can help! I probably just miss a simple thing so the compiler knows where the .h files are, and which would allow me to build correctly the INDI driver?

Samuel
9 years 9 months ago #1526

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

Please run cmake in the build directory, if you follow the instructions here here , all the examples will be built for you. You shouldn't be running cmake in the tutorial directory directly.
9 years 9 months ago #1527

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

  • Posts: 5
  • Thank you received: 1
oh, ok I thought that was the point of the CMakeList in each folder. So ok, that works now! I had actually followed these instruction earlier to get the latest INDI drivers, but I guess I didn't really know what I was doing, and didn't realized I could repeat it each time I modify an example (well I just send the command make install to compile the modified code, right?)
Thank you!
Now I can see my new indi driver in phd2 (because I launch the indi server prior to launching phd2, with
indiserver ini_tutorial_one
)
but in Ekos, I can't see it in the list. The drivers folder is set to /usr/share/indi, which confuses me... this is where xml files are (I don't know yet what they are for), but all the executables (such as indi_v4l2_ccd) are in /usr/bin, so is my newly created indi_tutorial_one (I copied it manually), but Ekos doesn't offer me the possibility to select it... I'll keep investigating...

Thanks again for your prompt reply
Last edit: 9 years 9 months ago by Ronayette.
9 years 9 months ago #1530

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

If you want to see the driver in Ekos (assuming local mode), you need to make an XML file for your driver and save it under /usr/share/indi. You can see the structure of XML files there and just use an existing one to make modification. However, you should be building tutorial_two (SimpleScope) since that is what you plan to do.
<devGroup group="Telescopes">
        <device label="Simple Scope">
                <driver name="Simple Scope">tutorial_two</driver>
                <version>0.1</version>
        </device>
</devGroup>

Assuming of course you copied tutorial_two to /usr/bin. Then if you run KStars->Ekos you will see Simple Scope from the Telescope selection menu.
9 years 9 months ago #1531

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

  • Posts: 5
  • Thank you received: 1
ok thanks a lot. It's all fine now!
Well, I struggled a lot, because I am not familiar with programming in C++ with classes and everything, but I managed to have my own driver working! I actually started from telescope_simulator.cpp, I looked at lx200_generic driver too, to understand how the communication with the serial port is made. I now have my button North, South, East, West working (i.e. I can command the motors fromt Ekos), I now have to write more functions so it can be used for autoguiding, but I am getting there!
The following user(s) said Thank You: Jasem Mutlaq
9 years 9 months ago #1550

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

Time to create page: 0.468 seconds