Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to disable the automatic SHADOW_GET message on (re)connect #7

Open
ghost opened this issue Jul 27, 2018 · 1 comment
Open

Unable to disable the automatic SHADOW_GET message on (re)connect #7

ghost opened this issue Jul 27, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 27, 2018

I need to disable the automatic SHADOW_GET message on MQTT (re)connect. As per documented note in the mgos_shadow.h header file i tried different configurations, but none of them worked fine.

The note in mgos_shadow.h header file says:

/*
 * Request shadow state. Response will arrive via GET_ACCEPTED topic.
 * Note that MGOS automatically does this on every (re)connect if
 * device.shadow.get_on_connect is true (default).
 */
bool mgos_shadow_get(void);
  1. I tried adding this to conf0.json, but it didn't work.
{
  "device": {
    "shadow": {
      "get_on_connect": false
    },
    ...
  },
  ...
}
  1. I tried adding this to conf0.json, but it didn't work.
{
  "shadow": {
    "get_on_connect": false,
    ...
  },
  ...
}
  1. I tried adding this to conf0.json, but it didn't work.
{
  "aws": {
    "get_on_connect": false,
    "shadow": {
      "get_on_connect": false
    },
    ...
  },
  ...
}

Could you suggest me how to fix it?
I thank you in advance.
Best Regards

@amizer12
Copy link

amizer12 commented Feb 14, 2022

This is very VERY old but i just got into the same problem and posting the answer here in case others encounter the same.
If you want to completely disable shadow service put this in your mos.yml:
- ["shadow.enable", "b", false, {title: "Request shadow state on connect"}]

And here is the entire shadow section fo the config file that you can modify - FYI - when i was working on flee provisioning in AWS IoT Core where broker accepts only specific payload on specific topic i had to disable the shadow service completely ( disabling getting it on connect was not enough for some reason ) in order to get certificates back.

  "shadow": {
    "enable": false,
    "get_on_connect": true,
    "lib": ""
  },

Also - no idea why but when i tried to connect to aws iot only using pure mqtt without the AWS lib - it didn't work, you always need to have aws library imported into your project to properly communicate and parse the responses.
Hope that help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant