TLeconte / acarsdec

ACARS SDR decoder
336 stars 90 forks source link

Using the SDRPlay #45

Closed DickvanNoort closed 6 years ago

DickvanNoort commented 6 years ago

I pulled the latest version. Did a make -f Makefile.rtl which compiled error free. Did a make -f Makefile.sdrplay which failed with an error. Did a make -f Makefile.sdrplay clean Did a make -f Makefile.sdrplay whcih now compiled erro free.

Not sure how to indicate that I want to run it using my RSP1. The Usage section mentions: for the SDRplay device -s f1 [f2] ... [fN] : (whihc is the same as for the AIRspy. But ./acarsdec -s 131.525 131.725 131.825 results in the help text being displayed..

The -s option is not mentioned in the help text the program produces.

What am I doing wrong?

Cheers, Dick

TLeconte commented 6 years ago

I did not write the sdrplay code, but from the source you must have a help message with -s if you have compiled with Makefile.sdrplay ... Something like that :

[-L lnaState] [-G GRdB] [-p ppm] -s f1 [f2] .. [fN]

So perhaps , it's a cleaning problem rm *.o acarsdec make -f Makefile.sdrplay and retry

Perhaps you could ask to the author of sdrplay code https://github.com/JvanKatwijk/acarsdec

DickvanNoort commented 6 years ago

Yes, I realise Jan van Katwijk wrote the code.

This is what I did before and the result:

make -f Makefile.sdrplay clean make -f Makefile.sdrplay

pi@MYPI-16B:~/acarsdec $ nano  acarsdec.c
pi@MYPI-16B:~/acarsdec $ make -f Makefile.sdrplay clean
pi@MYPI-16B:~/acarsdec $ make -f Makefile.sdrplay
cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I.    -c -o acarsdec.o acarsdec.c
acarsdec.c: In function ‘main’:
acarsdec.c:181:10: warning: implicit declaration of function ‘initSdrplay’ [-Wimplicit-function-declaration]
    res = initSdrplay (argv, optind);
          ^~~~~~~~~~~
acarsdec.c:297:21: warning: implicit declaration of function ‘runSdrplaySample’ [-Wimplicit-function-declaration]
               res = runSdrplaySample ();
                     ^~~~~~~~~~~~~~~~
cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I.    -c -o acars.o acars.c
cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I.    -c -o msk.o msk.c
cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I.    -c -o sdrplay.o sdrplay.c
sdrplay.c: In function ‘initSdrplay’:
sdrplay.c:114:10: warning: unused variable ‘i’ [-Wunused-variable]
 uint32_t i;
          ^
sdrplay.c:111:14: warning: unused variable ‘F0’ [-Wunused-variable]
 unsigned int F0, minFc = 140000000, maxFc = 0;
              ^~
sdrplay.c:109:5: warning: unused variable ‘r’ [-Wunused-variable]
 int r, n;
     ^
At top level:
sdrplay.c:91:5: warning: ‘RSPduo_Table’ defined but not used [-Wunused-variable]
 int RSPduo_Table [] = {0, 6, 12, 18, 20, 26, 32, 38, 57, 62};
     ^~~~~~~~~~~~
cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I.    -c -o rtl.o rtl.c
cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I.    -c -o air.o air.c
cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I.    -c -o output.o output.c
cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I.    -c -o label.o label.c
cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I.    -c -o cJSON.o cJSON.c
cc acarsdec.o acars.o msk.o sdrplay.o rtl.o air.o output.o label.o cJSON.o -o acarsdec.sdrplay -lm -pthread -lmirsdrapi-rsp  -lusb-1.0

So now I did as you suggested with this as result: pi@MYPI-16B:~ $ cd acarsdec pi@MYPI-16B:~/acarsdec $ rm *.o acarsdec pi@MYPI-16B:~/acarsdec $ make -f Makefile.sdrplay cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I. -c -o acarsdec.o acarsdec.c acarsdec.c: In function ‘main’: acarsdec.c:181:10: warning: implicit declaration of function ‘initSdrplay’ [-Wimplicit-function-declaration] res = initSdrplay (argv, optind); ^~~ acarsdec.c:297:21: warning: implicit declaration of function ‘runSdrplaySample’ [-Wimplicit-function-declaration] res = runSdrplaySample (); ^~~~ cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I. -c -o acars.o acars.c cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I. -c -o msk.o msk.c cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I. -c -o sdrplay.o sdrplay.c sdrplay.c: In function ‘initSdrplay’: sdrplay.c:114:10: warning: unused variable ‘i’ [-Wunused-variable] uint32_t i; ^ sdrplay.c:111:14: warning: unused variable ‘F0’ [-Wunused-variable] unsigned int F0, minFc = 140000000, maxFc = 0; ^~ sdrplay.c:109:5: warning: unused variable ‘r’ [-Wunused-variable] int r, n; ^ At top level: sdrplay.c:91:5: warning: ‘RSPduo_Table’ defined but not used [-Wunused-variable] int RSPduo_Table [] = {0, 6, 12, 18, 20, 26, 32, 38, 57, 62}; ^~~~ cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I. -c -o rtl.o rtl.c cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I. -c -o air.o air.c cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I. -c -o output.o output.c cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I. -c -o label.o label.c cc -Wall -Ofast -pthread -D WITH_SDRPLAY -I. -c -o cJSON.o cJSON.c cc acarsdec.o acars.o msk.o sdrplay.o rtl.o air.o output.o label.o cJSON.o -o acarsdec.sdrplay -lm -pthread -lmirsdrapi-rsp -lusb-1.0

pi@MYPI-16B:~/acarsdec $ ./acarsdec -s 131.525 131.725 131.825 -bash: ./acarsdec: No such file or directory

It looks like the acarsdec program is not created. make -f Makefile.rtl also does not create a program, so I will remove all, start clean and let you know..

DickvanNoort commented 6 years ago

OOPS, the compiled program is not called acarsdec but acarsdec.sdrplay

If this is as expected you might want to update the README.

pi@MYPI-16B:~/acarsdec $ ./acarsdec.sdrplay -v -s 131.525 131.725 131.825 Fc = 131850000, phase = -1.021018 (-325000.000000) Fc = 131850000, phase = -0.392699 (-125000.000000) Fc = 131850000, phase = -0.078540 (-25000.000000) SDRplay_RSPI_VID_1DF7&PID_2500_BUS_001_PORT_002 B0001P0002 SDRplay device selects freq 131850000 and sets 39 as gain reduction Decoding 3 channels

3 too long

Not sure what the '#3 too long' means. But that might become another issue.

Thanks, Dick

DickvanNoort commented 6 years ago

OOPS, the compiled program is not called acarsdec but acarsdec.sdrplay

If this is as expected you might want to update the README.

pi@MYPI-16B:~/acarsdec $ ./acarsdec.sdrplay -v -s 131.525 131.725 131.825 Fc = 131850000, phase = -1.021018 (-325000.000000) Fc = 131850000, phase = -0.392699 (-125000.000000) Fc = 131850000, phase = -0.078540 (-25000.000000) SDRplay_RSPI_VID_1DF7&PID_2500_BUS_001_PORT_002 B0001P0002 SDRplay device selects freq 131850000 and sets 39 as gain reduction Decoding 3 channels

3 too long

Not sure what the '#3 too long' means. But that might become another issue.

Thanks, Dick