-
Notifications
You must be signed in to change notification settings - Fork 610
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
Queue sending to a custom URL and send every x minutes #918
Comments
And this appears to be not working presently. Today, for instance, I had the app up on the screens with functioning GPS but data communication offline and no data reports were ever uploaded upon return to data communication. |
For my understanding of the goal - is it basically to have more reliable sending of Custom URL points? This is somewhat similar to how the OpenGTS feature operates right now. OpenGTS logging will queue it up right away. Then every 60 minutes, or when pressing stop, or when the user uses the 'upload' menu, the code reads the GPX file and reconstructs the OpenGTS URLs, then re-sends it to the server. I could think of something similar to do with Custom URL 'auto send'. There are a few things different with a Custom URL 'auto send'. First one is, on the target server, you would need to be able to handle 'duplicates'. For example, use the timestamp or epoch sent when you receive the URL. In other words on the server side the write operation needs to be idempotent. Now the second and main one, it's the storage of the Custom URL data. Right now, the URL is constructed on t he fly, and queued up right away. There's a lot of types of data that could be sent via Custom URL. Here's the list so far
Unlike OpenGTS, it's not possible to reconstruct a Custom URL from a GPX file, because most of this data types shown above is simply not stored in GPX format. I would definitely need to store all these values in a separate data 'store'. So that when 60 minutes are up, or when user presses stop, or when the user chooses to send a file manually, these values are available. So... thinking about this, what about CSV. The CSV file format is pretty much a data store. And its columns look very close to Custom URL already. Here are its columns
What I could do is when auto-sending, just re-read the CSV file and reconstruct the URL and send its values out. I would need to add a few more columns to the existing CSV format, it should be possible. That will mean, the third thing - if a user wants Custom URL auto-sending, I will need to force CSV file writing to also be enabled. And when they choose to 'upload' a file to Custom URL, I'd present the CSV files. |
That's not a problem. It means a local backup that I could replay into the server |
Agreed, the goal is more reliable sending of Custom URL points when the device is frequently offline but recording. |
I think the unreliability is due to the increasing throttling that Android has been applying in each new version of the OS. Each new release there are additional restrictions on background processing, and location data. Both of which this app makes use of. Their aim is to improve battery life as well as unrestricted data siphoning, so they do this by throttling or restricting background tasks from running, which actually is understandable. That in turn affects GPSLogger, because the background tasks used as part of the queueing and sending can be killed off and there isn't a recovery from that. I'm also using quite an old job queueing library, and I ought to be moving onto the newer libraries for this, called JobScheduler, but even on that page are big red warnings:
|
I will spend some time exploring the CSV file aspect since there's more data to manage now. It's likely a library will be needed, probably the Apache Common CSV one. |
Custom URL can now be used as an auto sender, such as every 60 minutes or when stop is pressed. You can also 'upload' the CSV file to the Custom URL sender, and the values will be read and converted to URLs and sent to the server. This should serve as a way to mitigate any lost Custom URLs or do away with offline queueing problems. You will need to ensure that the Custom URL server can receive the same log lines multiple times. I've put a test APK here: https://github.com/mendhak/gpslogger/releases/tag/v119-rc1 |
v119 is now on F-Droid and in the releases. I'm going around and closing some issues. |
The system already, from what I understand, will queue if offline. Instead of sending every point to a custom URL, queue points and send every X number of minutes. This is similar to the concept of the Auto-Send.
This would essentially be a way to record an entire journey, but not to be constantly sending it.
The text was updated successfully, but these errors were encountered: