bistromath / gr-air-modes

Gnuradio Mode-S/ADS-B radio
This project implements a Mode S receiver for the Gnuradio software-defined radio project. It is designed to receive Mode S transmissions from aircraft and decode them to a human-readable format, including ADS-B information messages such as position and a
GNU General Public License v3.0
439 stars 126 forks source link

Problems using file as data source #27

Closed antirez closed 11 years ago

antirez commented 11 years ago

Hello, I've an RTL-based dongle. If I use gr-air-modes as:

modes_rx -d

I can receive messages without issues, and the messages are correct about flight I actually know are landing or leaving the airport near my home.

However I need to register data with rtl_sdr, and later analyze it with modes_rx. In order to do so I get data with:

rtl_sdr -f 1090000000 -s 4000000 /tmp/modes.bin

Later I convert this 8 bit samples in .cfile format with the following C "program":

#include <stdio.h>

int main(void) {
    unsigned char in[2];
    float out[2];

    while(fread(in,1,2,stdin) == 2) {
        out[0] = in[0];
        out[1] = in[1];
        out[0] = (out[0] - 127)*(1.0/128);
        out[1] = (out[1] - 127)*(1.0/128);
        fwrite(out,sizeof(float),2,stdout);
    }
    return 0;
}

And finally I use the generated cfile-format output with:

modes_rx -F dump.cfile

But this time it does not work as expected and I only see bogus messages due to the weak checksum, so basically it is just garbage.

Now I wonder if there is a problem with -F in modes_rx, or my conversion program does not work.

If there is no modes_rx issue, please read this issue just as: please document the format expected by -F.

Thank you for your work.

Regards, Salvatore

bistromath commented 11 years ago

The format modes_rx expects is the same format Gnuradio uses for binary data: 32-bit floating-point I,Q,I,Q... Please see the Gnuradio documentation if you need more specificity than this -- the question is asked weekly on the mailing list.

antirez commented 11 years ago

Thank you, I'll send you a pull request with an enhanced version of the README with this and other informations that I found looking inside the source code.

bistromath commented 11 years ago

Thanks. Pull requests are always appreciated!

On Wed, Dec 19, 2012 at 11:21 AM, Salvatore Sanfilippo < notifications@github.com> wrote:

Thank you, I'll send you a pull request with an enhanced version of the README with this and other informations that I found looking inside the source code.

— Reply to this email directly or view it on GitHubhttps://github.com/bistromath/gr-air-modes/issues/27#issuecomment-11543931.