HTTP request over device Wi-Fi specification

I was reading in the documentation, regarding the http Communications moudule, that:

"Monkey C exposes a high level APIs to allow calls to basic web services through Garmin Connect Mobile"

Soruce: https://developer.garmin.com/connect-iq/core-topics/https/

  1. Does that mean that i can only make http request trough the Garmin Connect app ?

  2. By trying to make a http request with the Communications modules on a simulated device i've notice that i'm able to make a succesfull request even when i'm not connected to a phone device. Does that mean that i can also make a htt request over the Garmin device Wi-fi without passing trough the Garmin Connect app ?

  3. Is there any way to check programmatically if the Garmin devies have a built in network support ?
  • You can test for a connection and you can test for a phone connection (which is via BT). Thus, if you have the first and don't have the second, you know you have WiFi.

    Note that opening web pages in a browser can only be done through Garmin Connect. When there's a need to do that, my app checks for the phone connection.

    The WiFi only works on my real 1030+ but it seems a bit flaky. For example, the first use fails but the second use works (sort of like needing the connection to wake up). That behavior doesn't seem to exist if the BT connection to Garmin Connect is active.

    In any case, it shouldn't really matter as long as you have a connection. (For downloading courses, WiFi is much faster than BT.)

  • Do you know if there is any kind of api to specifiy on wich type of connection i want to send an http request ?
    For example if want to send it over the Garmin device Wi-fi instead of Garmin connect ?

  • No, there's no way of selecting what is used to make the connection. There is one function to make the request. (There are other functions for getting images and music.)

  • The bulk download sample could help (I've never tried to use if for a single makeWebRequest call and you may have to be plugged in to power).  On some edge devices, it will connect wifi (if available) if you aren't recording an activity, but in general, watches won't use wifi for this.

  • Does that mean that i can only make http request trough the Garmin Connect app ?

    I've been looking for the same.

    I want to make an IFTTT API call (HTTP Request) directly from the watch so I don't have to carry the phone while running; which was the whole reason to get a Garmin!

    I'm on a Fenix Saphire 6, so latest SDK version is fine.

    Did we get a definitate answer on whether the Device's WiFi can make a direct HTTP request (like it does to sync by itself) or whether Widgets/Apps *can only* make network connections via the Connect App acting as a proxy?

  • Best I've found so far is 

    https://developer.garmin.com/connect-iq/api-docs/Toybox/Communications.html#makeWebRequest-instance_function

    "Use Garmin Connect Mobile as a proxy to the web."

    which still implies it requies a mobile proxy 

  • That's not  quite right. I think that wasn't updated to reflect the newer devices.

    I can make a connection from a 1030+ to a website without GC mobile.

    The problem that I am having is that the 1030+ doesn't always have the WiFi connection.

    Having GC appears to make that more reliable.

    I think what happens is that the WiFi connection is turned off and has to be restarted (and having GC makes that faster).

    I'm wondering if asking for the connection again might make it work (but I haven figured out a way of doing that, since there's no way of waiting/sleeping in IQ).

  • Awesome, thanks for the reply @dpawlyk.

    I'll continue to write my own and report back.

    Didn't want to invest time if it relied upon the mobile proxy, so am currently trially few other apps I've found in the IQ store.

    In your project, have you've used the same code and it's the watch that decides which connection it attempts - WiFi direct if not in your observed "flakey" state otherwise via GC with BTLE?

    i.e. you didn't do anything special to have the widget/app attempt wifi?

  • I have an Edge 1030+ (not a watch).

    My app (which works on watches!) 1- downloads fit files and 2- opens web pages on your phone.

    1- works without GC (outside of the flakiness issue).

    2- requires GC (the app asks GC to open the page).

    I have to verify both (depending on what the app is trying to do).

    You might be able to use my app to see how things work. You can download RWGPS courses using a number (kind of tedious) or, if you have a RWGPS account, you can download pinned courses.

  • It might be that the flaky behavior is a bug in the 1030+.