Welcome, Guest
Username: Password: Remember me
20 Aug 2017
INDI development team is happy to announce the release of INDI Library v1.5.0. This new exciting release builds on the maturity of INDI Library and comes with many new supported devices and fixes for existing drivers.
Read More...

TOPIC: Stepper focusser directly from Raspberry

Stepper focusser directly from Raspberry 2 weeks 11 hours ago #18346

Dear Kaczorek,
Today I tried to compile your astroberry driver again but I get errors from make regarding
pi@rp ~/build/astroberry-svn/trunk/build $ LANG=en make -j4
[ 50%] Building CXX object CMakeFiles/indi_rpifocus.dir/rpi_focus.o
[ 50%] Building CXX object CMakeFiles/indi_rpibrd.dir/rpi_brd.o
/home/pi/build/astroberry-svn/trunk/rpi_brd.cpp: In member function 'virtual bool IndiRpibrd::ISNewSwitch(const char*, const char*, ISState*, char**, int)':
/home/pi/build/astroberry-svn/trunk/rpi_brd.cpp:306:37: error: 'strcmp' was not declared in this scope
     if (!strcmp(dev, getDeviceName()))
                                     ^
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp: In member function 'virtual bool FocusRpi::initProperties()':
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:213:19: error: invalid use of incomplete type 'class INDI::Controller'
         controller->mapController("Focus In", "Focus In", INDI::Controller::CONTROLLER_BUTTON, "BUTTON_1");
                   ^
In file included from /usr/include/libindi/basedevice.h:21:0,
                 from /usr/include/libindi/defaultdevice.h:21,
                 from /usr/include/libindi/indifocuser.h:21,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.h:22,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:23:
/usr/include/libindi/indibase.h:65:7: error: forward declaration of 'class INDI::Controller'
 class Controller;
       ^
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:213:59: error: incomplete type 'INDI::Controller' used in nested name specifier
         controller->mapController("Focus In", "Focus In", INDI::Controller::CONTROLLER_BUTTON, "BUTTON_1");
                                                           ^
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:214:19: error: invalid use of incomplete type 'class INDI::Controller'
         controller->mapController("Focus Out", "Focus Out", INDI::Controller::CONTROLLER_BUTTON, "BUTTON_2");
                   ^
In file included from /usr/include/libindi/basedevice.h:21:0,
                 from /usr/include/libindi/defaultdevice.h:21,
                 from /usr/include/libindi/indifocuser.h:21,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.h:22,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:23:
/usr/include/libindi/indibase.h:65:7: error: forward declaration of 'class INDI::Controller'
 class Controller;
       ^
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:214:61: error: incomplete type 'INDI::Controller' used in nested name specifier
         controller->mapController("Focus Out", "Focus Out", INDI::Controller::CONTROLLER_BUTTON, "BUTTON_2");
                                                             ^
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:215:19: error: invalid use of incomplete type 'class INDI::Controller'
         controller->mapController("Abort Focus", "Abort Focus", INDI::Controller::CONTROLLER_BUTTON, "BUTTON_3");
In file included from /usr/include/libindi/basedevice.h:21:0,
                 from /usr/include/libindi/defaultdevice.h:21,
                 from /usr/include/libindi/indifocuser.h:21,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.h:22,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:23:
/usr/include/libindi/indibase.h:65:7: error: forward declaration of 'class INDI::Controller'
 class Controller;
       ^
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:215:65: error: incomplete type 'INDI::Controller' used in nested name specifier
         controller->mapController("Abort Focus", "Abort Focus", INDI::Controller::CONTROLLER_BUTTON, "BUTTON_3");
                                                                 ^
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:216:19: error: invalid use of incomplete type 'class INDI::Controller'
         controller->initProperties();
                   ^
In file included from /usr/include/libindi/basedevice.h:21:0,
                 from /usr/include/libindi/defaultdevice.h:21,
                 from /usr/include/libindi/indifocuser.h:21,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.h:22,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:23:
/usr/include/libindi/indibase.h:65:7: error: forward declaration of 'class INDI::Controller'
 class Controller;
       ^
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp: In member function 'virtual bool FocusRpi::ISNewNumber(const char*, const char*, double*, char**, int)':
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:260:31: error: 'strcmp' was not declared in this scope
  if(strcmp(dev,getDeviceName())==0)
                               ^
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp: In member function 'virtual bool FocusRpi::ISNewSwitch(const char*, const char*, ISState*, char**, int)':
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:327:37: error: 'strcmp' was not declared in this scope
     if (!strcmp(dev, getDeviceName()))
                                     ^
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp: In member function 'virtual bool FocusRpi::ISSnoopDevice(XMLEle*)':
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:417:15: error: invalid use of incomplete type 'class INDI::Controller'
     controller->ISSnoopDevice(root);
               ^
In file included from /usr/include/libindi/basedevice.h:21:0,
                 from /usr/include/libindi/defaultdevice.h:21,
                 from /usr/include/libindi/indifocuser.h:21,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.h:22,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:23:
/usr/include/libindi/indibase.h:65:7: error: forward declaration of 'class INDI::Controller'
 class Controller;
       ^
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp: In member function 'virtual bool FocusRpi::saveConfigItems(FILE*)':
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:432:15: error: invalid use of incomplete type 'class INDI::Controller'
     controller->saveConfigItems(fp);
               ^
In file included from /usr/include/libindi/basedevice.h:21:0,
                 from /usr/include/libindi/defaultdevice.h:21,
                 from /usr/include/libindi/indifocuser.h:21,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.h:22,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:23:
/usr/include/libindi/indibase.h:65:7: error: forward declaration of 'class INDI::Controller'
 class Controller;
       ^
CMakeFiles/indi_rpibrd.dir/build.make:62: recipe for target 'CMakeFiles/indi_rpibrd.dir/rpi_brd.o' failed
make[2]: *** [CMakeFiles/indi_rpibrd.dir/rpi_brd.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/indi_rpibrd.dir/all' failed
make[1]: *** [CMakeFiles/indi_rpibrd.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/indi_rpifocus.dir/build.make:62: recipe for target 'CMakeFiles/indi_rpifocus.dir/rpi_focus.o' failed
make[2]: *** [CMakeFiles/indi_rpifocus.dir/rpi_focus.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/indi_rpifocus.dir/all' failed
make[1]: *** [CMakeFiles/indi_rpifocus.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

cmake run fine:
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
-- The CXX compiler identification is GNU 4.9.3
-- The C compiler identification is GNU 4.9.3
-- 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 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
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28") 
-- Checking for module 'libindi'
--   Found libindi, version 1.5.0
-- Found INDI: /usr/include/libindi (found version "1.5.0") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/build/astroberry-svn/trunk/build

Do you have an idea whats wrong this time because I dont get behind it. Maybe there was again a change in indilib :dry: that I just recently updated

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

--= human, without Windows™ =--
pls excuse my bad english! :)
Last Edit: by pauledd.

Stepper focusser directly from Raspberry 2 weeks 11 hours ago #18347

I just saw my gcc on the raspberry is quite old, maybe thats the cause of the problem. I will update it to a more recent version and see if that helps.

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

--= human, without Windows™ =--
pls excuse my bad english! :)

Stepper focusser directly from Raspberry 1 week 6 days ago #18369

ok, after 8 hours compiling gcc from 4.9.3 to 5.4.0 on the raspberry, switching to the new gcc and recompiling indilib I still get the errors.
I read somewhere the error
/home/pi/build/astroberry-svn/trunk/rpi_brd.cpp:306:37: error: 'strcmp' was not declared in this scope
     if (!strcmp(dev, getDeviceName()))
can be solved by adding
#include <cstring>
to the file. Ok , that error is gone.

Now I still get those strange errors regarding
/home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:213:19: error: invalid use of incomplete type 'class INDI::Controller'
         controller->mapController("Focus In", "Focus In", INDI::Controller::CONTROLLER_BUTTON, "BUTTON_1");
                   ^
In file included from /usr/include/libindi/basedevice.h:21:0,
                 from /usr/include/libindi/defaultdevice.h:21,
                 from /usr/include/libindi/indifocuser.h:21,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.h:22,
                 from /home/pi/build/astroberry-svn/trunk/rpi_focus.cpp:23:
/usr/include/libindi/indibase.h:65:7: note: forward declaration of 'class INDI::Controller'
 class Controller;
...

The strange thing is the same code compiles fine on my desktop pc with the same gcc version 5.4.0

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

--= human, without Windows™ =--
pls excuse my bad english! :)
Last Edit: by pauledd.

Stepper focusser directly from Raspberry 1 week 6 days ago #18370

Ok I looked through the code of rpi_focus.cpp and compared it with the one (indifocuser.cpp) as found in the official indi git repo.
From out of the blue I added another
#include "indicontroller.h"
#include <cstring>
to it and now it compiled fine. As always I have no clue if this was the right way to do it. Now testing if the focuser is really doing what it shall do...
The following user(s) said Thank You: Kaczorek

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

--= human, without Windows™ =--
pls excuse my bad english! :)

Stepper focusser directly from Raspberry 1 week 6 days ago #18372

Nice, my raspberry sdcard just crashed, must be one of those days :angry: testing delayed until I found a solution.

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

--= human, without Windows™ =--
pls excuse my bad english! :)

Stepper focusser directly from Raspberry 1 week 6 days ago #18376

I'm glad it worked fine. I will take look at the code and make sure that it doesn't need any updates.

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

Time to create page: 0.148 seconds

Login

3rd Party

Choose from the numerous 3rd party INDI drivers to suit your needs!

Got Problem?

Check out the FAQ, the forum, and the bug tracking system to resolve any issues you might have!
You can also subscribe to INDI newsletter and development mailing lists to get the latest updates on INDI!

Gallery

Replica

Why INDI

Replica