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 07-02-2017, 12:03   #1
bzs
Registered User

Join Date: Feb 2011
Posts: 38
Raspberry Pi 2 + opencpn + GPS + RTL-SDR dongle

Hi All,

I'm running the OpenCPN with a Raspberry PI 2.
The next step testing an RTL-SDR stick:
DVB-T+FM+DAB
820T2 & SDR

I'm build from source this programs:
-- kal,
-- rtl_sdr
-- rtl_ais
etc. All OK.

Kalibrating:

# kal -s GSM900
Found 1 device(s):
0: Generic RTL2832U OEM

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Exact sample rate is: 270833.002142 Hz
[R82XX] PLL not locked!
kal: Scanning for GSM-900 base stations.
GSM-900:
chan: 4 (935.8MHz - 36.583kHz) power: 41340.63
chan: 40 (943.0MHz - 36.507kHz) power: 42758.13
chan: 45 (944.0MHz - 35.899kHz) power: 36071.48
chan: 48 (944.6MHz - 36.934kHz) power: 88900.95
chan: 110 (957.0MHz - 35.982kHz) power: 224880.08
chan: 115 (958.0MHz - 36.137kHz) power: 31240.39

and scanning a channel:

kal -c 40

My PPM number is 37.

Running the decoder (yes, the number is very big...):

# rtl_ais -p 37
Edge tuning disabled.
DC filter enabled.
RTL AGC disabled.
Internal AIS decoder enabled.
Buffer size: 163.84 mS
Downsample factor: 64
Low pass: 25000 Hz
Output: 48000 Hz
Found 1 device(s):
0: Generic, RTL2832U, SN: 77771111153705700

Using device 0: Generic RTL2832U
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_read_reg failed with -1
rtlsdr_write_reg failed with -1
rtlsdr_read_reg failed with -1
rtlsdr_write_reg failed with -1
rtlsdr_read_reg failed with -1
rtlsdr_write_reg failed with -1
rtlsdr_read_reg failed with -1
rtlsdr_write_reg failed with -1
No supported tuner found
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
Enabled direct sampling mode, input 1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
Log NMEA sentences to console OFF
AIS data will be sent to 127.0.0.1 port 10110
Tuner gain set to automatic.
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
WARNING: Failed to set ppm error.
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
WARNING: Failed to set center freq.
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
WARNING: Failed to set sample rate.
rtlsdr_write_reg failed with -1
rtlsdr_write_reg failed with -1
cb transfer status: 1, canceling...


...and aborting.
--- Why...? The milliampere is not good?



--- Question no.1:
--------------------------

What is this thing...?
I'm try always, but on Raspberry don't working.

My akumulator is not good? (5V, 1.2A)
Or my Raspberry USB HUB is dead?

Sometimes working:

# cat ais.log
!AIVDO,1,1,,,B3ErsM03wk?8mP=18D3Q3wv5sP06,0*08
!AIVDM,1,1,,A,14RNTp001OOn5B8HmbB48kI600Rw,0*33
!AIVDM,1,1,,B,D02;bAAFhLfq6DM6Erlu6D3,2*2B
!AIVDM,1,1,,B,13E`Tn8P00Oo<rbHjWstI?w20D0B,0*1B

What is my problem?

--- Question no.2:
--------------------------

I need open in my local network the ports:
2947
1001
10110
but I don't a power user in the iptables manuals...

Thanks your help!
bzs is offline   Reply With Quote
Old 07-02-2017, 16:01   #2
ejs
Registered User

Join Date: Mar 2013
Location: From San Francisco
Boat: Leopard 48
Posts: 183
Re: Raspberry Pi 2 + opencpn + GPS + RTL-SDR dongle

Hi,
I have an Orange PI2 (Raspberry clone) running with an RTL-SDR and RTL-AIS. you have done the steps correctly. SInce your problem is intermittent, my guess is that the 1.2A power is not enough for the system. You can do some debugging with the RTL-SDR by trying to listen to a local FM radio station, there are instructions on the web for that. If the local FM station sounds OK, Then I would think it was the power supply because RTL-AIS uses a fair amount of CPU. If the local FM station is bad then you may have other configuration issues.

I'm not sure what you are asking about the ports, those ports are usually open on most system.

Best ,Eric
ejs is offline   Reply With Quote
Old 08-02-2017, 07:53   #3
bzs
Registered User

Join Date: Feb 2011
Posts: 38
Re: Raspberry Pi 2 + opencpn + GPS + RTL-SDR dongle

Thanks Eric,

I'm try without GPS and RTC, working just RTL-SDR dongle.
Don't problem, the rtl_ais working, don't restart the program, I'm looking the process number with pgrep.

The power supply is my problem. The Lipo Rider Pro ver.1.2 is little panel with 5x2000mAh batteries. The output is just 1A:
Lipo Rider Pro - Seeed Wiki

  • Maximum 1A load output
  • Battery and Solar panel connector is JST 2.0
  • Stable 5V USB power supply regardless of source
  • Charge/Recharge algorithms built into chip
  • Charge Lithium Polymer Battery through solar power or USB
  • Stable supply voltage through either lithium battery or USB
  • 2 x USB ports let you program your kit while charging your Lithium battery
  • LED indications for battery full or charging states
  • Scalable to multiple lithium batteries and large/multiple solar panels through simple end-user modifications
  • 4 green LED instruct quantity of electricity of lithium battery
I will try other products...


For 2000 mAh battery what kind of filling controller recommended yet?
bzs is offline   Reply With Quote
Old 08-02-2017, 09:24   #4
bzs
Registered User

Join Date: Feb 2011
Posts: 38
Re: Raspberry Pi 2 + opencpn + GPS + RTL-SDR dongle

I'm try send to my network the AIS sentences:

test 1:
# my AIS-server is 192.168.12.1
aisdispatcher -u -G -h 192.168.12.1 -p 10110 -H 127.0.0.1:1001,192.168.12.1:1001
(don't working)

test 2:

#!/bin/bash
ais_logfile="/tmp/ais.log"
ais="rtl_ais"
while :
do
if pgrep $ais
then
netcat -v -ul 10110 >> $ais_logfile
cat $ais_logfile | tail -1 | nc -l -p 1001
fi
sleep 5
done

...working, but this just the nc, alias netcat. This not a stable contact... And the port number for opencpn is TCP port on number 1001.
bzs is offline   Reply With Quote
Old 08-02-2017, 15:09   #5
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,443
Re: Raspberry Pi 2 + opencpn + GPS + RTL-SDR dongle

I get same errors from using the dongle in a usb hub. Maybe if I powered the hub it would work?
seandepagnier is offline   Reply With Quote
Old 08-02-2017, 20:28   #6
ejs
Registered User

Join Date: Mar 2013
Location: From San Francisco
Boat: Leopard 48
Posts: 183
Re: Raspberry Pi 2 + opencpn + GPS + RTL-SDR dongle

Quote:
Originally Posted by boat_alexandra View Post
I get same errors from using the dongle in a usb hub. Maybe if I powered the hub it would work?
Boat,

My RTL SDR works fine through a powered hub. These dongles do draw about 350 mA and the hub in unpowered mode draws some too. The less you pull out of the pi power supply the better. Power issues often mask and confuse real software issues.

Eric
ejs is offline   Reply With Quote
Reply

Tags
enc, gps, opencpn

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
RTL-SDR + OpenCPN on a mac kabazz OpenCPN 28 31-10-2016 12:41
Fast cheap AIS using $20 rtl-sdr DVB-T SDR Dongles ! wetduck OpenCPN 166 20-02-2016 12:45

Advertise Here


All times are GMT -7. The time now is 10:01.


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.