Hi all,
I have built my antenna and now I wont evaluate my work, so, in your opinions can I use the rtl_sdr software to accomplish it? Someone have a suggestion or is it impossible?
Thanks
I am using DVB-T dongle RTLSDR2832U with gnu radio, i have installed all the required files, but when i compile my flowgraph I get an error.
Runtime Error:Failed to open rtlsdr device.
What is the problem and its solution??
I cannot install udev rules also, i also face errors at it.... should i uninstall my ubuntu and start from the very begining.
Sohaib bin Altaf
pakistan
OK, so you plug a $20 dongle into a Raspberry Pi, hook some stuff to the GPIO connector and with probably minor tweaks to something like RTL_FM you can use it as a radio in radio-controlled model planes, cars, boats. Add the Pi's $25 camera and you could have a radio-controlled camera, useful for sending up in a radio-controlled plane or doing wildlife photography. If you've got some analog (pulse position) channels those would be good for rudder, flaps, various camera settings. This can be done in the 27 MHz CB band or with a ham license in something like the 6 meter ham band. I had no trouble getting RTL_FM running on my Pi but it probably doesn't have enough CPU horsepower to do a lot of processing on the dongle side and on the imaging side at the same time.
Anybody done this?
Alan
-----
Radio Astronomy - the ultimate DX
Since my last Windows Update (not sure that's the cause), I'm having
a hell to regain access to my Terratec DVB-Tstick with ther Elonics E4000
tuner. I've modified librtlsrc.c to include some more traces and relinked rtl_test
with it. All I'm getting is LIBUSB_ERROR_PIPE trying to read/write the I2C-bus:
Osmocom-SDR\src\rtl_test.exe
Found 1 device(s):
0: Terratec T Stick PLUS
Using device 0: Terratec T Stick PLUS
librtlsdr.c(392): I2C addr C8: got 00, rd_len: -9, wr_len: -9
librtlsdr.c(394): Read error: LIBUSB_ERROR_PIPE, Pipe error
librtlsdr.c(396): Write error: LIBUSB_ERROR_PIPE, Pipe error
librtlsdr.c(392): I2C addr C6: got 00, rd_len: -9, wr_len: -9
...
No supported tuner found
Enabled direct sampling mode, input 1
Supported gain values (1): 0.0
----------------
What could be the reason for this? What else should I try?
--gv
Hello.
I have some build problem with building gr-igbalance with documentation
enabled. Build fails with a message saying that shell interpreter can't
execute Doxyfile. It is the same as I noticed some time ago while
building gr-osmosdr (see
http://lists.osmocom.org/pipermail/osmocom-sdr/2013-April/000553.html
). It was solved by the patch by Jaroslav Škarvada (
http://cgit.osmocom.org/gr-osmosdr/commit/?id=2f6592566bd60d2539f5b976dcf61…
).
Similar patch, attached, help for gr-iqbalance. It moves doxygen
detection test to toplevel CMakeLists.txt. Please add it to git
repository.
Wojciech Kazubski
Hi all,
I've been using rtl_fm piped into multimon-ng for a while now which
has been working pretty well for decoding POCSAG, I use this command
line:
rtl_fm -f 153.350M -r 22050 - | ./multimon-ng -t raw -a POCSAG512 -a
POCSAG1200 -a POCSAG2400 -f alpha -D pocsag.db -
I updated rtl_sdr today and now all I get is junk decodes
POCSAG2400-: Address: 1318769 Function: 255
POCSAG2400-: Alpha: KA^MA
POCSAG1200-: Address: 1700218 Function: 255
POCSAG1200-: Alpha: )"<DLE>'f
POCSAG1200-: Address: 143961 Function: 255
I rolled back to an earlier version using git checkout commit and it
appears the following commit broke it:
c4fcfbb46e0a432902a2b78db4951bd20f68b9b2
Commit 8c3a99c8f7a88d7d2a05845d4b20cfcdacac4054 works fine, whereas
the commit after causes multimon_ng to spit out garbage :-(
Hi guys,
I'm new to this list (and to radio) so I hope you will please indulge me
if I ask something that is a FAQ. Also, some of these questions are
about the dongle, not the library.
I am working on a personal project to use SDR techniques to decode
aviation navigation signals (VOR). I've got the signal processing mostly
working from recorded signals, but am now trying to integrate my SW with
the radio in real time.
I have a few questions:
- What exactly is offset tuning? How is offset tuning different from
tuning to an offset?
Is this a feature that mostly benefits people who are not going to put
their IF through another mixer? In my application I am already tuning to
an offset, and pulling down a wide enough IF that actually holds many
channels of interest. (VOR channels have 50kHz spacing). I then use a
software mixer/channelizer to choose the channel I want. Am I correct in
assuming that offset tuning is of no use to me?
- regarding AGC, what is the difference between AGC and auto gain?
That is, the library API has
RTLSDR_API int rtlsdr_set_tuner_gain_mode(rtlsdr_dev_t *dev, int manual)
RTLSDR_API int rtlsdr_set_agc_mode(rtlsdr_dev_t *dev, int on);
I'm guessing that these affect different AGCs. One for the tuner and one
for the RTL device.
What are the benefits and costs of having either or both on?
- regarding rtlsdr_read_async(...) and related functions.
I take it that the library is setting up a ring buffer and calling me
back when it has a new buffer of data for me.
How long to I have to work with this buffer? Obviously, if I want to
work in real-time I need to keep up with the sample rate. But my
application can afford to throw away buffers since it can decode a few
ms of data from one station and then revisit it much later. However, I'd
like to know how long I have until the buffer gets clobbered. I'm
presuming it's stable until all the n-1 other buffers have been hit.
- generally how fast can the RTL devices tune? I know, this is not an
rtlsdr question per se, but I'm curious. I noticed that when I tune, I
get a delay.
This is a great library and I'm so glad it's out there! I was not
looking forward to plumbing the depths of USB drivers to understand how
to pull data from the RTL dongle! I think rtl-sdr.h could use perhaps a
smidge more documentation. I'd be happy to submit a comments-only patch
if there's interest. :-)
Regards,
Dave Jacobowitz
Hi,
I didn't find rtl_sdr with implemented direct sampling mode, so I made the patch. Also it has an option to set RTL AGC on.
This feature allows to use tuners as cheap data loggers without changing the schematic of the tuners. You can just connect wires directly to pins 1-2 of RTL2832 (I channel, diff. input) or pins 3-4 (Q channel, diff. input). When direct sampling mode is on - tuner's chip outputs are disabled and doesn't affect external signal.
For example, this command will write 8 bit samples to file 'mydata' at 2.4 MHz sampling rate with automatic gain:
rtl_sdr.exe -f 0 -s 2400000 -i -G mydata
Hope this will be useful for somebody as it was for me.
If you will accept the patch - please, update the windows binaries.
Thanks,
psb.
-------------------------------------------------------------------------------
diff --git a/src/rtl_sdr.c b/src/rtl_sdr.c
index eeb6dba..3564329 100644
--- a/src/rtl_sdr.c
+++ b/src/rtl_sdr.c
@@ -42,6 +42,7 @@
static int do_exit = 0;
static uint32_t bytes_to_read = 0;
static rtlsdr_dev_t *dev = NULL;
+static int samp_mode = 0;
void usage(void)
{
@@ -54,6 +55,9 @@ void usage(void)
"\t[-b output_block_size (default: 16 * 16384)]\n"
"\t[-n number of samples to read (default: 0, infinite)]\n"
"\t[-S force sync output (default: async)]\n"
+ "\t[-i set direct sampling mode (I)]\n"
+ "\t[-q set direct sampling mode (Q)]\n"
+ "\t[-G use RTL automatic gain]\n"
"\tfilename (a '-' dumps samples to stdout)\n\n");
exit(1);
}
@@ -81,6 +85,8 @@ static void sighandler(int signum)
static void rtlsdr_callback(unsigned char *buf, uint32_t len, void *ctx)
{
+ uint32_t i, r;
+ unsigned char *p1, *p2;
if (ctx) {
if (do_exit)
return;
@@ -91,7 +97,16 @@ static void rtlsdr_callback(unsigned char *buf, uint32_t len, void *ctx)
rtlsdr_cancel_async(dev);
}
- if (fwrite(buf, 1, len, (FILE*)ctx) != len) {
+ if (samp_mode) {
+ // For direct sampling mode we throw out each 2nd value,
+ // i.e., save only one channel data - I or Q.
+ for (i=0, p1=buf, p2=buf; i<len; i+=2, p2++)
+ *p1++ = *p2++;
+ r = (fwrite(buf, 1, len/2, (FILE*)ctx) == len/2);
+ } else
+ r = (fwrite(buf, 1, len, (FILE*)ctx) == len);
+
+ if (!r) {
fprintf(stderr, "Short write, samples lost, exiting!\n");
rtlsdr_cancel_async(dev);
}
@@ -119,8 +134,10 @@ int main(int argc, char **argv)
uint32_t out_block_size = DEFAULT_BUF_LENGTH;
int device_count;
char vendor[256], product[256], serial[256];
+ uint32_t use_rtlagc = 0;
+ unsigned char *p1, *p2;
- while ((opt = getopt(argc, argv, "d:f:g:s:b:n:S::")) != -1) {
+ while ((opt = getopt(argc, argv, "d:f:g:s:b:n:S::Gqi")) != -1) {
switch (opt) {
case 'd':
dev_index = atoi(optarg);
@@ -143,6 +160,15 @@ int main(int argc, char **argv)
case 'S':
sync_mode = 1;
break;
+ case 'q':
+ samp_mode = 2;
+ break;
+ case 'i':
+ samp_mode = 1;
+ break;
+ case 'G':
+ use_rtlagc = 1;
+ break;
default:
usage();
break;
@@ -205,6 +231,15 @@ int main(int argc, char **argv)
if (r < 0)
fprintf(stderr, "WARNING: Failed to set sample rate.\n");
+ /* Set direct sampling */
+ if (samp_mode) {
+ r = rtlsdr_set_direct_sampling(dev, samp_mode);
+ if (r < 0)
+ fprintf(stderr, "WARNING: Failed to set direct sampling mode.\n");
+ else
+ fprintf(stderr, "Tuner set to direct sampling mode (%c).\n", (samp_mode==1)?'I':'Q');
+ }
+
/* Set the frequency */
r = rtlsdr_set_center_freq(dev, frequency);
if (r < 0)
@@ -231,6 +266,21 @@ int main(int argc, char **argv)
fprintf(stderr, "Tuner gain set to %f dB.\n", gain/10.0);
}
+ /* Set RTL automatic gain */
+ if (1 == use_rtlagc) {
+ /* Enable automatic RTL gain */
+ r = rtlsdr_set_agc_mode(dev, 1);
+ if (r < 0)
+ fprintf(stderr, "WARNING: Failed to enable RTL automatic gain.\n");
+ else
+ fprintf(stderr, "RTL automatic gain enabled.\n");
+ } else {
+ /* Disable automatic RTL gain */
+ r = rtlsdr_set_agc_mode(dev, 0);
+ if (r < 0)
+ fprintf(stderr, "WARNING: Failed to disable RTL automatic gain.\n");
+ }
+
if(strcmp(filename, "-") == 0) { /* Write samples to stdout */
file = stdout;
#ifdef _WIN32
@@ -263,7 +313,16 @@ int main(int argc, char **argv)
do_exit = 1;
}
- if (fwrite(buffer, 1, n_read, file) != (size_t)n_read) {
+ if (samp_mode) {
+ // For direct sampling mode we throw out each 2nd value,
+ // i.e., save only one channel data - I or Q.
+ for (i=0, p1=buffer, p2=buffer; i<n_read; i+=2, p2++)
+ *p1++ = *p2++;
+ r = (fwrite(buffer, 1, n_read/2, file)== n_read/2);
+ } else
+ r = (fwrite(buffer, 1, n_read, file) == n_read);
+
+ if (!r) {
fprintf(stderr, "Short write, samples lost, exiting!\n");
break;
}