Navigatrix.net - A Voyager's Companion http://navigatrix.net/ |
|
rtl-sdr http://navigatrix.net/viewtopic.php?f=4&t=498 |
Page 1 of 2 |
Author: | skyl4rk [ 05 Sep 2013, 16:27 ] |
Post subject: | rtl-sdr |
I was recently successful in installing rtl-sdr on my Linux Mint laptop. I was not able to get it to work in Navigatrix. I was able to use the product below to monitor VHF 16 using the laptop. http://www.fasttech.com/products/1254300 Using these how-tos: http://blogs.bu.edu/mhirsch/2012/07/get ... in-ubuntu/ http://de8msh.blogspot.com/search/label/RTL-SDR http://kmkeen.com/rtl-demod-guide/index.html I failed a few times but finally got it to install on Linux Mint. I'm not sure I can replicate it, the software is not user friendly. The command that receives VHF 16 is as follows: sudo rtl_fm -W -f 156.75M -l 36 -g 49.6 -s 200000 -r 48000 | aplay -r 48k -f S16_LE You will have to adjust -f (frequency). Nominally the frequency for VHF16 is 156.8M, however I calibrated my setup by trial and error and found the best reception 0.05M lower than the nominal frequency. The -l is the squelch level, which will change based on background noise that day. -g is gain, which should be set at the highest result returned from rtl_test. So far I have tested using my own VHF handheld in tx mode. I need to make an antenna. A vertical dipole with legs of 18" should work. My plan is to solder two 18" wires to the board and to use a usb male to female extension cord to put the board up in the air. Another option is to use the supplied coax and cut the coating back 18" and pull the shielding one way and the inner wire the other. Or solder a wire to the shielding, if it is foil, which I suspect. If this is reliable, it would be a good way to monitor 16. If I am running OpenCPN anyway, might as well use the laptop to monitor 16 too. rtl-sdr should also be able to scan frequencies, for example 9 - 13 - 16 - 22. It should also pick up weather VHF stations. Here are my notes from trying to install on Navigatrix: # Installing rtl_sdr to receive VHF 16 sudo apt-get update # http://blogs.bu.edu/mhirsch/2012/07/get ... in-ubuntu/ # de8msh.blogspot.com/2012/09/rtl-sdr-toolbox-on-linux-based-os.html # note:error in de8msh webpage: build-essential has no s at the end # I did this but it is for the full gnuradio install, might have been a mistake sudo apt-get install build-essential cmake git-core libboost-all-dev libusb-1.0-0-dev python-scitools portaudio19-dev -y # mhirsch's install: sudo apt-get install libusb-1.0-0-dev sudo apt-get install git sudo apt-get install libusb-1.0-0-dev git cmake # make a directory to hold source files and move to it cd ~ mkdir rtl-sdr cd rtl-sdr #get the rtl-sdr software git clone git://git.osmocom.org/rtl-sdr.git #note: this created a second rtl-sdr directory in the ~/rtl-sdr directory. I moved the files to the ~/rtl-sdr directory # make a build directory and move to it mkdir build cd build #you should now be in ~/rtl-sdr/build with all the rtl_sdr git files in ~/rtl-sdr # install the rtl-sdr software sudo cmake ../ sudo make sudo make install # make rtl files executable chmod a+x /usr/local/bin/rtl* #getting lib errors so see if this fixes it: chmod a+x /usr/local/lib/librtlsdr.so.0.5git The error that I see on terminal is: rtl_test: error while loading shared libraries: librtlsdr.so.0: cannot open shared object file: No such file or directory I am wondering if anyone has suggestions as to how to get this to work. |
Author: | Moe [ 05 Sep 2013, 19:16 ] |
Post subject: | Re: rtl-sdr |
Try running ldconfig Quote: ldconfig creates the necessary links and cache to the most recent
shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/lib and /usr/lib). The cache is used by the run-time linker, ld.so or ld-linux.so. ldconfig checks the header and filenames of the libraries it encounters when determining which versions should have their links updated. ldconfig will attempt to deduce the type of ELF libs (i.e., libc5 or libc6/glibc) based on what C libs, if any, the library was linked against. Some existing libs do not contain enough information to allow the deduction of their type. Therefore, the /etc/ld.so.conf file format allows the specification of an expected type. This is used only for those ELF libs which we can not work out. The format is "dirname=TYPE", where TYPE can be libc4, libc5, or libc6. (This syntax also works on the command line.) Spaces are not allowed. Also see the -p option. ldconfig should normally be run by the superuser as it may require write permission on some root owned directories and files. |
Author: | skyl4rk [ 06 Sep 2013, 05:28 ] |
Post subject: | Re: rtl-sdr |
before I saw the above post, I tried installing gnuradio using the build-gnuradio script: mkdir ~/sdr cd ~/sdr $ wget http://www.sbrac.org/files/build-gnuradio && chmod a+x ./build-gnuradio && ./build-gnuradio after an overnight build, I rebooted and ran rtl_test, getting: Library error 0, exiting... $sudo ldconfig -v $rtl_test Library error 0, exiting... Now trying $sudo apt-get install gnuradio |
Author: | skyl4rk [ 06 Sep 2013, 05:35 ] |
Post subject: | Re: rtl-sdr |
rebooted $rtl_test Library error 0, exiting... I do have GRC (Gnu Radio Companion) in the menu under Programming. |
Author: | Moe [ 06 Sep 2013, 07:45 ] |
Post subject: | Re: rtl-sdr |
When you ran sudo ldconfig -v did you see a bunch of data which included: Quote: /usr/local/lib: because I did...and then saw this:libtiffxx.so.5 -> libtiffxx.so.5.2.0 libtiff.so.5 -> libtiff.so.5.2.0 librtlsdr.so.0 -> librtlsdr.so.0.5git Quote: moe@example:~$ /usr/local/bin/rtl_test ...because I don't have the device.
No supported devices found. moe@example:~$ rtl_test No supported devices found. moe@example:~$ |
Author: | Moe [ 06 Sep 2013, 09:24 ] |
Post subject: | Re: rtl-sdr |
Ok, I'm at a loss here.... Attachment: gnuradio.png [ 107.1 KiB | Viewed 21990 times ] |
Author: | skyl4rk [ 06 Sep 2013, 09:37 ] |
Post subject: | Re: rtl-sdr |
Yes, I saw a list of lib files pointing to other lib files. It looks like you have rtl-sdr running, except you need to plug in one of the usb devices. I get a lib error before that point. http://www.fasttech.com/products/1254300 This is the device that is working for me on Linux Mint to receive VHF 16. I have not yet solved the mysteries of Gnu Radio Companion, I intend to try to learn when I have time. The rtl-sdr program is supposed to be much more lightweight on system resources than gnuradio. I did not really want the full gnuradio install but am trying to get something working. Apparently there is a gnuradio app gr-ais that will receive ais signals, and it has successfully been used together with OpenCPN to display AIS. I have not gotten to that point in the experiment yet. |
Author: | Moe [ 06 Sep 2013, 09:45 ] |
Post subject: | Re: rtl-sdr |
skyl4rk wrote: It looks like you have rtl-sdr running, except you need to plug in one of the usb devices. I get a lib error before that point. Yeah, that's one way of looking at it...another way to look at it is that following the instructions I could successfully build and launch the applications on Navigatrix without getting errors.Spending 12 bucks and waiting 2 weeks will not change that. Run a simple test. Don't plug in your thingy. Launch the application. Do you get a library error or "No supported devices found"? AIS frequencies: Channel 87 – 161.975 MHz Channel 88 – 162.025 MHz and then pipe it to a device/app that OpenCPN can pick up and use. |
Author: | skyl4rk [ 06 Sep 2013, 10:36 ] |
Post subject: | Re: rtl-sdr |
Good point... $rtl_test No supported devices found. |
Author: | Moe [ 06 Sep 2013, 11:09 ] |
Post subject: | Re: rtl-sdr |
So when you do plug it in and run the application does it give a library error? (paste the output rather than interpret) |
Author: | Moe [ 06 Sep 2013, 11:22 ] |
Post subject: | Re: rtl-sdr |
I was just looking at http://sdr.osmocom.org/trac/wiki/rtl-sdr It might be a simple thing as the executable needs an argument...such as rtl_test -t or rtl_test -s 3.2e6 |
Author: | Moe [ 06 Sep 2013, 12:09 ] |
Post subject: | Re: rtl-sdr |
...that being said, I don't see the Marine VHF frequency range between 156.0 and 162.025 MHz in the dongles specs. Quote: DVBT: 48.25~863.25 MHz unless the DVB-T range counts. I don't know anything about it as radio is among the black arts; which I avoid; as it steals the souls of men.FM radio: 87.5~108 MHz DAB radio: L-Band-1452960~1490624 KHZ, VHF-174928~239200 KHZ I'm curious if this hardware can deal with marine vhf. |
Author: | skyl4rk [ 06 Sep 2013, 20:11 ] |
Post subject: | Re: rtl-sdr |
Ha ha, and I thought unix-linux was a deal with the devil. The range of the Rafael Micro R820T is 24 - 1766 MHz. I have a usb extension cord on order and will solder some antenna wires on the usb chip soon. Then I will see if I can pick up real VHF traffic. So far it picks up my transmission from a handheld VHF, albeit only a few meters away from the dongle. This is using the original antenna and my Linux Mint laptop. |
Author: | skyl4rk [ 14 Sep 2013, 07:26 ] |
Post subject: | Re: rtl-sdr |
Some clues as to how to get gr-ais and OpenCPN going... http://www.reddit.com/r/RTLSDR/comments ... d_opencpn/ |
Author: | Moe [ 14 Sep 2013, 10:04 ] |
Post subject: | Re: rtl-sdr |
I don't know how ais_rxworks, or what -dosmocom -g35 -r250e3 signify; but you could edit /usr/local/bin/opencpnais Code: sudo medit /usr/local/bin/opencpnais to something like this:Code: #!/bin/sh ...deleting any line you wish that begin with #, except the first.cd / if ( ! pidof opencpn ); then ## Sound card -don't need- # alsactl store -f ~/.config/alsa_std # alsactl restore -f ~/.config/alsa_ais # ## Script to link the non static /dev/ttyUSB[N] ports ## to static /dev/com[N]. configuration will be saved ## to a configuration file which is unique for each ## computer -don't need- # comports # mkfifo /tmp/aisfifo socat -L /tmp/ais - PTY,link=/tmp/aisfifo,raw & pidof air_rx || ais_rx -dosmocom -g35 -r250e3 > /tmp/aisfifo 2>/dev/null # ## AIS Sound card demodulator -don't need- # pidof gnuais || sudo gnuais -c /etc/gnuais.conf -f >/dev/null 2>&1 # ## Make sure OCPN language matches system language -don't need- # sed -i "s/^Locale=.*$/Locale=${LANGUAGE%%:*}/" ~/.opencpn/opencpn.conf /usr/bin/opencpn $@ >/dev/null 2>&1 #/usr/bin/opencpn --verbose ## Cleans up possible loose ends # sudo killall gnuais sudo killall ais_rx kill -9 $(cat /tmp/ais) rm /tmp/aisfifo rm /tmp/ais ## Didn't do -don't need- # alsactl store -f ~/.config/alsa_ais # alsactl restore -f ~/.config/alsa_std fi My guess is you'll want to run it from a script. This way it should mean only one thing to mess with-once. Although I've not found a good way to deal with stray socat processes. If you try it...try it first from the terminal (opencpnais) to see if it dies. 2>/dev/null in line 15 will hide any error from ais_rx so you could leave that out in a test. If it works, you can just click your OpenCPN icons to launch the whole thing. |
Author: | skyl4rk [ 14 Sep 2013, 17:19 ] |
Post subject: | Re: rtl-sdr |
Thanks, I have an antenna made up, and my usb extension cord came in, so now all I need is a good block of time to experiment and try to get it to work. |
Author: | Moe [ 14 Sep 2013, 21:56 ] |
Post subject: | Re: rtl-sdr |
The solution to dealing with a stray socat process was found in another Navigatrix script (/usr/local/bin/gippy). Code: kill -9 $(cat /tmp/ais) I've edited the code above.Now the only thing left is to make it work. |
Author: | cutimanya [ 03 May 2014, 17:23 ] |
Post subject: | Re: rtl-sdr |
socat -L /tmp/ais - PTY,link=/tmp/aisfifo,raw & pidof air_rx || ais_rx -dosmocom -g35 -r250e3 > /tmp/aisfifo 2>/dev/null error!!!!! select source with ais_rx -s, not -d !!! try with socat -L /tmp/ais - PTY,link=/tmp/aisfifo,raw & pidof air_rx || ais_rx -sosmocom -g35 -r250e3 > /tmp/aisfifo 2>/dev/null |
Author: | Moe [ 03 May 2014, 20:49 ] |
Post subject: | Re: rtl-sdr |
There you have it. A typo repeated over and over finally gets corrected. Thanks. |
Author: | boat_alexandra [ 06 Jun 2014, 03:33 ] |
Post subject: | Re: rtl-sdr |
the rtl_sdr plugin for opencpn automatically runs everything. You can use either gnuradio, or rtl_fm and aisdecoder (much less cpu usage and easier to compile and get working) Instructions are in the readme for the plugin. https://github.com/seandepagnier/rtlsdr_pi |
Page 1 of 2 | All times are UTC - 5 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |