Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 24-06-2015, 07:12   #166
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,625
Images: 2
Re: New rtlsdr Plugin

I hope to get this working in the next few weeks, and did another test with the DVB-T_DAB_FM DV3 Usb 2.0 with the small antenna and drivers all loaded.
I started Opencpn 4.0 and enabled the most recent rtlsdr_pi for Ocpn version 4.0.
Then from the readme file in github.

From rtlsdr_pi Readme"

Quote:
Test with:
rtl_fm -f 161975000 -p 35 -s 48k | aisdecoder -h 127.0.0.1 -p 10110 -a file -c mono -d -f /dev/stdin

be sure to try all possible values for -p! this program is very picky and your value must be +- 7
of the correct value to get messages (Range +- 128) the exact correct value gives many more messages. The plugin provides an automatic detection routine.
At this point you can simply add a udp data connection on port 10110 and not use the plugin, but the plugin automatically invokes the programs, and provides other control."
I put these values into the Preferences:
----------------------------------------------------
Program: rtl_fm | aisdecoder
extra args (blank default)
rtl_fm -f 161975000 p 35 -s 48k
aisdecoder -h 127.0.0.1 -p 10110 -a file -c mono -d -f /dev/stdin

Then started the testing for value -p
Now the plugin is passing messages and doing rtlsdr error calibration:
The messages are similar to this:
Code:
Executed: C:\Program Files (x86)\OpenCPN 4.0.0\plugins\rtlsdr_pi\bin\rtl_fm -f 161975000 -p 50 -s 48k
Executed: C:\Program Files (x86)\OpenCPN  4.0.0\plugins\rtlsdr_pi\bin\aisdecoder -h 127.0.0.1 -p 10110 -a file -c  mono -d -f /dev/stdin
Stopped: C:\Program Files (x86)\OpenCPN 4.0.0\plugins\rtlsdr_pi\bin\rtl_fm -f 161975000 -p 50 -s 48k
Stopped: C:\Program Files (x86)\OpenCPN  4.0.0\plugins\rtlsdr_pi\bin\aisdecoder -h 127.0.0.1 -p 10110 -a file -c  mono -d -f /dev/stdin


Summary of plugin action:
Walks through through values, testing the -p [value] using 50, then 0, 4, 8, 12, 16, 20, ... up to 92, then -6, -10, -14, -20 ... up to -98

The progress bar closed and testing stopped with Error Correction Calibration at -98
What this means is the test was unsuccessful and ended on -98 and has not found a suitable value. The reason this happened is I am inside and NOT using a proper VHF antenna!

Now I know that drivers, dongle and software are all working properly. With the correct antenna and some decent AIS targets I might have a chance of getting it to work next week.

See attached file of the output messages showing the action of the plugin's testing to optimize and set the proper value for -p to receive the most AIS signals.

Many thanks to Sean and all the others for help, info, and testing.
Attached Files
File Type: doc rtlsdr-message-output-98-unsuccessful.doc (57.7 KB, 86 views)
rgleason is offline   Reply With Quote
Old 24-06-2015, 19:46   #167
Registered User
 
sbfreddie's Avatar

Join Date: Mar 2012
Location: Southern Texas, Port Isabel
Boat: I Wish
Posts: 175
Images: 1
Send a message via Skype™ to sbfreddie
Re: New rtlsdr Plugin

Quote:
Originally Posted by piluso View Post
Hello all

Looking for a two channels receiver for AIS using rtl-sdr I found the rtl_ais prototype at https://github.com/keenerd/rtl-sdr-misc/tree/master/ais , tagged as "work-in-progress ideas"

I compiled the program without effort, but it didn't work, so after some debugging and tweaking, I managed to make it work, piping data to aisdecoder.

I added a conditional compilation for Windows in both rtl_ais and aisdecoder with a little modification that lets rtl_ais and aisdecoder to work the same way they do on Linux using pipes.

The command line I used to test the program, with OpenCPN for showing targets is:

(path_to_rtl_ais)/rtl_ais -p73 | (path_to_aisdecoder)/aisdecoder -a file -f- -d -h 127.0.0.1 -p10110

With this, aisdecoder can decode both AIS channels simultaneously.

The source code is here:
https://github.com/dgiardini/rtl-sdr...ree/master/ais

and here:
https://github.com/dgiardini/aisdecoder

I've made a pull request on both, still no news.

Hope this helps, feedback is welcome

Regards, David
David:
Thanks for the new version. I built both the rtl_ais and the aisdecoder from your git hub account. They both built fine after I found the missing dependencies.
However rtl_ais does not work correctly. As you can see from my screenshot, the first instance of rtl_ais was running for 3 hours and found nothing, but the original rtl_fm ran for 6 minutes and found 9 signals.
If you look carefully at the numbers from the screenshot compare the line:
Tuned to 162000000
with the same line from rtl_fm:
Tuned to 162227000

It appears that rtl_ais does not take into account the -p setting of 31 ppm although it says:
Tuner error set to 31 ppm
It shows the wrong frequency that it tuned to, it should be 162227000 to take into account the 31 ppm error entered on the command line.

Thanks,
Freddie
Attached Files
File Type: pdf Screenshot.pdf (201.9 KB, 86 views)
sbfreddie is offline   Reply With Quote
Old 25-06-2015, 06:53   #168
Registered User

Join Date: Aug 2014
Location: Argentina
Boat: H20
Posts: 62
Re: New rtlsdr Plugin

Freddie

Thanks for your feedback . The problem is with the parameter "-c mono" because rtl_ais sends "stereo" data to aisdecoder and rtl_fm sends "mono" data. Simply omit the "- c mono" and should work.
The frequency 162000000 Hz is ok, because is the center freq between 161975000 Hz (AIS channel A) and 162025000 Hz (AIS channel B).
I hope this helps .

Regards, David
piluso is offline   Reply With Quote
Old 25-06-2015, 08:28   #169
Registered User
 
sbfreddie's Avatar

Join Date: Mar 2012
Location: Southern Texas, Port Isabel
Boat: I Wish
Posts: 175
Images: 1
Send a message via Skype™ to sbfreddie
Re: New rtlsdr Plugin

Quote:
Originally Posted by piluso View Post
Freddie

Thanks for your feedback . The problem is with the parameter "-c mono" because rtl_ais sends "stereo" data to aisdecoder and rtl_fm sends "mono" data. Simply omit the "- c mono" and should work.
The frequency 162000000 Hz is ok, because is the center freq between 161975000 Hz (AIS channel A) and 162025000 Hz (AIS channel B).
I hope this helps .

Regards, David
David:
Thanks, that tip fixed it. All is well.
What is the best way to get this into OpenCPN, now that its working?

Thanks,
Freddie
sbfreddie is offline   Reply With Quote
Old 25-06-2015, 10:22   #170
Registered User

Join Date: Aug 2014
Location: Argentina
Boat: H20
Posts: 62
Re: New rtlsdr Plugin

Quote:
What is the best way to get this into OpenCPN, now that its working?
The best way surely is adding an option to the rtl-sdr plugin supporting rtl_ais :-)

Meantime, you could configure a net connection, UPD port 10110 as shown in the image.



Run the command as you previously did (parameters -h 127.0.0.1 -p10110 are relevant here), and aisdecoder will send messages that will be received by OpenCPN. The next step should be start all together from a shell script. Let me know if you need help with that.

Regards, David
piluso is offline   Reply With Quote
Old 25-06-2015, 11:02   #171
Registered User
 
sbfreddie's Avatar

Join Date: Mar 2012
Location: Southern Texas, Port Isabel
Boat: I Wish
Posts: 175
Images: 1
Send a message via Skype™ to sbfreddie
Re: New rtlsdr Plugin

Quote:
Originally Posted by piluso View Post
The best way surely is adding an option to the rtl-sdr plugin supporting rtl_ais :-)

Meantime, you could configure a net connection, UPD port 10110 as shown in the image.



Run the command as you previously did (parameters -h 127.0.0.1 -p10110 are relevant here), and aisdecoder will send messages that will be received by OpenCPN. The next step should be start all together from a shell script. Let me know if you need help with that.

Regards, David
Dave:
Thanks again!
I hope Sean can get around to modifying the rtl-sdr plugin. I certainly do not have the skills to change it.

Thanks,
Freddie
sbfreddie is offline   Reply With Quote
Old 25-06-2015, 12:14   #172
Registered User

Join Date: Aug 2011
Location: Mississippi Gulf Coast
Boat: 37' TransPac Trawler, heavily modified
Posts: 88
Re: New rtlsdr Plugin

Can someone post the steps required and the dependencies needed to compile rtl-ais on a windows 8.1 machine?
LeoA is offline   Reply With Quote
Old 25-06-2015, 14:13   #173
Registered User

Join Date: Aug 2014
Location: Argentina
Boat: H20
Posts: 62
Re: New rtlsdr Plugin

Quote:
Originally Posted by LeoA View Post
Can someone post the steps required and the dependencies needed to compile rtl-ais on a windows 8.1 machine?
A workaround: Look at these instructions: How to build RTL-SDR on Windows x64 - Staniscia net ; but use the keenerd repository at https://github.com/keenerd/rtl-sdr. After compiling succesfully these programs, replace the rtl_fm.c content with the rtl_ais.c code from here https://github.com/dgiardini/rtl-sdr.../ais/rtl_ais.c . You'll need to correct the line 48 to #include "convenience/convenience.h". Compile again, if all goes fine the new rtl_fm.exe program will be rtl_ais.
Good luck!
David
piluso is offline   Reply With Quote
Old 27-06-2015, 00:59   #174
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: New rtlsdr Plugin

my internet is very slow, and I have trouble catching up with all the topics.

Is rtl_ais sort of like rtl_fm and aisdecoder built into a single program or something else?

I would prefer rtl_ais to function like a library so that a separate process is not needed but instead could run from a thread of opencpn.
seandepagnier is offline   Reply With Quote
Old 27-06-2015, 05:03   #175
Registered User

Join Date: Apr 2015
Location: Norfolk, UK
Posts: 68
Re: New rtlsdr Plugin

rtl_ais is basically just a two-channel version of rtl_fm, so it needs to be piped to aisdecoder as before. As a temporary fix I have changed a couple of lines in your plugin and recompiled. (Obviously rtl_fm is still needed for broadcast FM and marine VHF reception.)
Regards
Andrew
duichan is offline   Reply With Quote
Old 27-06-2015, 09:29   #176
Registered User
 
sbfreddie's Avatar

Join Date: Mar 2012
Location: Southern Texas, Port Isabel
Boat: I Wish
Posts: 175
Images: 1
Send a message via Skype™ to sbfreddie
Re: New rtlsdr Plugin

Quote:
Originally Posted by duichan View Post
rtl_ais is basically just a two-channel version of rtl_fm, so it needs to be piped to aisdecoder as before. As a temporary fix I have changed a couple of lines in your plugin and recompiled. (Obviously rtl_fm is still needed for broadcast FM and marine VHF reception.)
Regards
Andrew
Andrew:
In your changes to Sean's plugin did you add to the existing options, or just replace the rt._fm with rtl_ais?
Would you consider sharing your changes to Sean's plugin?

Thanks,
Freddie
sbfreddie is offline   Reply With Quote
Old 27-06-2015, 10:44   #177
Registered User

Join Date: Apr 2015
Location: Norfolk, UK
Posts: 68
Re: New rtlsdr Plugin

Hi Freddie
I saw no reason to keep rtl_fm as an AIS option, since rtl_ais is essentially the same thing only better. However rtl_fm is retained for the non-AIS functions as I mentioned before.
I have now tidied up a few things including the readme file, and the code is available here:
https://github.com/duichan/rtlsdr_pi
Regards
Andrew
P.S. I have only tested this on an RPi2, but can't see any reason why it shouldn't work for other OS.
duichan is offline   Reply With Quote
Old 27-06-2015, 11:26   #178
Registered User
 
sbfreddie's Avatar

Join Date: Mar 2012
Location: Southern Texas, Port Isabel
Boat: I Wish
Posts: 175
Images: 1
Send a message via Skype™ to sbfreddie
Re: New rtlsdr Plugin

Quote:
Originally Posted by duichan View Post
Hi Freddie
I saw no reason to keep rtl_fm as an AIS option, since rtl_ais is essentially the same thing only better. However rtl_fm is retained for the non-AIS functions as I mentioned before.
I have now tidied up a few things including the readme file, and the code is available here:
https://github.com/duichan/rtlsdr_pi
Regards
Andrew
P.S. I have only tested this on an RPi2, but can't see any reason why it shouldn't work for other OS.
Andrew:
Thanks for the change. It builds and runs fine on my Tegra (arm 7i) under Ubuntu 14.04.
One interesting side note, the "close" button no longer closes the plugin window.
All else is good.

Thanks,
Freddie
sbfreddie is offline   Reply With Quote
Old 29-06-2015, 06:41   #179
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: New rtlsdr Plugin

Quote:
Originally Posted by duichan View Post
Hi Freddie
I saw no reason to keep rtl_fm as an AIS option, since rtl_ais is essentially the same thing only better. However rtl_fm is retained for the non-AIS functions as I mentioned before.
I have now tidied up a few things including the readme file, and the code is available here:
https://github.com/duichan/rtlsdr_pi
Regards
Andrew
P.S. I have only tested this on an RPi2, but can't see any reason why it shouldn't work for other OS.
I agree that in the long term we should remove rtl_fm, but in the meantime perhaps, we should retain it to verify that rtl_ais really is better. Maybe rtl_fm can pick up less traffic but gets packets from ships farther away.. or something. Basically this is still experimental so I think we should keep more options, but make rtl_ais the default (keeping gnuradio as well) Also we could add support for soft_fm as it apparently has better filters.

Finally... I really think rtl_ais should have aisdecoder built into it. It's bad enough we spawn a process, but spawning two and piping them together, while works more or less on linux (notice the system("killall ...") ) I cannot perform this on windows and so, it would require some special windows code to deal with it which I would rather not write. Eventually we should just build it all into opencpn as this gives us maximum control (consider two or more dongles with one receiving ais, and another ads-b, or vhf audio or even single side band)
seandepagnier is offline   Reply With Quote
Old 29-06-2015, 09:07   #180
Registered User

Join Date: Apr 2015
Location: Norfolk, UK
Posts: 68
Re: New rtlsdr Plugin

The code for rtl_fm and rtl_ais really is very similar indeed; both were written/updated by Keenerd. However I certainly agree that merging everything into one plugin is a good idea. soft_fm is a new one on me. Maybe there's an opportunity to develop soft_ais if it is potentially better?
duichan is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Logbook Konni for OpenCPN konni OpenCPN 1128 15-05-2022 11:25
OpenCPN Release Candidate Version 3.1.1411 Released bdbcat OpenCPN 48 24-02-2013 06:59
GRIB Weather Mark Ward OpenCPN 26 12-02-2012 21:33
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 04:31

Advertise Here


All times are GMT -7. The time now is 22:25.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.