azure-iot-sdk-c | C99 SDK for connecting devices | Azure library

 by   Azure C Version: LTS_01_2023_Ref02 License: Non-SPDX

kandi X-RAY | azure-iot-sdk-c Summary

kandi X-RAY | azure-iot-sdk-c Summary

azure-iot-sdk-c is a C library typically used in Cloud, Azure applications. azure-iot-sdk-c has no bugs, it has no vulnerabilities and it has low support. However azure-iot-sdk-c has a Non-SPDX License. You can download it from GitHub.

The Azure IOT Hub Device SDK allows applications written in C99 or later or C++ to communicate easily with Azure IoT Hub, Azure IoT Central and to Azure IoT Device Provisioning. This repo includes the source code for the libraries, setup instructions, and samples demonstrating use scenarios. For constrained devices - where memory is measured in kilobytes and not megabytes - there are even lighter weight SDK options available. See Other Azure IoT SDKs for more.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              azure-iot-sdk-c has a low active ecosystem.
              It has 557 star(s) with 748 fork(s). There are 103 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 4 open issues and 1337 have been closed. On average issues are closed in 70 days. There are 4 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of azure-iot-sdk-c is LTS_01_2023_Ref02

            kandi-Quality Quality

              azure-iot-sdk-c has no bugs reported.

            kandi-Security Security

              azure-iot-sdk-c has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              azure-iot-sdk-c has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              azure-iot-sdk-c releases are available to install and integrate.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of azure-iot-sdk-c
            Get all kandi verified functions for this library.

            azure-iot-sdk-c Key Features

            No Key Features are available at this moment for azure-iot-sdk-c.

            azure-iot-sdk-c Examples and Code Snippets

            No Code Snippets are available at this moment for azure-iot-sdk-c.

            Community Discussions

            QUESTION

            Azure IoT: Cannot connect ESP8266 device to IoT Edge (Certificate error)
            Asked 2021-Mar-24 at 14:26

            I am able to successfully connect with a python example to my created IoT Edge. However, the same configuration does not work for my actual downstream device (ESP8266).

            Downstream device (ESP8266) Configuration

            I am using the following example for the ESP8266: https://github.com/Azure/azure-iot-arduino/tree/master/examples/esp8266/iothub_ll_telemetry_sample

            Added the certificate and connection string in the code:

            ...

            ANSWER

            Answered 2021-Mar-24 at 14:24

            Finally it's working. Switched the hardware from ESP8266 to ESP32 and running (same code) without any issues.

            Source https://stackoverflow.com/questions/66677872

            QUESTION

            IoT .Net SDK: Is there a way to set the SAS Token Life?
            Asked 2021-Mar-11 at 23:45

            Using the .Net SDK for IoT, is there a way to set the OPTION_SAS_TOKEN_LIFETIME (https://github.com/Azure/azure-iot-sdk-c/blob/master/iothub_client/inc/iothub_client_options.h#L36)?

            I know I can generate the token and own the process using:

            ...

            ANSWER

            Answered 2021-Mar-11 at 23:45

            See the related thread in github: https://github.com/Azure/azure-iot-sdk-csharp/issues/1818

            "By default, if you initialize the device client using connection string, it will generate sas tokens that are valid for an hour. To override this behavior, you can implement the abstract class DeviceAuthenticationWithTokenRefresh and pass it to the device client Create method for initialization."

            Thanks.

            Source https://stackoverflow.com/questions/65619913

            QUESTION

            DeviceClient SetMethodDefaultHandlerAsync not invoked timely
            Asked 2020-Aug-31 at 09:12

            Describe the bug

            DeviceClient SetMethodDefaultHandlerAsync handler is not triggered on internet disconnection instantly. It triggers after 15 to 20 minutes. Below are the logs

            IoT Hub connection status Changed Status: Connected Reason: Connection_Ok Time: 3:09:15 PM +02 IoT Hub connection status Changed Status: Disconnected_Retrying Reason: Communication_Error Time: 3:26:29 PM +02

            I disconnected the internet at 3:10:00 PM +02 and communication error was thrown after 16 minutes. I have created a sample code which reproduces the issue

            Steps to reproduce

            ...

            ANSWER

            Answered 2020-Aug-31 at 08:08

            As per the outcome of discussion in github: https://github.com/Azure/azure-iot-sdk-csharp/issues/1409

            The SDK is relying on the OS TCP stack to inform that the disconnect has happened, and the OS can take a couple of retries before relaying this information. This might be what is causing the connection status change handler to get invoked with a 15min delay on Linux.

            For Mqtt, the client does send a ping request every 75 seconds, but does not seem to be monitoring the ping response being received from the broker.

            PS: This is not occurring when using Windows 10 OS

            Update

            Added a fix for the mqtt layer, where the sdk now monitors for a ping response and disconnects if the delay between sending a ping request and receiving a response is >30secs (this value is currently not configurable).

            For the amqp implementation, the amqp library encapsulates this ping request-response logic from us; all that the device sdk does is set the IdleTimeout.

            Source https://stackoverflow.com/questions/62509807

            QUESTION

            Having a problem with installing the Azure IoT SDK for C
            Asked 2020-Jul-02 at 07:54

            I am following the MS docs quickstart on creating an IoT Plug and Play device for Windows i.e Quickstart: Use a device capability model to create an IoT Plug and Play Preview device (Windows) and I'm having issues preparing the development environment.

            When I get to installing the SDK with vcpkg (step 2 in preparing the dev environment section) running this command gives me an error:

            ...

            ANSWER

            Answered 2020-Jul-02 at 07:54

            So here is the workaround...

            Go to the Folder : C:\Users\satish\vcpkg\ports\azure-iot-sdk-c

            1. Edit the CONTROL file in any file editor, update use_prov_client as use-prov-client

            1. Edit the portfile.cmake file : update use_prov_client as use-prov-client

            1. run

            .\bootstrap-vcpkg.bat

            1. run

            .\vcpkg.exe install azure-iot-sdk-c[public-preview,use-prov-client]

            Finally...

            Please let us know if you need further help.

            Source https://stackoverflow.com/questions/62668096

            QUESTION

            Cross-compiling Azure IoT SDK for C
            Asked 2020-Jun-16 at 16:43

            I have successfully managed to cross-compile the C Azure IoT SDK for a target device running embedded Linux. The instructions are here : https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/SDK_cross_compile_example.md

            The next step is to get a basic application using the SDK running on the target device.

            How would one go about doing this? Where are the generated libraries etc. to copy to the sysroot of the target device.

            There seems to be only support for Rasberry Pi and generating a new firmware image.

            ...

            ANSWER

            Answered 2020-Jun-16 at 16:43

            I would recommend that you use the -DCMAKE_INSTALL_PREFIX=[output path] when you generate your makefiles. Once you have run cmake and make you can then run make install which will copy the generated libraries to the location you chose. You do NOT want to install them into your host's library search path since (presumably) they are built for an incompatible architecture. Having done that the /lib directory will have the libraries that you need to use to build your application. These are static libraries (unless you chose otherwise) so they only need to be linked to your application. They do not need to be on the device. Obviously you will also need to cross compile your application.

            There are a couple of things you need to look out for though. Your device will need to have the same version of OpenSSL and curl that you used when you built the SDK. These are dynamic libraries so your application would likely fail at run time if you don't take care of that since there would be a version mismatch.

            There is another example of cross-compiling here: https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/Docker_SDK_Cross_Compile.md. This version also builds the prerequisite libraries and has suggestions about how you might also cross compile your application. It uses a Docker container to do this but, even if you don't want to use Docker, it may still help you with your process.

            Source https://stackoverflow.com/questions/62266169

            QUESTION

            CMake: The C Compiler is not able to compile a simple test program
            Asked 2020-May-25 at 07:48

            I am trying to cross-compile the Azure IoT SDK C for a Mips processor. Cross-compiling an older version of the same SDK using an older version of CMake (2.8.12.2) works just fine, so I doubt it's the code itself. I am guessing it's the Mips GCC compiler.

            Error message:

            ...

            ANSWER

            Answered 2020-Mar-30 at 18:21

            cmake tries to compile an executable using "standard" (as per what cmake thinks is standard) compiler options and tries to run that executable, so to see if the compiler is working. The executable is simple, usually like int main(int argc) { return argc - 1; }.

            You can't do that when cross-compiling. Because usually you can't link a proper standard C library, you don't have printf, or _start or _exit or similar, passing arguments to main is implementation defined, or you need a linker script or you can't run cross-compiled source on host, etc... Simply: you usually can't run cross-compiled executable on host and most of the time even the compilation is hard enough to do.

            The common solution is to set before project():

            Source https://stackoverflow.com/questions/53633705

            QUESTION

            Debugging Azure IoT Module with iotedgehubdev throws an error
            Asked 2020-Apr-20 at 14:49

            I'm running:

            • Windows 10 Home version 1909.
            • Visual Studio 2019 Pro 16.5.0. Azure
            • IoT Edge Tools 1.7.0. azure-iot-sdk-c package.
            • Latest version of Docker Toolbox - (it runs hello-world with no errors).
            • Python, pip. iotedgehubdev 0.13.0

            Did the following steps:

            1. Registered account on Azure
            2. Created free IoT hub
            3. Registered Edge Device
            4. (Not sure if it was needed) Created VM, installed Azure Runtime, registered it in IoT Hub as device from step 3.
            5. (Not sure if it was needed) Started registry in docker with command docker run -d -p 5000:5000 --restart=always --name registry registry:2
            6. Created Win 64 Azure Module project in Visual Studio with default settings including the repository URL (localhost:5000/moduleName)
            7. Set up iotedgehubdev with device connection string taken from device from step 3.
            8. Set the module's project as startup project
            9. Trying to start debug

            Module is built, but debugging does not start.

            Output of IoT Hub in Visual Studio:

            ...

            ANSWER

            Answered 2020-Apr-20 at 14:49

            I have reinstalled Windows to 10 Pro instead of Home which allowed me to use Docker Desktop instead of legacy Docker Toolbox solution. The issue is now fixed.

            Source https://stackoverflow.com/questions/61226975

            QUESTION

            How to use MQTT.fx to connect to IOT central?
            Asked 2019-Dec-20 at 07:17

            ANSWER

            Answered 2018-Dec-19 at 21:41

            I have just finished a test using a MQTT.fx client connected to the Azure IoT Central. Based on the doc Using the MQTT protocol directly the password must be in the following format, see example:

            Source https://stackoverflow.com/questions/53856019

            QUESTION

            Linking error related to libcurl while building azure-iot-sdk-c sample code
            Asked 2019-Nov-20 at 13:41

            I was facing an issue while building azure-iot-sdk-c sample code with below toolchain.cmake configuration.

            ...

            ANSWER

            Answered 2019-Nov-15 at 23:30

            I think you need to include CMAKE_FIND_ROOT_PATH in your cross compile toolchain file. There is a working example of a cross compile of the SDK, albeit performed in a Docker container, here: https://github.com/Azure/azure-iot-sdk-c/blob/master/samples/dockerbuilds/RaspberryPi/Dockerfile. This example also builds all the prerequisites.

            Source https://stackoverflow.com/questions/58859841

            QUESTION

            iothub_client/src/iothubtransport_mqtt_common.c Func:InitializeConnection. mqtt_client timed out waiting for CONNACK
            Asked 2019-Nov-11 at 14:05

            OS:Linux SDK Version : 2018-12-13 Description of the issue:

            iothub_ll_telemetry_sample.c when i placed 60000 in the function ThreadAPI_Sleep(60000) works well but Tried with 120000 facing the timeout error.

            cd ~/azure-iot-sdk-c/cmake/iothub_client/samples/iothub_ll_telemetry_sample $ ./iothub_ll_telemetry_sample

            Console log of the issue:

            Creating IoTHub Device handle Sending message 1 to IoTHub Sending message 2 to IoTHub Error: Time:Fri Dec 21 11:12:19 2018 File:/home/test/azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.c Func:InitializeConnection Line:2229 mqtt_client timed out waiting for CONNACK Sending message 3 to IoTHub Sending message 4 to IoTHub Error: Time:Fri Dec 21 11:16:19 2018 File:/home/test/azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.c Func:InitializeConnection Line:2229 mqtt_client timed out waiting for CONNACK Sending message 5 to IoTHub Error: Time:Fri Dec 21 11:18:19 2018 File:/home/test/azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.c Func:InitializeConnection Line:2229 mqtt_client timed out waiting for CONNACK Error: Time:Fri Dec 21 11:20:19 2018 File:/home/test/azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.c Func:InitializeConnection Line:2229 mqtt_client timed out waiting for CONNACK Error: Time:Fri Dec 21 11:22:19 2018 File:/home/test/azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.c Func:InitializeConnection Line:2229 mqtt_client timed out waiting for CONNACK Error: Time:Fri Dec 21 11:24:19 2018 File:/home/test/azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.c Func:InitializeConnection Line:2229 mqtt_client timed out waiting for CONNACK Error: Time:Fri Dec 21 11:26:19 2018 File:/home/test/azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.c Func:InitializeConnection Line:2229 mqtt_client timed out waiting for CONNACK

            Note: In previous version you said it's resolved but here it's not working form me. Please Explain me where is the problem.

            ...

            ANSWER

            Answered 2019-Jan-04 at 23:04

            The "LL" version of SDK functions are single threaded. When modify the code to sleep for two minutes the SDK is unable to service the socket and hence does not receive the CONNACK packet in time. The function call that services the socket is IoTHubDeviceClient_LL_DoWork. This function should be called at a bare minimum every 100 ms and preferably more quickly than that. If you only want to send a message every two minutes the onus is upon you to keep track of the time and send your message every time it has been two minutes since your last message. You cannot simply put the thread to sleep for two minutes.

            Source https://stackoverflow.com/questions/53880311

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install azure-iot-sdk-c

            You can download it from GitHub.

            Support

            The API reference documentation for the C SDKs can be found here.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link