Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is not a PR !! #15

Closed
wants to merge 1 commit into from
Closed

This is not a PR !! #15

wants to merge 1 commit into from

Conversation

MatsA
Copy link

@MatsA MatsA commented Jul 14, 2019

Sorry but couldn't create an "Issue", so trying this way instead.

I really like this software and have written a blogpost about it for some time ago https://pysselilivet.blogspot.com/2018/06/ais-reciever-for-raspberry.html

but now there are two issues on RPi 4 and buster

1/ A bug which soon will be fixed raspberrypi/linux#3060
2/ I'm a C newbie and can't compile the code, but it works nice on RPi 3 and Stretch. Please check log below. Any ideas ?

i@raspberrypi:~/rtl-ais $ make
cc main.o rtl_ais.o convenience.o ./aisdecoder/aisdecoder.o ./aisdecoder/sounddecoder.o ./aisdecoder/lib/receiver.o ./aisdecoder/lib/protodec.o ./aisdecoder/lib/hmalloc.o ./aisdecoder/lib/filter.o ./tcp_listener/tcp_listener.o -o rtl_ais -lpthread -lm -L -lrtlsdr
/usr/bin/ld: rtl_ais.o: in function rtlsdr_thread_fn': /home/pi/rtl-ais/rtl_ais.c:368: undefined reference to rtlsdr_read_async'
/usr/bin/ld: rtl_ais.o: in function rtl_ais_start': /home/pi/rtl-ais/rtl_ais.c:570: undefined reference to rtlsdr_open'
/usr/bin/ld: /home/pi/rtl-ais/rtl_ais.c:610: undefined reference to rtlsdr_set_agc_mode' /usr/bin/ld: /home/pi/rtl-ais/rtl_ais.c:595: undefined reference to rtlsdr_cancel_async'
/usr/bin/ld: /home/pi/rtl-ais/rtl_ais.c:596: undefined reference to rtlsdr_close' /usr/bin/ld: rtl_ais.o: in function rtl_ais_cleanup':
/home/pi/rtl-ais/rtl_ais.c:657: undefined reference to rtlsdr_cancel_async' /usr/bin/ld: /home/pi/rtl-ais/rtl_ais.c:668: undefined reference to rtlsdr_cancel_async'
/usr/bin/ld: /home/pi/rtl-ais/rtl_ais.c:673: undefined reference to rtlsdr_close' /usr/bin/ld: convenience.o: in function nearest_gain':
/home/pi/rtl-ais/convenience.c:116: undefined reference to rtlsdr_set_tuner_gain_mode' /usr/bin/ld: /home/pi/rtl-ais/convenience.c:121: undefined reference to rtlsdr_get_tuner_gains'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:126: undefined reference to rtlsdr_get_tuner_gains' /usr/bin/ld: convenience.o: in function verbose_set_frequency':
/home/pi/rtl-ais/convenience.c:142: undefined reference to rtlsdr_set_center_freq' /usr/bin/ld: convenience.o: in function verbose_set_sample_rate':
/home/pi/rtl-ais/convenience.c:154: undefined reference to rtlsdr_set_sample_rate' /usr/bin/ld: convenience.o: in function verbose_direct_sampling':
/home/pi/rtl-ais/convenience.c:166: undefined reference to rtlsdr_set_direct_sampling' /usr/bin/ld: convenience.o: in function verbose_offset_tuning':
/home/pi/rtl-ais/convenience.c:183: undefined reference to rtlsdr_set_offset_tuning' /usr/bin/ld: convenience.o: in function verbose_auto_gain':
/home/pi/rtl-ais/convenience.c:195: undefined reference to rtlsdr_set_tuner_gain_mode' /usr/bin/ld: convenience.o: in function verbose_gain_set':
/home/pi/rtl-ais/convenience.c:207: undefined reference to rtlsdr_set_tuner_gain_mode' /usr/bin/ld: /home/pi/rtl-ais/convenience.c:212: undefined reference to rtlsdr_set_tuner_gain'
/usr/bin/ld: convenience.o: in function verbose_ppm_set': /home/pi/rtl-ais/convenience.c:226: undefined reference to rtlsdr_set_freq_correction'
/usr/bin/ld: convenience.o: in function verbose_ppm_eeprom': /home/pi/rtl-ais/convenience.c:241: undefined reference to rtlsdr_get_usb_strings'
/usr/bin/ld: convenience.o: in function verbose_reset_buffer': /home/pi/rtl-ais/convenience.c:266: undefined reference to rtlsdr_reset_buffer'
/usr/bin/ld: convenience.o: in function verbose_device_search': /home/pi/rtl-ais/convenience.c:277: undefined reference to rtlsdr_get_device_count'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:284: undefined reference to rtlsdr_get_device_usb_strings' /usr/bin/ld: /home/pi/rtl-ais/convenience.c:297: undefined reference to rtlsdr_get_device_usb_strings'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:301: undefined reference to rtlsdr_get_device_name' /usr/bin/ld: /home/pi/rtl-ais/convenience.c:307: undefined reference to rtlsdr_get_device_usb_strings'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:317: undefined reference to rtlsdr_get_device_usb_strings' /usr/bin/ld: /home/pi/rtl-ais/convenience.c:324: undefined reference to rtlsdr_get_device_name'
collect2: error: ld returned 1 exit status
make: *** [Makefile:56: rtl_ais] Error 1

Sorry but couldn't create an Issue, so trying this way instead.

Two issues on RPi 4 and buster

1/ A bug which soon will be fixed raspberrypi/linux#3060
2/ I'm a C newbie and can't compile the code, but works nice on RPi 3 and Stretch. Please check log below. Any ideas ?

i@raspberrypi:~/rtl-ais $ make
cc main.o rtl_ais.o convenience.o ./aisdecoder/aisdecoder.o ./aisdecoder/sounddecoder.o ./aisdecoder/lib/receiver.o ./aisdecoder/lib/protodec.o ./aisdecoder/lib/hmalloc.o ./aisdecoder/lib/filter.o ./tcp_listener/tcp_listener.o -o rtl_ais -lpthread -lm -L -lrtlsdr
/usr/bin/ld: rtl_ais.o: in function `rtlsdr_thread_fn':
/home/pi/rtl-ais/rtl_ais.c:368: undefined reference to `rtlsdr_read_async'
/usr/bin/ld: rtl_ais.o: in function `rtl_ais_start':
/home/pi/rtl-ais/rtl_ais.c:570: undefined reference to `rtlsdr_open'
/usr/bin/ld: /home/pi/rtl-ais/rtl_ais.c:610: undefined reference to `rtlsdr_set_agc_mode'
/usr/bin/ld: /home/pi/rtl-ais/rtl_ais.c:595: undefined reference to `rtlsdr_cancel_async'
/usr/bin/ld: /home/pi/rtl-ais/rtl_ais.c:596: undefined reference to `rtlsdr_close'
/usr/bin/ld: rtl_ais.o: in function `rtl_ais_cleanup':
/home/pi/rtl-ais/rtl_ais.c:657: undefined reference to `rtlsdr_cancel_async'
/usr/bin/ld: /home/pi/rtl-ais/rtl_ais.c:668: undefined reference to `rtlsdr_cancel_async'
/usr/bin/ld: /home/pi/rtl-ais/rtl_ais.c:673: undefined reference to `rtlsdr_close'
/usr/bin/ld: convenience.o: in function `nearest_gain':
/home/pi/rtl-ais/convenience.c:116: undefined reference to `rtlsdr_set_tuner_gain_mode'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:121: undefined reference to `rtlsdr_get_tuner_gains'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:126: undefined reference to `rtlsdr_get_tuner_gains'
/usr/bin/ld: convenience.o: in function `verbose_set_frequency':
/home/pi/rtl-ais/convenience.c:142: undefined reference to `rtlsdr_set_center_freq'
/usr/bin/ld: convenience.o: in function `verbose_set_sample_rate':
/home/pi/rtl-ais/convenience.c:154: undefined reference to `rtlsdr_set_sample_rate'
/usr/bin/ld: convenience.o: in function `verbose_direct_sampling':
/home/pi/rtl-ais/convenience.c:166: undefined reference to `rtlsdr_set_direct_sampling'
/usr/bin/ld: convenience.o: in function `verbose_offset_tuning':
/home/pi/rtl-ais/convenience.c:183: undefined reference to `rtlsdr_set_offset_tuning'
/usr/bin/ld: convenience.o: in function `verbose_auto_gain':
/home/pi/rtl-ais/convenience.c:195: undefined reference to `rtlsdr_set_tuner_gain_mode'
/usr/bin/ld: convenience.o: in function `verbose_gain_set':
/home/pi/rtl-ais/convenience.c:207: undefined reference to `rtlsdr_set_tuner_gain_mode'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:212: undefined reference to `rtlsdr_set_tuner_gain'
/usr/bin/ld: convenience.o: in function `verbose_ppm_set':
/home/pi/rtl-ais/convenience.c:226: undefined reference to `rtlsdr_set_freq_correction'
/usr/bin/ld: convenience.o: in function `verbose_ppm_eeprom':
/home/pi/rtl-ais/convenience.c:241: undefined reference to `rtlsdr_get_usb_strings'
/usr/bin/ld: convenience.o: in function `verbose_reset_buffer':
/home/pi/rtl-ais/convenience.c:266: undefined reference to `rtlsdr_reset_buffer'
/usr/bin/ld: convenience.o: in function `verbose_device_search':
/home/pi/rtl-ais/convenience.c:277: undefined reference to `rtlsdr_get_device_count'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:284: undefined reference to `rtlsdr_get_device_usb_strings'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:297: undefined reference to `rtlsdr_get_device_usb_strings'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:301: undefined reference to `rtlsdr_get_device_name'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:307: undefined reference to `rtlsdr_get_device_usb_strings'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:317: undefined reference to `rtlsdr_get_device_usb_strings'
/usr/bin/ld: /home/pi/rtl-ais/convenience.c:324: undefined reference to `rtlsdr_get_device_name'
collect2: error: ld returned 1 exit status
make: *** [Makefile:56: rtl_ais] Error 1
@dgiardini
Copy link
Owner

dgiardini commented Jul 14, 2019 via email

@MatsA
Copy link
Author

MatsA commented Jul 15, 2019

Hi and thanks for Your quick answer and time.
Started all over with a fresh Buster Lite install on a RPi 4 which ended up with the same fault. Please find enclosed the installation log and hope that it will give a hint.
Did a sudo find -name "librtlsdr*" at the end.
Thanks Mats
rtl-ais_install_2019-07-15.txt

@MatsA MatsA closed this Jul 15, 2019
@MatsA MatsA reopened this Jul 15, 2019
@dgiardini
Copy link
Owner

dgiardini commented Jul 15, 2019 via email

@MatsA
Copy link
Author

MatsA commented Jul 15, 2019

.... getting closer
$ pkg-config --libs librtlsdr just returned
-L -lrtlsdr
which seems to be wrong, so edited the Makefile and changed to
LDFLAGS+=-lpthread -lm /usr/lib/arm-linux-gnueabihf/, without the "-L" it worked better.
and the compile vent much further but still some error.
Please check enclosed log file.
rtl-ais_install_2019-07-15_II.txt

@dgiardini
Copy link
Owner

dgiardini commented Jul 15, 2019 via email

@MatsA
Copy link
Author

MatsA commented Jul 15, 2019

Nice ! Worked !
Thanks for the help, really appreciated.

pi@raspberrypi:~/rtl-ais $ file rtl_ais
rtl_ais: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=b2dd7b7de7da563e0836a174e9f4e63d9826600f, with debug_info, not stripped

Is there someone who should be notified about the pkg "thing" ?
/Mats

@dgiardini
Copy link
Owner

dgiardini commented Jul 15, 2019 via email

@MatsA
Copy link
Author

MatsA commented Jul 16, 2019

Hi ! Seems that this is already reported https://bugs.launchpad.net/ubuntu/+source/rtl-sdr/+bug/1831387

@FredericGuilbault
Copy link

FTR, I just test it with my setup and it. Also append on minimal Debian buster, armbian(Pine64so), qemu-armhf and qemu-arm64.

So pretty much anywhere I could test it.

@FredericGuilbault
Copy link

Maybe it's time to close this tread

@dgiardini dgiardini closed this Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pi 4: rtl_test hangs with RTL2838U chips
3 participants