Acknowledged
CIQQA-3928

Simulator enforces lower JSON size limit than real devices in SDK 9.1

It seems that SDK 9.1 introduced changes to how the simulator handles JSON size limits. The release notes state:

“Enforce max JSON response size limit for BLE web request.”

However, it now appears that the limits enforced by the simulator are lower than those on real devices.

I have attached an example JSON. It works correctly on my Epix Pro Gen 2 using a sideloaded app compiled with SDK 9.1. In the simulator, the same JSON now results in a -402 error.

 

{"name":"garmin_test","label":"Test Sitemap","link":"http://net-nas-1:8080/rest/sitemaps/garmin_test","homepage":{"id":"garmin_test","title":"Test Sitemap","link":"http://net-nas-1:8080/rest/sitemaps/garmin_test/garmin_test","leaf":false,"timeout":false,"widgets":[{"widgetId":"00","type":"Frame","visibility":true,"label":"Groups","labelSource":"SITEMAP_WIDGET","icon":"frame","staticIcon":false,"unit":"","mappings":[],"widgets":[{"widgetId":"0000","type":"Group","visibility":true,"label":"Switches [(2)]","labelSource":"SITEMAP_WIDGET","icon":"light","staticIcon":false,"pattern":"(%d)","unit":"","mappings":[],"item":{"members":[],"groupType":"Switch","function":{"name":"AND","params":["OFF","ON"]},"link":"http://net-nas-1:8080/rest/items/TEST_GROUP","state":"ON","lastStateUpdate":1772913530136,"lastStateChange":1772476722260,"type":"Group","name":"TEST_GROUP","label":"Test Group Switch","category":"light","tags":["Point"],"groupNames":["Test"]},"linkedPage":{"id":"0000","title":"Switches [(2)]","icon":"light","link":"http://net-nas-1:8080/rest/sitemaps/garmin_test/0000","leaf":true,"timeout":false,"widgets":[{"widgetId":"TEST_SWITCH2","type":"Switch","visibility":true,"label":"Test Switch 2","labelSource":"ITEM_LABEL","icon":"light","staticIcon":false,"unit":"","mappings":[],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_SWITCH2","state":"ON","lastStateUpdate":1772476500000,"type":"Switch","name":"TEST_SWITCH2","label":"Test Switch 2","category":"light","tags":["Point"],"groupNames":["Test","TEST_GROUP"]},"widgets":[]},{"widgetId":"TEST_SWITCH","type":"Switch","visibility":true,"label":"Test Switch 1","labelSource":"ITEM_LABEL","icon":"light","staticIcon":false,"unit":"","mappings":[],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_SWITCH","state":"ON","lastState":"OFF","lastStateUpdate":1772913530136,"lastStateChange":1772913530136,"type":"Switch","name":"TEST_SWITCH","label":"Test Switch 1","category":"light","tags":["Point"],"groupNames":["Test","TEST_GROUP"]},"widgets":[]}]},"widgets":[]},{"widgetId":"0001","type":"Switch","visibility":true,"label":"All","labelSource":"SITEMAP_WIDGET","icon":"light","staticIcon":false,"unit":"","mappings":[],"item":{"members":[],"groupType":"Switch","function":{"name":"AND","params":["OFF","ON"]},"link":"http://net-nas-1:8080/rest/items/TEST_GROUP","state":"ON","lastStateUpdate":1772913530136,"lastStateChange":1772476722260,"type":"Group","name":"TEST_GROUP","label":"Test Group Switch","category":"light","tags":["Point"],"groupNames":["Test"]},"widgets":[]},{"widgetId":"0002","type":"Switch","visibility":true,"label":"Switch 1","labelSource":"SITEMAP_WIDGET","icon":"light","staticIcon":false,"unit":"","mappings":[],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_SWITCH","state":"ON","lastState":"OFF","lastStateUpdate":1772913530136,"lastStateChange":1772913530136,"type":"Switch","name":"TEST_SWITCH","label":"Test Switch 1","category":"light","tags":["Point"],"groupNames":["Test","TEST_GROUP"]},"widgets":[]},{"widgetId":"0003","type":"Switch","visibility":true,"label":"Switch 2","labelSource":"SITEMAP_WIDGET","icon":"light","staticIcon":false,"unit":"","mappings":[],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_SWITCH2","state":"ON","lastStateUpdate":1772476500000,"type":"Switch","name":"TEST_SWITCH2","label":"Test Switch 2","category":"light","tags":["Point"],"groupNames":["Test","TEST_GROUP"]},"widgets":[]}]},{"widgetId":"01","type":"Frame","visibility":true,"label":"Generic Switch","labelSource":"SITEMAP_WIDGET","icon":"frame","staticIcon":false,"unit":"","mappings":[],"widgets":[{"widgetId":"0100","type":"Frame","visibility":true,"label":"Mappings","labelSource":"SITEMAP_WIDGET","icon":"frame","staticIcon":false,"unit":"","mappings":[],"widgets":[{"widgetId":"010000","type":"Switch","visibility":true,"label":"TV A [sCNN]","labelSource":"SITEMAP_WIDGET","icon":"screen","staticIcon":false,"pattern":"%s","unit":"","mappings":[{"command":"0","label":"mABC"}],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_TV","state":"2","stateDescription":{"pattern":"%s","readOnly":false,"options":[{"value":"0","label":"sABC"},{"value":"1","label":"sBBC"},{"value":"2","label":"sCNN"}]},"commandDescription":{"commandOptions":[{"command":"0","label":"cABC"},{"command":"1","label":"cBCC"},{"command":"2","label":"cCNN"}]},"lastState":"1","lastStateUpdate":1773306205264,"lastStateChange":1773306204322,"type":"String","name":"TEST_TV","label":"Test TV","category":"screen","tags":["Point"],"groupNames":["Test","TEST_GROUP2"]},"widgets":[]},{"widgetId":"010001","type":"Switch","visibility":true,"label":"TV A/B [sCNN]","labelSource":"SITEMAP_WIDGET","icon":"screen","staticIcon":false,"pattern":"%s","unit":"","mappings":[{"command":"0","label":"mABC"},{"command":"1","label":"mBBC"}],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_TV","state":"2","stateDescription":{"pattern":"%s","readOnly":false,"options":[{"value":"0","label":"sABC"},{"value":"1","label":"sBBC"},{"value":"2","label":"sCNN"}]},"commandDescription":{"commandOptions":[{"command":"0","label":"cABC"},{"command":"1","label":"cBCC"},{"command":"2","label":"cCNN"}]},"lastState":"1","lastStateUpdate":1773306205264,"lastStateChange":1773306204322,"type":"String","name":"TEST_TV","label":"Test TV","category":"screen","tags":["Point"],"groupNames":["Test","TEST_GROUP2"]},"widgets":[]},{"widgetId":"010002","type":"Switch","visibility":true,"label":"TV A/B/C [sCNN]","labelSource":"SITEMAP_WIDGET","icon":"screen","staticIcon":false,"pattern":"%s","unit":"","mappings":[{"command":"0","label":"mABC"},{"command":"1","label":"mBBC"},{"command":"2","label":"mCNN"}],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_TV","state":"2","stateDescription":{"pattern":"%s","readOnly":false,"options":[{"value":"0","label":"sABC"},{"value":"1","label":"sBBC"},{"value":"2","label":"sCNN"}]},"commandDescription":{"commandOptions":[{"command":"0","label":"cABC"},{"command":"1","label":"cBCC"},{"command":"2","label":"cCNN"}]},"lastState":"1","lastStateUpdate":1773306205264,"lastStateChange":1773306204322,"type":"String","name":"TEST_TV","label":"Test TV","category":"screen","tags":["Point"],"groupNames":["Test","TEST_GROUP2"]},"widgets":[]}]},{"widgetId":"0101","type":"Frame","visibility":true,"label":"Metadata","labelSource":"SITEMAP_WIDGET","icon":"frame","staticIcon":false,"unit":"","mappings":[],"widgets":[{"widgetId":"010100","type":"Switch","visibility":true,"label":"TV A [sCNN]","labelSource":"SITEMAP_WIDGET","icon":"screen","staticIcon":false,"pattern":"%s","unit":"","mappings":[{"command":"0","label":"mABC"}],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_TV","state":"2","stateDescription":{"pattern":"%s","readOnly":false,"options":[{"value":"0","label":"sABC"},{"value":"1","label":"sBBC"},{"value":"2","label":"sCNN"}]},"commandDescription":{"commandOptions":[{"command":"0","label":"cABC"},{"command":"1","label":"cBCC"},{"command":"2","label":"cCNN"}]},"lastState":"1","lastStateUpdate":1773306205264,"lastStateChange":1773306204322,"type":"String","name":"TEST_TV","label":"Test TV","category":"screen","tags":["Point"],"groupNames":["Test","TEST_GROUP2"]},"widgets":[]},{"widgetId":"010101","type":"Switch","visibility":true,"label":"TV A/B [sCNN]","labelSource":"SITEMAP_WIDGET","icon":"screen","staticIcon":false,"pattern":"%s","unit":"","mappings":[{"command":"0","label":"mABC"},{"command":"1","label":"mBBC"}],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_TV","state":"2","stateDescription":{"pattern":"%s","readOnly":false,"options":[{"value":"0","label":"sABC"},{"value":"1","label":"sBBC"},{"value":"2","label":"sCNN"}]},"commandDescription":{"commandOptions":[{"command":"0","label":"cABC"},{"command":"1","label":"cBCC"},{"command":"2","label":"cCNN"}]},"lastState":"1","lastStateUpdate":1773306205264,"lastStateChange":1773306204322,"type":"String","name":"TEST_TV","label":"Test TV","category":"screen","tags":["Point"],"groupNames":["Test","TEST_GROUP2"]},"widgets":[]},{"widgetId":"010102","type":"Switch","visibility":true,"label":"TV A/B/C [sCNN]","labelSource":"SITEMAP_WIDGET","icon":"screen","staticIcon":false,"pattern":"%s","unit":"","mappings":[],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_TV","state":"2","stateDescription":{"pattern":"%s","readOnly":false,"options":[{"value":"0","label":"sABC"},{"value":"1","label":"sBBC"},{"value":"2","label":"sCNN"}]},"commandDescription":{"commandOptions":[{"command":"0","label":"cABC"},{"command":"1","label":"cBCC"},{"command":"2","label":"cCNN"}]},"lastState":"1","lastStateUpdate":1773306205264,"lastStateChange":1773306204322,"type":"String","name":"TEST_TV","label":"Test TV","category":"screen","tags":["Point"],"groupNames":["Test","TEST_GROUP2"]},"widgets":[]}]}]},{"widgetId":"02","type":"Frame","visibility":true,"label":"Colors","labelSource":"SITEMAP_WIDGET","icon":"frame","staticIcon":false,"unit":"","mappings":[],"widgets":[{"widgetId":"0200","type":"Switch","visibility":true,"label":"TV A/B/C [sCNN]","labelSource":"SITEMAP_WIDGET","icon":"screen","staticIcon":false,"labelcolor":"yellow","valuecolor":"yellow","pattern":"%s","unit":"","mappings":[{"command":"0","label":"ABC"},{"command":"1","label":"BBC"},{"command":"2","label":"CNN"}],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_TV","state":"2","stateDescription":{"pattern":"%s","readOnly":false,"options":[{"value":"0","label":"sABC"},{"value":"1","label":"sBBC"},{"value":"2","label":"sCNN"}]},"commandDescription":{"commandOptions":[{"command":"0","label":"cABC"},{"command":"1","label":"cBCC"},{"command":"2","label":"cCNN"}]},"lastState":"1","lastStateUpdate":1773306205264,"lastStateChange":1773306204322,"type":"String","name":"TEST_TV","label":"Test TV","category":"screen","tags":["Point"],"groupNames":["Test","TEST_GROUP2"]},"widgets":[]}]},{"widgetId":"03","type":"Frame","visibility":true,"label":"Icons","labelSource":"SITEMAP_WIDGET","icon":"frame","staticIcon":false,"unit":"","mappings":[],"widgets":[{"widgetId":"0300","type":"Switch","visibility":true,"label":"Light","labelSource":"SITEMAP_WIDGET","icon":"light","staticIcon":false,"unit":"","mappings":[],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_SWITCH","state":"ON","lastState":"OFF","lastStateUpdate":1772913530136,"lastStateChange":1772913530136,"type":"Switch","name":"TEST_SWITCH","label":"Test Switch 1","category":"light","tags":["Point"],"groupNames":["Test","TEST_GROUP"]},"widgets":[]},{"widgetId":"0301","type":"Switch","visibility":true,"label":"Outlet","labelSource":"SITEMAP_WIDGET","icon":"poweroutlet","staticIcon":false,"unit":"","mappings":[],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_SWITCH","state":"ON","lastState":"OFF","lastStateUpdate":1772913530136,"lastStateChange":1772913530136,"type":"Switch","name":"TEST_SWITCH","label":"Test Switch 1","category":"light","tags":["Point"],"groupNames":["Test","TEST_GROUP"]},"widgets":[]},{"widgetId":"0302","type":"Slider","visibility":true,"label":"Slider [50 %]","labelSource":"SITEMAP_WIDGET","icon":"light","staticIcon":false,"pattern":"%.0f %%","unit":"","mappings":[],"switchSupport":false,"releaseOnly":false,"minValue":0,"maxValue":100,"step":10,"item":{"link":"http://net-nas-1:8080/rest/items/TEST_DIMMER","state":"50.000000","stateDescription":{"pattern":"%.0f %%","readOnly":false,"options":[]},"lastState":"60.000000","lastStateUpdate":1772719408323,"lastStateChange":1772719408323,"type":"Dimmer","name":"TEST_DIMMER","label":"Test Dimmer","category":"light","tags":["Point"],"groupNames":["Test","TEST_GROUP2"]},"widgets":[]},{"widgetId":"0303","type":"Switch","visibility":true,"label":"Shutters","labelSource":"SITEMAP_WIDGET","icon":"rollershutter","staticIcon":false,"unit":"","mappings":[],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_ROLLERSHUTTER","state":"100","lastState":"0","lastStateUpdate":1772813106839,"lastStateChange":1772810596939,"type":"Rollershutter","name":"TEST_ROLLERSHUTTER","label":"Test Rollershutter","category":"rollershutter","tags":["OpenLevel"],"groupNames":["Test"]},"widgets":[]},{"widgetId":"0304","type":"Switch","visibility":true,"label":"TV [Channel: sCNN]","labelSource":"SITEMAP_WIDGET","icon":"screen","staticIcon":false,"pattern":"Channel: %s","unit":"","mappings":[{"command":"0","label":"ABC"},{"command":"1","label":"BBC"},{"command":"2","label":"CNN"}],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_TV","state":"2","stateDescription":{"pattern":"%s","readOnly":false,"options":[{"value":"0","label":"sABC"},{"value":"1","label":"sBBC"},{"value":"2","label":"sCNN"}]},"commandDescription":{"commandOptions":[{"command":"0","label":"cABC"},{"command":"1","label":"cBCC"},{"command":"2","label":"cCNN"}]},"lastState":"1","lastStateUpdate":1773306205264,"lastStateChange":1773306204322,"type":"String","name":"TEST_TV","label":"Test TV","category":"screen","tags":["Point"],"groupNames":["Test","TEST_GROUP2"]},"widgets":[]},{"widgetId":"0305","type":"Text","visibility":true,"label":"Gates [50 %]","labelSource":"SITEMAP_WIDGET","icon":"garagedoor","staticIcon":false,"pattern":"%.0f %%","unit":"","mappings":[],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_DIMMER","state":"50.000000","stateDescription":{"pattern":"%.0f %%","readOnly":false,"options":[]},"lastState":"60.000000","lastStateUpdate":1772719408323,"lastStateChange":1772719408323,"type":"Dimmer","name":"TEST_DIMMER","label":"Test Dimmer","category":"light","tags":["Point"],"groupNames":["Test","TEST_GROUP2"]},"widgets":[]},{"widgetId":"0306","type":"Switch","visibility":true,"label":"Door [-]","labelSource":"SITEMAP_WIDGET","icon":"door","staticIcon":false,"pattern":"%s","unit":"","mappings":[{"command":"OPEN","label":"OPEN"},{"command":"CLOSED","label":"CLOSED"}],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_DOOR","state":"NULL","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"type":"String","name":"TEST_DOOR","label":"Test Door","category":"door","tags":["Point"],"groupNames":["Test"]},"widgets":[]},{"widgetId":"0307","type":"Switch","visibility":true,"label":"Frontdoor [-]","labelSource":"SITEMAP_WIDGET","icon":"frontdoor","staticIcon":false,"pattern":"%s","unit":"","mappings":[{"command":"OPEN","label":"OPEN"},{"command":"CLOSED","label":"CLOSED"}],"item":{"link":"http://net-nas-1:8080/rest/items/TEST_DOOR","state":"NULL","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"type":"String","name":"TEST_DOOR","label":"Test Door","category":"door","tags":["Point"],"groupNames":["Test"]},"widgets":[]},{"widgetId":"0308","type":"Text","visibility":true,"label":"Vehicle SoC [60%]","labelSource":"SITEMAP_WIDGET","icon":"batterylevel","staticIcon":false,"pattern":"%.0f%unit%","mappings":[],"item":{"link":"http://net-nas-1:8080/rest/items/evcc_KOG_Vehicle_SoC","state":"60 %","stateDescription":{"pattern":"%.0f%unit%","readOnly":false,"options":[]},"lastStateUpdate":1772476500000,"unitSymbol":"%","type":"Number:Dimensionless","name":"evcc_KOG_Vehicle_SoC","label":"Vehicle SoC","category":"BatteryLevel","tags":["Point"],"groupNames":["evcc_KOG"]},"widgets":[]}]}]}}

  • No, I've run into Out of Memory (-403 status) on older devices like the 520plus but it works fine on newer devices like the 830. Same logic app, same JSON payload. Both are BG processing. And the 403 status suggests it is the network payload I believe.

  • Sounds like you need to re-do how your app works.  Maybe instead of getting the whole json at once, get it in smaller pieces then merge them on the Garmin.

    Look for devices that are getting CIQ 6.x as that would be the first place I'd expect to see it.

    When it comes to memory limits, I always leave "breathing room" and don't push to the max, as in the past there have been cases where a new version of CIQ has resulted in less memory for things.

  • How close to the new max is your data?

    My data size is variable and depends on how users configure their setup. This is a home automation app, and users define on the server side which structure and elements they want to see on their watch. That configuration directly determines the size of the JSON the app processes.

    For users with a small setup there would be no impact, but many others might no longer be able to run their current configuration if the new limit is enforced.

    Judging from the simulator behavior, the new limit appears to be roughly a quarter of what it was before.

  • Only Garmin knows the specifics of why the bug was fixed the way it was and I doubt they will give you more details. But they made the fix for a reason - maybe something you just don't see with your apps

    How close to the new max is your data?

    I've verified that my apps that could be impacted run fine with 9.1.0

  • It makes sense you see it in the SDK first as it could be some time before the fix rolls out to the firmware for all the devices and this way you can test/verify your apps before it hits users on real devices

    My question would then be what the actual "bug" is here. Everything worked fine before. Limits were already in place and enforced.In fact, the communications module has been one example where limits were enforced in a relatively graceful way that applications can handle well, especially when compared to modules such as Storage or the Watchdog.

    I would be quite disappointed if the same lower limit were implemented on real devices. There are limits in place on real devices today, and I do not see them causing any real-world problems. It is unclear what the benefit of reducing them would be, other than making life more difficult for existing apps.