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

AIS-catcher-for-Android stops receiving #6

Closed
syspart opened this issue Sep 8, 2022 · 16 comments
Closed

AIS-catcher-for-Android stops receiving #6

syspart opened this issue Sep 8, 2022 · 16 comments
Assignees

Comments

@syspart
Copy link

syspart commented Sep 8, 2022

I have a no name rtl dongle.
When I start I get 20 to 60 Messages, and than it stops.
Even when I start the app again, or reattach the dongle, I only 0 to 2 new messages.
With the same setting, dongle and antenna, with windows 10 and SDRangel I get a continous stream of NMEA messages
Any idea what is wrong?

@jvde-github
Copy link
Owner

jvde-github commented Sep 8, 2022

Hi! Thanks. I have not seen this before personally. Any information on the phone and Android version? In what state is the program if it stops (background)? And if it restarts do you see the "data received" counter still running?

The only thing I can think of is some battery optimization on the phone that does not grant the app the necessary running time after a while. I would play around a bit with the battery optimization settings for the app and see if that fixes it.

You could also try another RTL-SDR app and see if it shows the same problem? Then we can conclude it is the App and not the phone. For example, run https://play.google.com/store/apps/details?id=marto.rtl_tcp_andro. AIS-catcher can connect to this app to get the data from the dongle (via source = RTL-TCP driver).

@jvde-github jvde-github self-assigned this Sep 8, 2022
@syspart
Copy link
Author

syspart commented Sep 9, 2022

The first device is a pixel 6 and android 13.
Now I tested it with samsung galaxy s5 and lineageos android version 11.
On lineage it starts with 25 messages.
Than I deleted AIS-catcher restart the s5 installed ais-catcher reattach the dongle. And now I get 8 messages. Now I put the dongel in a freezer :-).
And after 10 min back, I receive new messages.
So its a temperature problem with the device.
But as stated before, with SDRangel there is no problem with the temperature, the dongle is little warm, and it gets the messages.

@syspart
Copy link
Author

syspart commented Sep 9, 2022

So with the cooled device I get 240 messages.
Data received counter is going on, but no more message are comming.

@jvde-github
Copy link
Owner

That freezer angle is funny. Thanks. So it is possible then that the heating of the device is causing some frequency drift that stops the app from properly receiving messages. If data is still coming in but nothing being picked up, that could be an explanation.

Does not explain why it is running so hot on Android. In principle SDRangel and AIS-catcher are both using libusb and the rtlsdr library. The logic should not be too different.

I did a run for >6 hours running the App reporting to MarineTraffic without the issues you seem to experience. Either Android implementation needs to be tweaked (I will do some testing as well with dongles comparing Windows and Android), or Android does not like this particular dongle for whatever reason or could it have to do with an OTG cable somehow?

@syspart
Copy link
Author

syspart commented Sep 9, 2022

On both systems the dongle dont get hot. Maybe hand warm.

@jvde-github
Copy link
Owner

Yes, sorry, you did not say that, only that it seems to be temperature related. Will see if I can replicate with a blue dongle but I would try if swapping the OTG cable resolves the issue.

@syspart
Copy link
Author

syspart commented Sep 9, 2022

The otg should not be the problem. They are different for pixel (usb-c) and micro-usb for the s5.
I don't know how this hole stuff works, but when SDRangel uses a little different filter, which is not so vulnerable for a little frequency shift.
But I am only guessing.

@jvde-github
Copy link
Owner

jvde-github commented Sep 9, 2022

Ok, clear. If that is the case you would see a similar issue if you use AIS-catcher for Windows (https://github.com/jvde-github/AIS-catcher) which then should receive less messages than SDRangel on Windows. And then I think we can fix it (either by using a second algorithm embedded in AIS-catcher or introducing an extra setting making the App more forgiving on frequency drifts, the development version already has a switch -go CGF_WIDE on as experimental feature).

@jvde-github
Copy link
Owner

I think AIS-catcher allows +/- 4 ppm deviation in frequency before it starts to struggle which makes sense if there is no thermal drift as it gives a little bit of slack for the receiver and the sender.

The other way to test this hypothesis of thermal drift is to, once no more messages are detected but data is still streaming, stop the detection, go to settings and find a PPM settings that possibly works and start again (settings only become effective when reception is started).

@syspart
Copy link
Author

syspart commented Sep 10, 2022

There is a shift to ~ -10ppm. Sometimes -16ppm. It depends on how long it is running, or if I heat it up with my hand.
But it was tricky, first I had to know, it could go downwards, and then testing it step by step.
And after of lot of start and stops, the buttons at the bottom ditn't react any longer (Stop, clear, rtlsdr). But I could open the hamburger menu and go into settings. I had to clear app data and cache. Couldn't reproduce it, but it happened 2x.

@jvde-github
Copy link
Owner

jvde-github commented Sep 10, 2022

Ok, great, thanks for testing! Then it is definitely thermal shift of this particular dongle then. I have added two new settings to the App and will upload soon (in an hour or tomorrow). Hopefully this gives some extra settings to overcome this issue.

@jvde-github
Copy link
Owner

jvde-github commented Sep 10, 2022

Hello. I have created a new release with some extra options (https://github.com/jvde-github/AIS-catcher-for-Android/releases/tag/v0.21) and made this version also available in the Play store.

If you go to Settings there is now a Receiver section at the bottom with a setting named "Applied Frequency Correction". One thing you could try is to change this settings from Default -> Wide.

A second thing you could try (if that does not work) is to change the setting "Receiver Decoding Model" from Default to FM decoding. Had a look at the SDRangel code and it uses this method plus it corrects for DC offsets which AIS-catcher in this model does not do so this might not be the best solution against thermal drift. Not sure I have appetite to add it as it is not the default decoding model.

These models can better cope with frequency drift but are less sensitive and therefore might identify fewer messages (i.e. no free lunch).
For other dongles which do not have this problem I would not advice to use these options.

Hope this works for you.

@syspart
Copy link
Author

syspart commented Sep 11, 2022

With applied frequency correction it is all fine.
I get 450 messages with 120 MB.
Thanks

@syspart syspart closed this as completed Sep 11, 2022
@jvde-github
Copy link
Owner

Amazing, thanks for persevering to get to the bottom of this.

@syspart
Copy link
Author

syspart commented Sep 11, 2022

By the way, where do I get a openCPN map for the northsea.
Download from https://alpha.openseamap.org/ did not work for me.
And the kap map I found on wiki.openseamap.org have a terrible scale.

@jvde-github
Copy link
Owner

Don't know sorry,

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

No branches or pull requests

2 participants