Fenix 7 WiFi setup, makeWebRequest throws BLE_CONNECTION_UNAVAILABLE

I'm new, exploring the capabilities of creating a watch app. Specifically, I would like to call Communications.makeWebRequest. I'm using the sample app as a test. 

        Communications.makeWebRequest(

            null,
            options,
            method(:response)
        );
I am getting -104, BLE_CONNECTION_UNAVAILABLE. The watch is a Fenix 7, WiFi is set up on the watch. If the watch can make use of WiFi, why is this failing with a bluetooth error?
I've looked through the forums.... one thing I saw that I'm wondering about is how Garmin Connect app plays into this. Does it have to be up and running and the watch app makes the internet call via the phone, specifically Garmin Connect? I didn't see that in any of the documentation and if the watch is WiFi connected, why can't the watch communicate directly with the internet?
Randy
  • By default it will use BLE to the phone and not wifi.  The -104 probably means that you aren't connected to your phone or GCM isn't running on it

  • To elaborate: Connect IQ apps only have permanent connectivity via BLE. While Wi-Fi may be available on the device, it is not maintained as a constant connection, to preserve battery life.

    If you want to use Wi-Fi, you must use a dedicated API that switches the app into what Garmin calls sync mode. In this mode, a built-in Garmin status screen is shown, the app can perform its tasks over Wi-Fi, and once finished, it returns to normal operation.

    Here is an overview of how that API works (scroll down to Wi-Fi):

    forums.garmin.com/.../connect-iq-3-1-connects-you-to-the-world

  • Thanks for that information. It is very helpful. I looked and I think replicated what the bulk download sample has implemented. I have my sync delegate all set up and call Communications.startSync(). I see my println statements in the log:

            System.println("Starting sync...");
            Communications.startSync();
            System.println("Starting sync... B");
    The device flips over to the sync screen and shows FAIL. No error message, nothing. I have System.println through the sync delegate including the initailize() and even in the getSyncDelegate in my AppBase.
        public function getSyncDelegate() as SyncDelegate? {
            System.println("getSyncDelegate called");
            Storage.setValue("lastError", "getSyncDelegate called");
            // have different delegates for different data types?
            return new $.SigmaCommunicationsSyncDelegate();
        }
    I never see these log statements in the log and I'm not sure what is causing the failure. Permissions has Communications selected. I've compared the bulk download sample and the above link on how to implement to my code and I'm not sure what I'm missing.
    Ideas?
  • I’m experiencing a very similar issue. However, in my case the “Sync Failed” message appears only occasionally. Most of the time it works, but every now and then the error shows up.

    Like you, I’m calling startSync2(), and the device displays “Sync Failed” without the code ever reaching getSyncDelegate().

    Unfortunately, I don’t have a solution yet.

    Here is my thread on this topic:

    forums.garmin.com/.../2008340

  • Progress.... success?

    I decided to upgrade the firmware on the Fenix 7. I tried to do that via just the watch but it wanted GCM app so I installed GCM on a phone, connected it to the watch and upgraded the watch firmware. At the same time, I upgraded connect IQ sdk to the latest. I rebuilt the app and installed it. (url is still the test url above)

    it worked!

    I don't want GCM as a dependency so to insure GCM isn't utilized, I uninstalled GCM and tried the app again.

    It worked!

    I'm not willing to call this 100% success until I replicate it on a fresh or reset watch. For the work we are doing, we side load the watch app and I need to test it hitting our specific URL.

    Maybe upgrading firmware and CIQ SDK will work for you?

  • Maybe upgrading firmware and CIQ SDK will work for you?

    I am already using the latest SDK and the latest firmware on my Epix Pro Gen 2.

    The app is still in beta, and none of the testers have reported this issue so far. I will wait and see whether it gets reported once I roll out the Wi-Fi version to a wider audience.