Installing Source on Arch - BenningtonCS/Telescope-2014 GitHub Wiki
These intstructions were made to install the srtver3 code from MIT on a clean install of Archbang Linux. However, these instructions should work for any up to date release of Arch.
The MIT Haystack Observatory SRT website includes the manuals, documentation, and program code. The code base we are looking at, SRT Source Code ver 3, can be found here.
Getting the Source Code
From the website, linked above, or the download link provided, download the srtnver3 source files from the MIT Haystack website. Once the download is complete, the gzipped tarball should be in your Downloads directory, ~/Downloads/newsrtsource_ver3.tar.gz.
$ cd Downloads
$ tar xzvf newsrtsource_ver4.tar.gz
Getting Project Dependencies
From a clean install of Archbang, there are a few necessary things missing, namely make and patch.
From the command line, run:
$ sudo pacman -S make patch
Install gcc-4.4
Unfortunately, the program will not run properly using a current version of gcc, so it is necessary to download and install version 4.4. As gcc-4.4 is not in pacman, gcc-4.4 must be downloaded from the AUR.
You can find gcc-4.4 in the Arch User Repository here
Download the tarball. It should appear in your Downloads folder. Untar it by using:
$ cd ~/Downloads
$ tar xzvf gcc44.tar.gz
and move into the new folder that was created.
$ cd gcc44
Use the command makepkg by itself to make the package. NOTE: It might be necessary to make the package as root. If this is the case, run:
$ sudo makepkg --asroot
As gcc is a large program, it might take a very long time to download. Once it's downloaded, run:
$ sudo pacman -U gcc44-4.4.7-6-x86_64.pkg.tar.xz
Once again, as gcc is a large program, this will take a long time to complete.
Compile and Run Source
Move into the srtnver3 folder that you downloaded and untared from MIT. Assuming it's in your Downloads folder, use:
$ cd Downloads/srtnver3
Edit srtnmake
To make the makefile use gcc-4.4 instead of the default version, you will have to edit the make file.
$ nano srtnmake
Change gcc to gcc-4.4
Save and exit out of nano.
Compile srtnmake
Run:
$ ./srtnmake
If everything is done right, the program should compile with few errors.
Running srtn
To run the program:
$ ./srtn
Running with unsimulated dongle
NOTE: It might be necessary to blacklist the driver in order to run properly. Please look at 'Blacklist Driver' under the troubleshooting section.
To run with the dongle, receiver simulation must be turned off. To do this, simply
$ nano srt.cat
In the edit window, find the line that says
SIMULATE RECEIVER
and change it to
*SIMULATE RECEIVER
Save the file and exit nano. Now, we can run srtn using the dongle with
$ sudo ./srtn
And it should work!
NOTE: Notice how before to run, it was just ./srtn and this time it is sudo ./srtn. If you try ./srtn after enabling the dongle you will get a message similar to:
$ ./srtn
Found 1 device(s)
0: , SN: ?????
Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
usb_open error -3
Please fix the device permissions, e.g. by installing the udev rules file rtl-sdr.rules
Failed to open rtlsdr device #0.
As we see above, it is possible to run srtn without sudo, but to do so, we must do a little extra work in installing the provided udev rules. A guide to installing the udev rules will be added later.
Running with unsimulated controller/rotator
To run with the controller/rotator, antenna simulation must be turned off. To do this, simply
$ nano srt.cat
In the edit window, find the line that says
SIMULATE ANTENNA
and change it to
*SIMULATE ANTENNA
Save the file and exit nano. Now, we can run srtn using the controller/rotator with
$ sudo ./srtn
To test that the rotator works, try manually changing the az or el in-program using the 'azel' button. (Note: If the the rotator motion is moving in a direction you do not want it to go, you can press the 'S' button on the controller to stop movement.)
If you are unable to run the program successfully, look at the controller setup page to troubleshoot and make sure the controller was set up correctly.
Troubleshooting
Blacklist driver
It may be necessary to blacklist the driver so it will not already be in use when we try to call on it:
$ sudo -i
# echo "blacklist dvb_usb_rtl28xxu" > /etc/modprobe.d/librtlsdr-blacklist.conf
This will require a reboot before the effects can be seen.
$ sudo reboot
Hard Reset Controller
Often times, hard reseting the controller will fix most problems.