×

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

Bi-monthly release with minor bug fixes and improvements

Raspberry PI - Installing Python Binding for INDI

  • Posts: 10
  • Thank you received: 1
I've been attempting to install the Python binding for INDI on my Raspberry Pi 3, following the instructions here: indilib.org/develop/tutorials/151-time-l...ith-indi-python.html . When I get to using the make command, I keep getting the same error (below):
pi@raspberrypi:~/libindipython$ make
[ 25%] Swig source
Language subdirectory: python
Search paths:
   ./
   /usr/include/python2.7/
   /usr/include/libindi/
   /usr/include/
   /home/pi/swig-indi-python/
   ./swig_lib/python/
   /usr/share/swig2.0/python/
   ./swig_lib/
   /usr/share/swig2.0/
Preprocessing...
Starting language-specific parse...
/usr/include/libindi/baseclient.h:32: Warning 322: Redundant redeclaration of 'MAXRBUF',
/usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
/usr/include/libindi/basedevice.h:33: Warning 322: Redundant redeclaration of 'MAXRBUF',
/usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
Processing types...
C++ analysis...
/usr/include/libindi/baseclient.h:55: Warning 403: Class 'INDI::BaseClient' might be abstract, no constructors generated,
/usr/include/libindi/indibase.h:79: Warning 403: Method INDI::BaseMediator::newDevice(INDI::BaseDevice *) might not be implemented.
Generating wrappers...
Scanning dependencies of target _PyIndi
[ 25%] Swig source
Language subdirectory: python
Search paths:
   ./
   /usr/include/python2.7/
   /usr/include/libindi/
   /usr/include/
   /home/pi/swig-indi-python/
   ./swig_lib/python/
   /usr/share/swig2.0/python/
   ./swig_lib/
   /usr/share/swig2.0/
Preprocessing...
Starting language-specific parse...
/usr/include/libindi/baseclient.h:32: Warning 322: Redundant redeclaration of 'MAXRBUF',
/usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
/usr/include/libindi/basedevice.h:33: Warning 322: Redundant redeclaration of 'MAXRBUF',
/usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
Processing types...
C++ analysis...
/usr/include/libindi/baseclient.h:55: Warning 403: Class 'INDI::BaseClient' might be abstract, no constructors generated,
/usr/include/libindi/indibase.h:79: Warning 403: Method INDI::BaseMediator::newDevice(INDI::BaseDevice *) might not be implemented.
Generating wrappers...
[ 50%] Building CXX object CMakeFiles/_PyIndi.dir/indiclientpythonPYTHON_wrap.cxx.o
Linking CXX shared module _PyIndi.so
[ 50%] Built target _PyIndi
[ 75%] Swig source
Language subdirectory: python
Search paths:
   ./
   /usr/include/python2.7/
   /usr/include/libindi/
   /usr/include/
   /home/pi/swig-indi-python/
   ./swig_lib/python/
   /usr/share/swig2.0/python/
   ./swig_lib/
   /usr/share/swig2.0/
Preprocessing...
/home/pi/swig-indi-python/indiserverpython.i:52: Error: Unable to find 'libindiserver.h'
CMakeFiles/_PyIndiServer.dir/build.make:53: recipe for target 'indiserverpythonPYTHON_wrap.c' failed
make[2]: *** [indiserverpythonPYTHON_wrap.c] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/_PyIndiServer.dir/all' failed
make[1]: *** [CMakeFiles/_PyIndiServer.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

I've managed to fix this by copying libindiserver.h and fq.h out of the libindiserver directory in swig-indi-python. This gets rid of the above error, but generates a new one:
pi@raspberrypi:~/libindipython$ make
[ 25%] Swig source
Language subdirectory: python
Search paths:
   ./
   /usr/include/python2.7/
   /usr/include/libindi/
   /usr/include/
   /home/pi/swig-indi-python/
   ./swig_lib/python/
   /usr/share/swig2.0/python/
   ./swig_lib/
   /usr/share/swig2.0/
Preprocessing...
Starting language-specific parse...
/usr/include/libindi/baseclient.h:32: Warning 322: Redundant redeclaration of 'MAXRBUF',
/usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
/usr/include/libindi/basedevice.h:33: Warning 322: Redundant redeclaration of 'MAXRBUF',
/usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
Processing types...
C++ analysis...
/usr/include/libindi/baseclient.h:55: Warning 403: Class 'INDI::BaseClient' might be abstract, no constructors generated,
/usr/include/libindi/indibase.h:79: Warning 403: Method INDI::BaseMediator::newDevice(INDI::BaseDevice *) might not be implemented.
Generating wrappers...
[ 50%] Building CXX object CMakeFiles/_PyIndi.dir/indiclientpythonPYTHON_wrap.cxx.o
Linking CXX shared module _PyIndi.so
[ 50%] Built target _PyIndi
[ 75%] Swig source
Language subdirectory: python
Search paths:
   ./
   /usr/include/python2.7/
   /usr/include/libindi/
   /usr/include/
   /home/pi/swig-indi-python/
   ./swig_lib/python/
   /usr/share/swig2.0/python/
   ./swig_lib/
   /usr/share/swig2.0/
Preprocessing...
Starting language-specific parse...
Processing types...
C++ analysis...
Generating wrappers...
/home/pi/swig-indi-python/libindiserver.h:47: Warning 451: Setting a const char * variable may leak memory.
/home/pi/swig-indi-python/libindiserver.h:64: Warning 454: Setting a pointer/reference variable may leak memory.
Scanning dependencies of target _PyIndiServer
[ 75%] Swig source
Language subdirectory: python
Search paths:
   ./
   /usr/include/python2.7/
   /usr/include/libindi/
   /usr/include/
   /home/pi/swig-indi-python/
   ./swig_lib/python/
   /usr/share/swig2.0/python/
   ./swig_lib/
   /usr/share/swig2.0/
Preprocessing...
Starting language-specific parse...
Processing types...
C++ analysis...
Generating wrappers...
/home/pi/swig-indi-python/libindiserver.h:47: Warning 451: Setting a const char * variable may leak memory.
/home/pi/swig-indi-python/libindiserver.h:64: Warning 454: Setting a pointer/reference variable may leak memory.
[100%] Building C object CMakeFiles/_PyIndiServer.dir/indiserverpythonPYTHON_wrap.c.o
/home/pi/libindipython/indiserverpythonPYTHON_wrap.c: In function ‘Swig_var_clinfo_get’:
/home/pi/libindipython/indiserverpythonPYTHON_wrap.c:4933:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
     for(size_t i = 0; i < nclinfo; ++i)
     ^
/home/pi/libindipython/indiserverpythonPYTHON_wrap.c:4933:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
/home/pi/libindipython/indiserverpythonPYTHON_wrap.c: In function ‘Swig_var_dvrinfo_set’:
/home/pi/libindipython/indiserverpythonPYTHON_wrap.c:6136:7: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
       for (int i = 0; i < size; ++i) {
       ^
/home/pi/libindipython/indiserverpythonPYTHON_wrap.c: In function ‘Swig_var_dvrinfo_get’:
/home/pi/libindipython/indiserverpythonPYTHON_wrap.c:6161:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
     for(size_t i = 0; i < ndvrinfo; ++i)
     ^
CMakeFiles/_PyIndiServer.dir/build.make:62: recipe for target 'CMakeFiles/_PyIndiServer.dir/indiserverpythonPYTHON_wrap.c.o' failed
make[2]: *** [CMakeFiles/_PyIndiServer.dir/indiserverpythonPYTHON_wrap.c.o] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/_PyIndiServer.dir/all' failed
make[1]: *** [CMakeFiles/_PyIndiServer.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

I'm at a loss here. Any help would be greatly appreciated :cheer:
7 years 9 months ago #8993

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

  • Posts: 226
  • Thank you received: 88
Hi Mathieu,
The link you have used is no longer valid, it is still there for testing purpose.
The pyindi-client should be moved to pypi, for the moment I only put it on testpypi .
You may follow the download method (and then simply run python setup.py install) or try the pip way (I did not test it yet) specifying the testpyipi index site on the command line
pip install -i https://testpypi.python.org/pypi pyindi-client
Your logs show that compilation of the client is error free (only warnings) and that the above installation should succeed if my pypi setup is correct. May you confirm that last point ?
Thanks,
Jean-Luc.
7 years 9 months ago #8995

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

  • Posts: 10
  • Thank you received: 1
Hi Jean-Luc,

I actually stumbled on the pypi alternative shortly after posting this. I haven't had the chance to try it out yet, so I'll keep you posted.

Thanks,

Mathieu

Edit:

Installing through pip doesn't appear to have worked:
pip install -i https://testpypi.python.org/pypi pyindi-client
Downloading/unpacking pyindi-client
  Downloading pyindi-client-0.1.0.tar.gz
  Running setup.py (path:/tmp/pip-build-JjLCmF/pyindi-client/setup.py) egg_info for package pyindi-client
 
    file PyIndi.py (for module PyIndi) not found
Installing collected packages: pyindi-client
  Running setup.py install for pyindi-client
    building '_PyIndi' extension
    swigging indiclientpython.i to indiclientpython_wrap.cpp
    swig -python -v -Wall -c++ -threads -I/usr/include -I/usr/include/libindi -o indiclientpython_wrap.cpp indiclientpython.i
    Language subdirectory: python
    Search paths:
       ./
       /usr/include/
       /usr/include/libindi/
       ./swig_lib/python/
       /usr/share/swig2.0/python/
       ./swig_lib/
       /usr/share/swig2.0/
    Preprocessing...
    Starting language-specific parse...
    /usr/include/libindi/baseclient.h:32: Warning 322: Redundant redeclaration of 'MAXRBUF',
    /usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
    /usr/include/libindi/basedevice.h:33: Warning 322: Redundant redeclaration of 'MAXRBUF',
    /usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
    /usr/include/libindi/baseclient.h:55: Warning 403: Class 'INDI::BaseClient' might be abstract, no constructors generated,
    /usr/include/libindi/indibase.h:79: Warning 403: Method INDI::BaseMediator::newDevice(INDI::BaseDevice *) might not be implemented.
    Processing types...
    C++ analysis...
    Generating wrappers...
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include -I/usr/include/libindi -I/usr/include/python2.7 -c indiclientpython_wrap.cpp -o build/temp.linux-armv7l-2.7/indiclientpython_wrap.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/indiclientpython_wrap.o /usr/lib/libindiclient.a -lindi -o build/lib.linux-armv7l-2.7/_PyIndi.so
    c++: error: /usr/lib/libindiclient.a: No such file or directory
    error: command 'c++' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-JjLCmF/pyindi-client/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MTzXBQ-record/install-record.txt --single-version-externally-managed --compile:
    running install
 
running build_ext
 
building '_PyIndi' extension
 
swigging indiclientpython.i to indiclientpython_wrap.cpp
 
swig -python -v -Wall -c++ -threads -I/usr/include -I/usr/include/libindi -o indiclientpython_wrap.cpp indiclientpython.i
 
Language subdirectory: python
 
Search paths:
 
   ./
 
   /usr/include/
 
   /usr/include/libindi/
 
   ./swig_lib/python/
 
   /usr/share/swig2.0/python/
 
   ./swig_lib/
 
   /usr/share/swig2.0/
 
Preprocessing...
 
Starting language-specific parse...
 
/usr/include/libindi/baseclient.h:32: Warning 322: Redundant redeclaration of 'MAXRBUF',
 
/usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
 
/usr/include/libindi/basedevice.h:33: Warning 322: Redundant redeclaration of 'MAXRBUF',
 
/usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
 
/usr/include/libindi/baseclient.h:55: Warning 403: Class 'INDI::BaseClient' might be abstract, no constructors generated,
 
/usr/include/libindi/indibase.h:79: Warning 403: Method INDI::BaseMediator::newDevice(INDI::BaseDevice *) might not be implemented.
 
Processing types...
 
C++ analysis...
 
Generating wrappers...
 
creating build
 
creating build/temp.linux-armv7l-2.7
 
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include -I/usr/include/libindi -I/usr/include/python2.7 -c indiclientpython_wrap.cpp -o build/temp.linux-armv7l-2.7/indiclientpython_wrap.o
 
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
 
creating build/lib.linux-armv7l-2.7
 
c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/indiclientpython_wrap.o /usr/lib/libindiclient.a -lindi -o build/lib.linux-armv7l-2.7/_PyIndi.so
 
c++: error: /usr/lib/libindiclient.a: No such file or directory
 
error: command 'c++' failed with exit status 1
 
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-JjLCmF/pyindi-client/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MTzXBQ-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-JjLCmF/pyindi-client
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 248, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 42: ordinal not in range(128)
The following user(s) said Thank You: Jean-Luc
Last edit: 7 years 9 months ago by Mathieu Corbett.
7 years 9 months ago #8998

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

  • Posts: 226
  • Thank you received: 88
Hi Mathieu,
I just tested the pip method on a rpi2/archlinux and that worked.
Now I have forked and cloned the new indilib repo on github and recompiled all the stuff on my desktop. As this is a 64bit architecture, every libindi libs are now put in the /usr/lib64 directory.
So you may change the extra_objects field in the setup.py file before running it.
I will manage to change that on the pyindi-client repo and test again.

Jean-Luc.
The following user(s) said Thank You: Mathieu Corbett
7 years 9 months ago #9008

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

  • Posts: 10
  • Thank you received: 1
Hi Jean-Luc,

Thank you for taking the time to do this.

What should I change the extra_objects field to? Also, Raspbian on the RPi does not have a lib64 folder, unless I'm looking in the wrong place :S

-Mathieu
7 years 9 months ago #9013

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

  • Posts: 226
  • Thank you received: 88
Have you tried with
dpkg -L libindi
dpkg -L libindidev
here you should find the libindiclient.a file, and its installation directory. Debian uses lib/<multiarch-tuple> directory names.
You may also try with locate
locate libindiclient.a
7 years 9 months ago #9020

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

Time to create page: 1.071 seconds