Help with send data to a local server

I am attempting to report live data to a local server but have been unable to figure out the best way to do it or if the method from the documentation works. I am used to java and python but am more or less a beginner. I am aware that the data passes to the phone.

if also possible to send to a specific port and using udp with a parameter name and value.

  • UPDATE: Ok so it works now, after following some other discussions Ive found that if you want to send something to a local server set your url to localhost or http://127.0.0.1:5000 (port can be anything) then create a port forward rule using an app on android pointing to your server or endpoint. 

    For some reason the network traffic will not get sent out from the garmin connect app?

  • Well, with http://127.0.0.1, traffic is going out of the app but just to the local machine.

    If you want to go to the rest of the internet, Garmin requires you to use https.

  • Yes, that's the thing I posted about starting with version 4.20 of GCM, and using http:.  You need https if going to a server that's not on the phone, but using the phone.  If you use https with a proper certificate you can go directly without port forwarding.

  • If you're trying to send live data to a local server, using Java or Python is a solid choice.For Java, you might want to check out the DatagramSocket class for UDP communication. It allows you to specify a specific port and send data with parameter names and values. For Python, the socket module can help you achieve similar functionality.If you're still looking for info, I suggest diving into some online tutorials or checking out the official documentation for these languages. Also, consider using dedicated server hosting for your project. It can provide better performance and reliability. Check out https://www.ewebguru.com/dedicated-server-hosting.html for more details.

  • Sorry to post on an old thread, but since somebody else resurrected it….

    TL;DR The difference between CIQ and other implementations is that CIQ requires https for private networks (except for localhost), while pretty much everyone else allows http for private networks.

    So it’s not surprising to me that new (and seasoned) CIQ developers would be surprised or frustrated by Garmin’s policy here.

    Similar to makeWebRequest’s strict response requirements, this security policy seems to be a bit too restrictive.

    In both cases, devs have to use some sort of proxy / forwarding service to work around a CIQ limitation.

    Well, with http://127.0.0.1, traffic is going out of the app but just to the local machine.

    If you want to go to the rest of the internet, Garmin requires you to use https.

    It seems that you’re implying there’s only two possibilities here:

    - localhost / 127.0.0.1, where garmin allows you to use http

    - everything else / “the rest of the internet” (in your words), where garmin requires you to use https with a valid certificate

    Yeah, that’s how garmin sees it, but most other implementations (including most popular desktop and mobile browsers / OSs) have a more nuanced way of looking at things:

    - localhost: http is allowed

    - local / private network (i.e. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/12): http is allowed 

    - public network (what I tend to think of as “the rest of the internet” *): https is required

    (* when most people say “the internet”, they mean the “public internet”. I would argue that, informally speaking, most people would not think of a private home/work network as being “part of the internet”. e.g. Most mobile or desktop OSs will inform you to you have “no internet connection” when your device is unable to talk to servers on the public internet.)

    I only bring this up because the history of the issue went like this:

    - In some cases, Garmin used to allow http for connections to all kinds of addresses, depending on how you connected (i.e. Wi-Fi, Connect iOS, Connect Android)

    - At some point, to unify the various connection methods, Garmin required https for all connections. This caused a huge outcry bc it broke all kinds of apps that talked to a local server

    - To address the backlash, Garmin added an exception only for 127.0.0.1

    But if you look at the comments on the related bug report, several devs still wish that CIQ would follow other implementations and also allow http on private networks.

  • Yes.


    HTTPS should only be required for “internet” access. 

    HTTP should work for “intranet” (private) access.

    —————————-

    My 1030+ doesn’t need https for intranet access. 

  • My 1030+ doesn’t need https for intranet access. 

    As discussed, that's because your Edge is using Wi-Fi for networks requests, which isn't subject to the same limitations as a watch that connects with bluetooth via their phone running the Connect app. Also as discussed, even watches that support wi-fi will rarely use it for CIQ network requests - I think this is to save battery.

    When watches connect via bluetooth, they can only use http for 127.0.0.1 and not for intranet/private networks. Although a few devs complained about this when Garmin made the 127.0.01 exception to the https-only policy, it looks like they're not going to reverse this decision.