Announcement

Collapse
No announcement yet.

Is the 124kB limit forever?

Collapse
X
  • Time
  • Show
Clear All
new posts

  • #16
    Interesting.
    I changed the server to send "Content-Type application/json", and that fixed the problem.
    Seems the fr645m is sensitive, but the fr935 is insensitive to this setting.
    I've been in blissful ignorance until the new devices arrived.

    Thanks for the advice.
    raceQs sailboat racing app.

    Comment


    • #17
      No problem.
      Last edited by WillNorthYork; 11-05-2018, 07:54 PM.

      Comment


      • #18
        Originally posted by RaceQs View Post
        In both cases, Settings > Connection Type > WiFi > returns Connected.
        By default this will be Connected for all devices with music support. As I said originally, if you want to disable the WiFi code path (and avoid this inconsistency) you need to change the value to Not Available before making the call to makeWebRequest().

        Originally posted by RaceQs View Post
        I am requesting JSON .. and getting the same content back with both devices, so why would it succeed on fr935 and fail on fr645m?
        I explained this above...

        Originally posted by Travis.ConnectIQ View Post
        There are some differences in behavior when making requests over WiFi versus over Bluetooth.
        If you want to avoid the problem in the short term, you can disable the WiFi code path in testing as I mentioned above. To fix the problem, you'll have to either update your service to produce the appropriate headers to match the actual content, or write a wrapper around the service you are accessing.

        Comment


        • #19
          OK, All cleared up.
          I did not fully recognise that these newer devices had their own WiFi. Sorry, I'm only recently re-acquaintng myself with the Garmin devices.
          That explains why the behaviour differs.
          The difference is now clear to me: the older devices are relying on HTTP connectivity from the phone which seems insensitive to the incoming headers , whereas the newer devices have their own WiFi capability which is sensitive. With WiFi "Not Connected" they operate the same, with WiFi Connected, they are using the device's WiFi.
          So much to learn... so little time
          Many thanks for your patient assistance.
          raceQs sailboat racing app.

          Comment


          • #20
            The thing is Travis, should a non music provider app ever take the code path for a wifi connection in the sim? That's not what happens on devices.
            My Connect IQ Apps in the Store
            Facebook - Instagram -
            Twitter

            Comment


            • #21
              That was my initial understanding, but that has been amended a bit. At this time, access to WiFi is passive for non-music app types. If the WiFi happens to be on at the time makeWebRequest() is called, the request would go out over WiFi.

              I don't know of any plans, but it is possible that this could change in the future.

              Comment


              • #22
                So this means makeWebRequest() doesn't even necessarily need a phone connection anymore (I realize you wouldn't be able to count on it)? Or does the phone still need to be there, just the request doesn't pass through the phone? I haven't played with music apps yet but this would be a nice feature to be able to utilize. Does BT vs wifi connection impact battery noticeably?

                Comment


                • #23
                  I'm guessing it will only use wifi if there's currently a connection, as making the connection would take longer than just using BT. And there's probably only be a connection if you're syncing activities or music. Wifi is power hungry so not something that would be connected all the time.
                  My Connect IQ Apps in the Store
                  Facebook - Instagram -
                  Twitter

                  Comment


                  • #24
                    What he said.

                    Comment


                    • #25
                      I started this post as I'm running out of memory, and I'm struggling to understand memory usage, and here's an example.
                      My app runs in the sim on a Fenix5, using "Peak Memory" of 120.3 kB and Peak Objects 255.
                      On my device, it crashes, out of memory the first time it attempts to send data with makeWebRequest.
                      In the sim, I have activated "Simulate Data" and it's happily wandering the fields in KS,USA.
                      I know I'm pushing the envelope, but I'm now working in the dark as to where the memory is being used.

                      And BTW, when the watch is using WiFi, how does it negotiate the login?
                      Last edited by RaceQs; 11-07-2018, 05:15 PM.
                      raceQs sailboat racing app.

                      Comment


                      • #26
                        Login for the wifi is configured on the watch itself, with GE, or GCM You set the password when you add a network in the Wifi configuration. When you try to connect with wifi, wifi looks for networks it knows and uses the password to connect.
                        My Connect IQ Apps in the Store
                        Facebook - Instagram -
                        Twitter

                        Comment


                        • #27
                          Originally posted by jim_m_58 View Post
                          Login for the wifi is configured on the watch itself, with GE, or GCM You set the password when you add a network in the Wifi configuration. When you try to connect with wifi, wifi looks for networks it knows and uses the password to connect.
                          I guess you meant configured on the phone?

                          More memory strangeness.
                          My app crashes the f5 in the sim, but the fr645m (with 1019.7kB) reports Peak memory at 122.1 kB. The tests were running identical data from my canned track file and user input.

                          raceQs sailboat racing app.

                          Comment


                          • #28
                            You configure Wi-Fi networks one of three ways:
                            - On the watch itself (in the settings menu)
                            - On the Garmin Connect Mobile app (with watch connected via Bluetooth)
                            - On the Garmin Express PC/Mac desktop app (with watch connected via USB)

                            In all 3 methods, you can choose a Wi-Fi network that the watch can currently see, and enter the credentials which will be remembered. Or you can change the password for a network that was already configured.

                            Only GCM and GE allow you to add networks manually (i.e. networks that are not in range and/or not broadcasting SSID.)

                            Also, if the Wi-Fi network displays any kind of login webpage where you have to click through an agreement (like most public or private hotspots at coffee shops, malls, public transport, airports, hotels, etc.), it won't work with the watch. So for all practical purposes, it's gonna be a home or office network.
                            Last edited by WillNorthYork; 11-07-2018, 08:44 PM.

                            Comment


                            • #29
                              Thanks for the comprehensive response.
                              And I think I have sussed one aspect of the memory issue. The Peak Usage is not reliable. I don't think it's recognising the additional memory being used by
                              Code:
                              stringA += stringB
                              which, as Travis pointed out, requires double the space to create the new string.
                              raceQs sailboat racing app.

                              Comment


                              • #30
                                I took out the phoneConnected check in one of by background process that does com, and in the sim, with BLE "Not Connected", things ran fine with a Wifi connection.

                                I suspect it will be rare to see that condition on a real device as wifi isn't connected that frequently when the app runs.
                                My Connect IQ Apps in the Store
                                Facebook - Instagram -
                                Twitter

                                Comment

                                Working...
                                X