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

[Example] Move the Edgehog setup before Astarte device start #76

Open
harlem88 opened this issue Nov 11, 2022 · 0 comments
Open

[Example] Move the Edgehog setup before Astarte device start #76

harlem88 opened this issue Nov 11, 2022 · 0 comments

Comments

@harlem88
Copy link
Contributor

harlem88 commented Nov 11, 2022

Move from the example the edgehog_device_new function before the astarte_device_start function, this also prevents publication of data before publishing the Astarte introspection.

edgehog_device_telemetry_config_t telemetry_config
        = { .type = EDGEHOG_TELEMETRY_SYSTEM_STATUS, .period_seconds = 3600 };

    edgehog_device_config_t edgehog_conf = { .astarte_device = astarte_device,
        .partition_label = "nvs",
        .telemetry_config = &telemetry_config,
        .telemetry_config_len = 1 };
    edgehog_device = edgehog_device_new(&edgehog_conf);

    if (!edgehog_device) {
        ESP_LOGE(TAG, "Failed to create Edgehog device");
        return;
    }
    
    ...
    
     if (astarte_device_start(astarte_device) != ASTARTE_OK) {
        ESP_LOGE(TAG, "Failed to start astarte device");
        return;
    }
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