Ticket Created
over 2 years ago

CA-83342

Transferred

Communication Module doesn't work properly when Garmin Connect looses internet

Hi,

when Garmin Connect Android app looses internet access, CIQ apps no longer gets proper responses from local HTTP server when getting binary data (either via makeImageRequest or  makeWebRequest with HTTP_RESPONSE_CONTENT_TYPE_FIT). Instead they get response with UNKNOWN_ERROR or strangely some cached data from "similar" older request when internet was available.

Loosing internet access can of course happen when 
smartphone without wifi looses signal to cellular network or is switched to fly-mode (without turning-off BLE) - so this can be easily simulated.  

Seems like this was introduced in some recent Garmin Connect app update - this worked properly before.

I was able to confirm that this issue is on Garmin Connect side which provide BLE link between phone and Garmin and not elsewhere (http server for example). JSON requests seems to work properly under same conditions. 

This affect quite a lot apps in the CIQ store including 2020 CIQ Awards winner Locus Map. 

  • Using gimporter/gexporter one can clearly see, that HTTP_RESPONSE_CONTENT_TYPE_JSON works to `http://127.0.0.1`, while HTTP_RESPONSE_CONTENT_TYPE_FIT does not. So the Garmin Connect Android App does some filtering here!

  • I wonder if there is a way to import FIT/GPX via makeWebRequest without active internet connection in 2021?

    I often ride in areas with poor network coverage where it is almost impossible to pre-load one single track for the whole ride. So my workaround became gexporter/gimporter as it allows to load courses mid-ride without painful GCM experience (which in fact is useless when your phone doesn't have access to garmin servers).


    So I wonder why makeWebRequest doesn't properly work for HTTP_RESPONSE_CONTENT_TYPE_FIT/HTTP_RESPONSE_CONTENT_TYPE_GPX response types when GCM doesn't have connection to internet? Does GCM applies some server processing for GPX/FIT files?

  • PS: if you are reaching this via Google because your shiny new 1030+ isn't gimporting like your trusty old 1000 did, your problem is probably not this bug but the known issue with enabled WiFi that is mentioned on https://forums.garmin.com/developer/connect-iq/f/showcase/5150/gimporter-gexporter---import-fit-gpx-courses-from-your-android-phone

    I had already given up for a few weeks before I accidentally stumbled over that note

  • Another experimental data point:

    gimporter loading failed with data and WiFi disabled in android, but was successful with data disabled and WiFi to a disconnected router. It appears to be just a matter of nominal connectivity state and not an actual lack of uplink.

    Could it be possible that android is shutting down the entire network stack including loopback when connections are explicitly disabled? In that case a trivially simulated lack of connectivity might behave very different from a real life "deep in the forest" situation (and Garmin wouldn't really be able to fix it). On the other hand, "JSON works" and "strangely some cached data" are clear indications of Garmin involvement. Might even be two separate issues. Is anyone feeling sufficiently desperate to wrap XML or base64 in JSON?

  • 0 - UNKNOWN_ERROR 

    or

    in case of makeImageRequest for URLs (incl. params) which was requested before when online - code 200 + cached and obsoleted data from Garmin Connect (didn't know GC can cache requests :-o )