Jump to content

SkySurveyBanner.jpg.21855908fce40597655603b6c9af720d.jpg

Writing or Modifying INDI Drivers for Astro Imaging and Control with RPi


Gina

Recommended Posts

Think I just might be getting somewhere.  /usr/bin/cc is a link which points to another link and after following numerous links ends up at the real executable - /usr/bin/gcc-5.  I guess this wants replacing.

OTOH why go through several links to reach the executable application?  Think I'll see if I can find the call and make it direct instead of link after link.  See if that works. 

I checked the permissions and gcc-5 is root so tried sudo but that didn't work.

Link to comment
Share on other sites

  • Replies 59
  • Created
  • Last Reply

This is the first part of the CMakeError.log file :-

Quote

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /usr/bin/cc
Build flags:
Id flags:

The output was:
1
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND
Build flags:
Id flags:

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND
Build flags:
Id flags: -c

The output was:
No such file or directory

 

Link to comment
Share on other sites

OTOH the CMakeOutput.log showed

Quote

The system is: Linux - 4.4.0-21-generic - x86_64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /usr/bin/cc
Build flags:
Id flags: -c

The output was:
0


Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o"

The C compiler identification is GNU, found in "/home/gina/libindi/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.o"

Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /usr/bin/cc
Build flags:
Id flags: -c

The output was:
0


Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o"

The C compiler identification is GNU, found in "/home/gina/libindi/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.o"

Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /usr/bin/cc
Build flags:
Id flags: -c

The output was:
0


Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o"

The C compiler identification is GNU, found in "/home/gina/libindi/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.o"

That indicates success.  Weird or what!!!

Link to comment
Share on other sites

Changed the /usr/bin/cc to /usr/bin/gcc-5 in CMakeCache.txt as described in the notes in that txt file but it didn't cure the problem - just referred to /usr/bin/gcc-5 instead.  So it seem the linking works fine but the gcc-5 compiler app is broken.

Link to comment
Share on other sites

Googled gcc-5 and found this

 gcc 5 on ubuntu 14.04

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
Link to comment
Share on other sites

gina@Mint-Desktop ~/libindi $ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug .
CMake Error at /usr/share/cmake-3.5/Modules/CMakeDetermineCompilerId.cmake:132 (file):
  file failed to open for writing (Permission denied):

Trying again with sudo on the front...

Link to comment
Share on other sites

gina@Mint-Desktop ~/libindi $ sudo cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug .
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindZLIB.cmake:124 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:41 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
See also "/home/gina/libindi/CMakeFiles/CMakeOutput.log".
See also "/home/gina/libindi/CMakeFiles/CMakeError.log".
gina@Mint-Desktop ~/libindi $ 

 

Link to comment
Share on other sites

Found this :- Installing zlib through source code on Ubuntu Linux

Quote

Steps to download, compile, and install are as follows. Note: Replace 1.2.3 with your version number:

Downloading zlib:

Run the command below,


wget http://www.zlib.net/zlib-1.2.3.tar.gz

Extracting files from the downloaded package:


tar -xvzf zlib-1.2.3.tar.gz

Now, enter the directory where the package is extracted.


cd zlib-1.2.3

Configuring zlib Library:


./configure --prefix=/usr/local/zlib

Replace "/usr/local/zlib" above with the directory path where you want to copy the files and folders. Note: check for any error message.

Compiling zlib:

make

Note: check for any error message.

Installing zlib:

As root (for privileges on destination directory), run the following.

With sudo,


sudo make install

 

Link to comment
Share on other sites

Seems to work - tried the CMake line again and got this :-

gina@Mint-Desktop ~/libindi/zlib-1.2.11 $ sudo cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug .
-- The C compiler identification is GNU 5.4.1
-- 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
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - done
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gina/libindi/zlib-1.2.11
gina@Mint-Desktop ~/libindi/zlib-1.2.11 $ 

Ooops - just noticed that I'm still in the zlib-1.2.11 directory.  I'll drop one and try again...

Link to comment
Share on other sites

Yes, that workedThis is the last part of the results.

Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/lib/libz.so.1.2.11
-- Installing: /usr/lib/libz.so.1
-- Installing: /usr/lib/libz.so
-- Installing: /usr/lib/libz.a
-- Installing: /usr/include/zconf.h
-- Installing: /usr/include/zlib.h
-- Installing: /usr/share/man/man3/zlib.3
-- Installing: /usr/share/pkgconfig/zlib.pc
gina@Mint-Desktop ~/libindi/zlib-1.2.11 $ 

 

Link to comment
Share on other sites

Now ZLIB is installed the libindi should make and install.

gina@Mint-Desktop ~/libindi $ ls
AUTHORS   ChangeLog       CMakeLists.txt  COPYING.BSD   COPYRIGHT  drivers.xml  examples  indiapi.h     indidriver.h      INSTALL           LICENSE  TODO         zlib-1.2.11.tar.gz
base64.c  CMakeCache.txt  cmake_modules   COPYING.GPL   Doxyfile   eventloop.c  fq.c      indidevapi.h  indidrivermain.c  libindi.pc.cmake  NEWS     tools
base64.h  CMakeFiles      config.h.cmake  COPYING.LGPL  drivers    eventloop.h  fq.h      indidriver.c  indiserver.c      libs              README   zlib-1.2.11
gina@Mint-Desktop ~/libindi $ 

Now to try it :-

cd libindi
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug .
sudo make install

 

Link to comment
Share on other sites

"I don't believe it!!!"

gina@Mint-Desktop ~/libindi $ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug .
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.11") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Found libusb-1.0:
--  - Includes: /usr/include/libusb-1.0
--  - Libraries: usb-1.0
-- Performing Test ERROR_NAME_COMPILE
-- Performing Test ERROR_NAME_COMPILE - Success
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindCURL.cmake:61 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:43 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/gina/libindi/CMakeFiles/CMakeOutput.log".
See also "/home/gina/libindi/CMakeFiles/CMakeError.log".
gina@Mint-Desktop ~/libindi $ 

Another library missing...  CURL :(  I wonder how many more there are of them :eek:

Link to comment
Share on other sites

Tried installing CURL and it said it was already the latest version.

gina@Mint-Desktop ~/libindi $ sudo apt-get install curl libc6 libcurl3 zlib1g
Reading package lists... Done
Building dependency tree       
Reading state information... Done
zlib1g is already the newest version (1:1.2.8.dfsg-2ubuntu4).
curl is already the newest version (7.47.0-1ubuntu2.2).
libc6 is already the newest version (2.23-0ubuntu5).
libcurl3 is already the newest version (7.47.0-1ubuntu2.2).
libcurl3 set to manually installed.
0 to upgrade, 0 to newly install, 0 to remove and 1 not to upgrade.
gina@Mint-Desktop ~/libindi $ 

 

Link to comment
Share on other sites

Not entirely sure which destructions you’re following - anything referencing subversion I always presume is out of date as it’s a horrendous system versus modern day version control systems...

The current libindi source link from indilib.org points to https://github.com/indilib/indi and installation destructions etc are all on the frontpage there. To summarise the bits you need to do:

$ sudo apt-get update

$ sudo apt-get install libnova-dev libcfitsio3-dev libusb-1.0-0-dev zlib1g-dev libgsl0-dev build-essential cmake git libjpeg-dev libcurl4-gnutls-dev

$ mkdir ~/Projects 

$ cd ~/Projects 

$ git clone https://github.com/indilib/indi.git 

$ mkdir -p build/libindi 

$ cd build/libindi 

$ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi/libindi 

$ sudo make install 


To update the libindi source code in the future, just go to the indi git directory (e.g. ~/Projects/indi) and type git pull. After the code is updated, go to the build/libindi directory and run sudo make install.

Source: http://indilib.org/forum/general/210-howto-building-latest-libindi-ekos.html

And despite the top of that thread saying it won’t build on RaspberryPi and that those destructions are only for desktop linux, I just step-by-stepped through only the quoted portion above and it's worked fine for me on Jessie Lite on my Pi3 over SSH.

( The actual source code ends up in ~/Projects/indi/libindi )

Link to comment
Share on other sites

Got a warming from cmake but everything following seemed to work fine and installed stacks of stuff :)

CMake Warning at CMakeLists.txt:80 (FIND_PACKAGE):
  By not providing "FindQt5Network.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "Qt5Network", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5Network" with
  any of the following names:

    Qt5NetworkConfig.cmake
    qt5network-config.cmake

  Add the installation prefix of "Qt5Network" to CMAKE_PREFIX_PATH or set
  "Qt5Network_DIR" to a directory containing one of the above files.  If
  "Qt5Network" provides a separate development package or SDK, be sure it has
  been installed.

 

Link to comment
Share on other sites

Been running the tutorials one, two and three and testing in KStars and they all work :)  Tutorials two and three weren't correctly written because the Options and other tabs still show even when Disconnected which they shouldn't.  Perhaps the idea is to let the developer alter the source code to delete the controls if the device is disconnected - I've seen how that works and I think I could edit the .cpp file as required.  It would be a good exercise.

Anyway, this shows that I can edit the examples or ready made drivers, or write my own and test them all on the Linux Mint desktop, which is what I wanted to do.  When I have produced the drivers I want I can install them into the RPi.

Things are looking up :)

Link to comment
Share on other sites

I know I can edit .cpp files to provide the GUI controls I want but I though using a skeleton file seems an interesting alternative.  This is in tutorial_four and I did look at it before compiling and running the tutorial but now the skeleton file seems to have disappeared.  I thought the EXPORT command probably moved it and that it would appear in the /usr/share/indi directory as described in the readme file for the tutorials but it isn't there.  I've used both the GUI and terminal to try to find it.

gina@Mint-Desktop ~/Projects/build/libindi/examples/tutorial_four $ cat /usr/share/indi/tutorial_four_sk.xml
cat: /usr/share/indi/tutorial_four_sk.xml: No such file or directory

Here's the appropriate section of the tutorial readme file :-

Quote

For tutorial four, a skeleton file needs to be specified first. The tutorial skeleton file is located under examples/tutorial_four/tutorial_four_sk.xml
Let's assume for this example that the full path to libindi sources is this: /home/jasem/indi/libindi,
and full path to libindi build directory is this: /home/jasem/build/libindi

Open a console and go to the build directory then type:
$ cd examples/tutorial_four
$ export INDISKEL=/home/jasem/indi/libindi/examples/tutorial_four/tutorial_four_sk.xml
$ indiserver -v -p 8000 ./tutorial_four

Now Tutorial Four shall run and load the Skeleton file. Usually skeleton files for drivers are stored under /usr/share/indi/ and end with _sk.xml

Also from the tutorial_four simpleskeleton.cpp file :-

/**************************************************************************************
** Initialize all properties & set default values.
**************************************************************************************/
bool SimpleSkeleton::initProperties()
{
    DefaultDevice::initProperties();

    // This is the default driver skeleton file location
    // Convention is: drivername_sk_xml
    // Default location is /usr/share/indi
    const char *skelFileName = "/usr/share/indi/tutorial_four_sk.xml";
    struct stat st;

I presume that tutorial_four will no longer work but I'll try it...

Link to comment
Share on other sites

As expected...

gina@Mint-Desktop ~/Projects/build/libindi/examples/tutorial_four $ indiserver -v -p 8000 ./tutorial_four
2017-02-25T12:27:56: startup: indiserver -v -p 8000 ./tutorial_four 
2017-02-25T12:27:56: Driver ./tutorial_four: pid=6797 rfd=3 wfd=6 efd=7
2017-02-25T12:27:56: listening to port 8000 on fd 4
2017-02-25T12:27:56: Driver ./tutorial_four: Using INDISKEL /home/gina/Projects/build/libindi/examples/tutorial_four/tutorial_four_sk.xml
2017-02-25T12:27:56: Driver ./tutorial_four: Unable to build skeleton. Error loading file /home/gina/Projects/build/libindi/examples/tutorial_four/tutorial_four_sk.xml: No such file or directory
2017-02-25T12:27:56: Driver ./tutorial_four: Property #0: CONNECTION
2017-02-25T12:27:56: Driver ./tutorial_four: Property #1: DRIVER_INFO
2017-02-25T12:27:56: Driver ./tutorial_four: Property #2: DEBUG
2017-02-25T12:27:56: Driver ./tutorial_four: Property #3: SIMULATION
2017-02-25T12:27:56: Driver ./tutorial_four: Property #4: CONFIG_PROCESS

However, the driver has already been compiled and installed the first time I ran this tutorial so actually works. 

All I can think of is that once the driver has been compiled and installed the skeleton file is no longer needed and can be deleted but this applies to lots of other files which are still kept.  I expected the skeleton file to be kept even if in another place and I could edit it and recompile the driver so never thought to back it up.  I guess I can download it again but this seems very strange!!!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.