Share via

Receiving C2D message without Azure SDK

Andrea Previtali 106 Reputation points
2022-09-13T12:18:57.083+00:00

Hi all,

I have a "working" architecture which allows me to get data from my devices and put them into an Azure table, I also have an API that do some stuff on this data if it is needed but this is not important at the moment.

Now I am looking for a way to send messages from Cloud to Device, honestly I don't know how to do that and all the sample I found on the net are realized with Azure SDK, my problem is this: I can't use Azure SDK on my devices since one of the system I am using is quite aged and doesn't support it.

Does anyone have a solution to my problem?

Thank you,

Andrea

Azure Internet of Things
Azure IoT Hub
Azure IoT Hub

An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.


Answer accepted by question author

Sander van de Velde | MVP 37,066 Reputation points MVP
2022-09-13T13:00:30.383+00:00

Hello @Andrea Previtali ,

the Azure IoT Hub supports 'native' MQTT and acts like a broker.

It supports both D2C and C2D.

You need to know the flow and use of topics to get this working.

Check out this blog post explaining the interface with C# as reference language.

If this is not possible, you could add a 'guardian angel' a secure cloud-connected device eg. an Azure Sphere next to your original device.

Or, if you want to add more computing power next to the original device, check out Azure IoT Edge. This is a (industrial) PC running Linux/Windows and hosts modules (based on Docker container logic).

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. Andrea Previtali 106 Reputation points
    2022-10-18T09:15:01.307+00:00

    Hi @Sander van de Velde | MVP ,

    After some weeks I'm back again on this "issue". Do you have any suggestion about that?
    Consider my ""project"" started from here: https://github.com/Azure-Samples/IoTMQTTSample/tree/master/src/Windows
    The telemetry program has no problem, I can invoke it every 10 seconds and I don't have any kind of issue.

    I also don't have any problem if I run Subscribe program alone: If I send a message to the device, subscribe program, once launched, is able to retrive this message, also if the machine was turned off while the messages was sent.

    The problem I'm trying to solve is the following:

    • I send the message to the turned off machine.
    • I turn on the machine and I run TELEMETRY program.
    • I stop the Telemetry program
    • I run the Subscribe program: in this situation I am not able to retrive the message.

    Any idea on the possible origin of my issue?

    Thanks,

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.