[Android] Reading Logbook result in timeout error

Issue #91 open
Fabio Catinella created an issue

I’m trying to read data from logbook using

private static final String URI_MDS_LOGBOOK_DATA = "suunto://MDS/Logbook/{0}/ById/{1}/Data";
private static TimeOutConfig timeOutConfig = new TimeOutConfig(0);
private static String jsonConfig = new Gson().toJson(timeOutConfig, TimeOutConfig.class);
...
Mds mds = Mds.builder().build(this);
....
String logDataUri = MessageFormat.format(URI_MDS_LOGBOOK_DATA, serial, id);
        mds.get(logDataUri, jsonConfig, new MdsResponseListener() {
            @Override
            public void onSuccess(final String data) {
                callback.onSuccess(data);
            }

            @Override
            public void onError(MdsException e) {
                callback.onError(e.getStatusCode());
            }
        });

However, this result in :

E/Komposti: Logbook::get: Failed to read data.
E/Komposti: [SDS RESPONSE] type: GET status: REQUEST_TIMEOUT header: {"TaskId": 33, "Uri": "suunto://MDS/Logbook/174530000126/ById/18/Data", "Content-Length": 0, "Reason": "REQUEST_TIMEOUT", "Status": 408}

when logbook contains a 10 minutes session, with shorter session this doesn't happen.

MOBILE DEVICE : Oneplus 5t (Android 10), Asus Zenfone 4 (Android 8.0)

MOVESENSE-LIB-Version: 1.39.0

MOVESENSE-FIRMWARE-Version: 1.9.4

MOVESENSE MODEL : OP174

Comments (5)

  1. Petri Lipponen

    Can you provide more info about what have you logged and how much data the log should contain? When you run it you should also see in logcat the individual GETs to the sensors logbook service: are those coming regularly or not?

  2. Fabio Catinella reporter

    Hi Petri.

    Can you provide more info about what have you logged and how much data the log should contain?

    I’m trying to log a 10 minutes running session. Data from sessions are saved with a frequency of 13Hz using IMU6.

    When you run it you should also see in logcat the individual GETs to the sensors logbook service: are those coming regularly or not?

    Yep, GETs are coming regularly. Here’s the console log

    I/DataLoggerSin: GET LogEntries successful: {"elements": [{"Id": 18, "ModificationTimestamp": 1420070925, "Size": null}, {"Id": 45, "ModificationTimestamp": 1420070715, "Size": null}, {"Id": 75, "ModificationTimestamp": 1420070715, "Size": null}]}
    D/DataLoggerSin: Entry: 18 : 1420070925 : null
    D/DataLoggerSin: Entry: 45 : 1420070715 : null
    D/DataLoggerSin: Entry: 75 : 1420070715 : null
    

    The issue occurs when i try to read data from a single log entry.

  3. Petri Lipponen

    Sorry, I wasn’t clear. The GET /MDS…Logbook/…/Data will perform multiple GET’s to the sensor that you will be able to see in the logcat (assuming debug build and logging is enabled). That info is the one that I’m interested. If you could GET the full logcat that includes those…

    Another thing: I’m sure you are aware that 10 minute recording with IMU6@13Hz will almost fill the data memory (~415 B/s). If you have not stopped recording before GETing the data the Logbook will be reading from the file that is probably being written over (since Logbook is a ring buffer). That will definitely cause issues, so please make sure that that is not happening by stopping recording before GET /Data.

  4. Log in to comment