Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Astro Projects

  • entries
    16
  • comments
    1,180
  • views
    6,314

Adding 3rd Party INDI Drivers to RPi for Astro Imaging


Gina

4,468 views

This blog describes Installing 3rd Party Drivers into a Raspberry Pi having installed Ubuntu MATE and followed the instructions to run the AstroPi3 script to install INDI and other astro related software. 

SSH has been enabled so that now the RPi can be accessed remotely from Terminal.  eg. ssh gina@rpi where gina is my user name and rpi is the computer name as set up during the Ubuntu MATE installation.

This set up process is detailed in my blog :- Setting up a Raspberry Pi for Astro Imaging and Control - Updated Feb 2020 for RPi 3B & RPi 3B+

  • Like 1

54 Comments


Recommended Comments



I shall describe installing the Astroberry drivers.  The package contains drivers for a Focuser and Relay Board.  The focuser provides remote focussing for telescopes and camera lenses that is used from Ekos in KStars for remote focussing and even auto-focus.  This works in conjunction with hardware attached to the RPi to control a stepper motor. 

The Board driver is designed to control 4 relays for whatever purpose may be required.

Link to comment

The whole process is well described in Radek Kaczorek's GitHub page astroberry-diy   (same link as above).  I have used these drivers both as published and with modifications to suit my special needs eg. using the Board driver to control my roll-off-roof.  I'm happy to answer and questions but also Radek (RadekK) is a member on here and very helpful.

Link to comment

Oh dear!!  Just tried this with my second imaging rig RPi and get this on running make :-

gina@img2:~/astroberry-diy/build$ make
Scanning dependencies of target indi_rpifocus
[ 25%] Building CXX object CMakeFiles/indi_rpifocus.dir/rpi_focus.o
/home/gina/astroberry-diy/rpi_focus.cpp:26:10: fatal error: wiringPi.h: No such file or directory
 #include <wiringPi.h>
          ^~~~~~~~~~~~
compilation terminated.
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:129: recipe for target 'all' failed
make: *** [all] Error 2

From running the command that includes installing wiring.pi I get

wiringpi is already the newest version (2.50-1ubuntu1).

@RadekK can you help, please?

I should add that I ran the following commands, one at a time.

sudo apt-get install cmake indi-full libindi-dev wiringpi
git clone https://github.com/rkaczorek/astroberry-diy.git
cd astroberry-diy
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make

 

Edited by Gina
Link to comment

Since the problem is with wiringPi I could probably get round this problem by using an earlier version of the Astroberry files - I have copies.  I'll look into that later.  Meanwhile, I'm wondering why the change to wiringPi, may be a good reason...  Mind you I've had the earlier versions running without any problem for a few years.  I shall be interested in your views @RadekK.

Edited by Gina
Link to comment

Hi @Gina

Remove wiringpi installed with apt and use the latest version from the author's site http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/

The driver used to support low level library designed for raspberry pi only (bcm2835) and wiringpi. The latest version uses wiringpi only as it makes it more generic - now it can be used on other devices than raspberry pi and is not limited to a specific version of raspberry pi.

Edited by RadekK
Link to comment

Thank you @RadekK.  That makes good sense.  I did try the autkor's site, drogon.net, but it was down temporarily.

Link to comment
19 minutes ago, Gina said:

I did try the autkor's site, drogon.net

Wow.  There's a blast from the past.  Back in the day Gordon Henderson and I used to hang around some of the same mailing lists (where "the day" was twenty years ago or more).

James

  • Like 1
Link to comment

Gordon's wiringPi git is still unavailable

Quote

git.drogon.net is temporarily unavailable. Please look for alternatives for wiringPi, etc. -Gordon

so I shall have to resort to the bcm2835 setup as use in earlier versions of Astroberry as I have no idea when it will be available again.  I need to edit the C++ code for my ROR control but I was hoping to use the Astroberry code unaltered for the focuser for my second imager.  Oh well, these things are sent to try us!!

Link to comment

Hmmm... Not as simple as I thought.  Seems there are other changes apart from replacing the bcm2835 library with the wiringPi library.

I think I shall need to take the micro SD out of one of my working RPi systems and copy all the Astroberry files to my desktop and then to the new SD cards.

Link to comment

Must be suffering from a dense spell!!

gina@img2:~$ sudo dpkg -i https://project-downloads.drogon.net/wiringpi-latest.deb
[sudo] password for gina: 
dpkg: error: cannot access archive 'https://project-downloads.drogon.net/wiringpi-latest.deb': No such file or directory
gina@img2:~$ 

 

Link to comment

Try:

$ wget https://project-downloads.drogon.net/wiringpi-latest.deb
$ sudo dpkg -i ./wiringpi-latest.deb

?

James

Link to comment

Connected human interface devices and ran the RPi in GUI mode.  Having removed to old wiringPi I downloaded and installed the new one from https://project-downloads.drogon.net/wiringpi-latest.deb.  The library appeared to install fine.  Next I closed down, powered up and accessed via SSH from the desktop.  I deleted the astroberry-diy directory and all it's contents to give me a clean start then entered these commands one at a time

git clone https://github.com/rkaczorek/astroberry-diy.git
cd astroberry-diy
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make

I thought it would work now but it still failed as before.

gina@img2:~/astroberry-diy/build$ make
Scanning dependencies of target indi_rpifocus
[ 25%] Building CXX object CMakeFiles/indi_rpifocus.dir/rpi_focus.o
/home/gina/astroberry-diy/rpi_focus.cpp:26:10: fatal error: wiringPi.h: No such file or directory
 #include <wiringPi.h>
          ^~~~~~~~~~~~
compilation terminated.
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:129: recipe for target 'all' failed
make: *** [all] Error 2
gina@img2:~/astroberry-diy/build$ 

 

Link to comment

Hmmm...  Fixed the wiringPi error but getting others.

gina@img2:~/astroberry-diy/build$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gina/astroberry-diy/build
gina@img2:~/astroberry-diy/build$ make
[ 25%] Building CXX object CMakeFiles/indi_rpifocus.dir/rpi_focus.o
/home/gina/astroberry-diy/rpi_focus.cpp: In member function ‘virtual IPState FocusRpi::MoveFocuser(INDI::FocuserInterface::FocusDirection, int, int)’:
/home/gina/astroberry-diy/rpi_focus.cpp:488:55: warning: unused parameter ‘speed’ [-Wunused-parameter]
 IPState FocusRpi::MoveFocuser(FocusDirection dir, int speed, int duration)
                                                       ^~~~~
/home/gina/astroberry-diy/rpi_focus.cpp: In member function ‘virtual IPState FocusRpi::MoveAbsFocuser(int)’:
/home/gina/astroberry-diy/rpi_focus.cpp:581:21: warning: comparison with string literal results in unspecified behavior [-Waddress]
   if ( direction == "INWARD" )
                     ^~~~~~~~
/home/gina/astroberry-diy/rpi_focus.cpp:585:21: warning: comparison with string literal results in unspecified behavior [-Waddress]
   if ( direction == "OUTWARD" )
                     ^~~~~~~~~
/home/gina/astroberry-diy/rpi_focus.cpp: In member function ‘virtual int FocusRpi::regPosition(int)’:
/home/gina/astroberry-diy/rpi_focus.cpp:757:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
     else
     ^~~~
/home/gina/astroberry-diy/rpi_focus.cpp:761:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
  if (pos == -1)
  ^~
/home/gina/astroberry-diy/rpi_focus.cpp:770:9: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
   fgets (buf , 100, pFile);
   ~~~~~~^~~~~~~~~~~~~~~~~~
[ 50%] Linking CXX executable indi_rpifocus
/usr/lib/gcc/arm-linux-gnueabihf/7/../../../../lib/libwiringPi.so: undefined reference to `fcntl@GLIBC_2.28'
collect2: error: ld returned 1 exit status
CMakeFiles/indi_rpifocus.dir/build.make:96: recipe for target 'indi_rpifocus' failed
make[2]: *** [indi_rpifocus] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/indi_rpifocus.dir/all' failed
make[1]: *** [CMakeFiles/indi_rpifocus.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
gina@img2:~/astroberry-diy/build$ 

 

Link to comment

I think that means that you're not going to get anywhere unless you download the wiringpi source and build it yourself.  The existing one appears to contain references to functions in an incompatible release of glibc.

You may be able to ignore all of the other errors, which are only warnings anyhow, though it may be helpful if at least some of them are fixed.

James

Link to comment

I'll take a look at the code tomorrow.  I could also cut out the focuser section from the compiling list and see if the Astroberry Board compiles.  I don't want the focuser for my ROR remote control though I guess I could add a webcam to watch the imaging rig.

Link to comment
1 hour ago, JamesF said:

I think that means that you're not going to get anywhere unless you download the wiringpi source and build it yourself.  The existing one appears to contain references to functions in an incompatible release of glibc.

You may be able to ignore all of the other errors, which are only warnings anyhow, though it may be helpful if at least some of them are fixed.

James

But where are the source files for wiringPi?

Link to comment

Here's probably best:  https://github.com/WiringPi/WiringPi/releases

It looks as though Gordon is no longer developing WiringPi, so I imagine the github site will be the primary source now.

James

  • Thanks 1
Link to comment

At first I have been surprised by what @JamesF said but I have just read this http://wiringpi.com/wiringpi-deprecated/

So it looks like wiringPi will not be maintained anymore 😞 It's really bad news. However I fully understand Gordon. Maintaining a software is a nightmare nowadays. Few understand how much work it takes and how many nights one has to invest to keep things running for others for free.

Having said that I will have to move astroberry-diy back to BCM2835 library. It will take a while though so stay tuned.

Link to comment

Thank you @RadekK.  I used to write and maintain software so I know what you mean.  It's also why I really appreciate your efforts in this field.

Link to comment

I can see the problem with catering for different operating systems and a variety of SBCs and all the permutations that result.  ATM I am only interested in RPi 3 B and RPi 3 B+ though sometime in the future I can see wanting the RPi 4 to cater for faster imaging.

With wiringPi apparently broken I think my best option will be to take working versions from RPi 3 B and B+ and copy files to the new micro SD cards.

Link to comment

I thought just copying the astroberry-diy directory and all its contents from the working card to the new one would work but something was wrong with the bcm2835 library.  Maybe I should just clone the card and leave it at that.  I've found I can change the network name so that I can use both old and new at the same time.  That would give me a second imaging rig.  I'm rather surprised that just copying all the Astroberry files across and recompiling didn't work.  Must be something in the rest of the system - different version of something perhaps.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.