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 IoT
Azure IoT
A category of Azure services for internet of things devices.
399 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,189 questions
{count} votes

Accepted answer
  1. Sander van de Velde | MVP 32,641 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).


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,


Your answer

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