标签: azure-iot-sdk

Azure IoT 中心和 Azure IoT 中心有什么区别?

我之前使用过 Azure IoT Hub,现在我发现了一个Azure IoT CentralAzure IoT Hub.

我很困惑与这些物联网服务之间的差别,任何人都可以解释我的差异,哪一个更好之间Azure IoT CentralAzure IoT Hub

提前致谢

azure azure-iot-hub azure-iot-sdk azure-iot-central

29
推荐指数
4
解决办法
3万
查看次数

从1000台设备中获取connectionState的最佳方法-Azure IoTHub

connectionState从1000台设备中获取数据的最佳方法。当前没有那么多设备,但是需要有效的解决方案。

根据我的理解,目前我可以connectionState使用

  1. IotHub Queries(select * from devices)registryManager.GetDevicesAsync(100);-这些方法在查询1000个设备时不是实时的,或者在设备数量增加时效率不高。
  2. HeartBeat-我不喜欢这样做,因为当设备数量很大时,这会导致配额过载,从而导致发送太多消息。
  3. 运营监控/诊断监控-第一个很好,但是到2018年10月它已被弃用,第二个大约需要2分钟才能在eventhub中获取消息(这种延迟我已经尝试过并发现)。

如果以上任何一项我有误,请提出一些建议并纠正我。

azure azure-eventhub azure-iot-hub azure-iot-sdk azure-iot-edge

5
推荐指数
1
解决办法
516
查看次数

MessagingEntityNotFoundException:找不到消息实体“ihsuprodsgres029dednamespace:eventhub:”

我只是尝试使用 Azure IOT Hub 将我的设备连接到云。但我收到如下错误。

MessagingEntityNotFoundException:找不到消息实体“ihsuprodsgres029dednamespace:eventhub:iothub-ehub-”。TrackingId:4772b610-8ff3-4709-8ea9-ffcd5784fe1c_B4,SystemTracker:ihsuprodsgres029dednamespace:eventhub:iothub-ehub-sibeeshiot-176205-a588b66686~16383 | team01,时间戳:2017年6月23日3:07:54 PM TrackingId:41110b704d814af497fd9924da6714d8_G4,SystemTracker :gateway2,时间戳:6/23/2017 3:07:55 PM,参考 ID:41110b704d814af497fd9924da6714d8_G4

如果您遇到过同样的问题,您能帮我解决一下吗?下面是我正在尝试的代码。

static void Main(string[] args) {
    Console.WriteLine("Receive messages. Ctrl-C to exit.\n");
    eventHubClient = EventHubClient.CreateFromConnectionString(connectionString, iotHubD2cEndpoint);

    var d2cPartitions = eventHubClient.GetRuntimeInformation().PartitionIds;

    CancellationTokenSource cts = new CancellationTokenSource();

    System.Console.CancelKeyPress += (s, e) = >{
        e.Cancel = true;
        cts.Cancel();
        Console.WriteLine("Exiting...");
    };

    var tasks = new List < Task > ();
    foreach(string partition in d2cPartitions) {
        tasks.Add(ReceiveMessagesFromDeviceAsync(partition, cts.Token));
    }
    Task.WaitAll(tasks.ToArray());
}
private static async Task ReceiveMessagesFromDeviceAsync(string partition, CancellationToken ct) {
    var eventHubReceiver …
Run Code Online (Sandbox Code Playgroud)

c# azure azure-web-app-service azure-iot-hub azure-iot-sdk

5
推荐指数
1
解决办法
1万
查看次数

使用 Azure IoT 中心更新固件

我打算使用 IoT 中心利用其双向功能更新我的 Edison 设备的固件,尽管我不确定在哪里可以找到有关如何操作的详细说明。我在这个主题上找到的唯一信息是这里,但没有详细说明如何做到这一点,更多的是高级概述。有没有人知道如何做到这一点或知道任何有帮助的链接?

谢谢

intel-edison azure-iot-hub azure-iot-sdk

4
推荐指数
1
解决办法
1288
查看次数

向 IoT Central 提供消息中的时间戳

我想将“真实设备”与 Azure IoT Central 连接,并使用 MQTT 将本地源应用程序连接到它。我使用代码进行连接和替换。

但是,我找不到有关如何提供时间戳的任何信息。线程建议将“iothub-creation-time-utc”设置为“属性”——但是我不知道该怎么做。有没有这方面的文件?

azure azure-iot-sdk azure-iot-central

4
推荐指数
2
解决办法
1143
查看次数

Python 异步函数返回协程对象

我正在运行一个 python 程序来监听 azure iot hub。该函数返回一个协程对象而不是 json。我看到,如果我们使用异步函数并将其作为普通函数调用,就会发生这种情况,但我创建了一个循环来获取事件,然后使用 run_until_complete 函数。我在这里缺少什么?

async def main():
    try:
        client = IoTHubModuleClient.create_from_connection_string(connection_string)
        print(client)
        client.connect() 
        while True:
            message = client.receive_message_on_input("input1")   # blocking call
            print("Message received on input1")
            print(type(message))
            print(message)

        
    except KeyboardInterrupt:
        print ( "IoTHubClient sample stopped" )
    except:
        print ( "Unexpected error from IoTHub" )
        return

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
    loop.close()
Run Code Online (Sandbox Code Playgroud)

输出- 在 input1 上收到消息 <class 'coroutine'> <coroutine object receive_message_on_input at 0x7f1439fe3a98>

python-asyncio python-3.6 azure-iot-sdk azure-iot-edge

2
推荐指数
1
解决办法
7198
查看次数

如何在 Azure Iot 设备孪生查询中实现分页

https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-query-language上的 azure 文档表示 \xe2\x80\x9c Azure IoT SDK 支持大型结果分页\ xe2\x80\x9d 但我找不到任何有关如何执行此操作的示例或参考。

\n\n

有人有想法吗?

\n

azure-iot-hub azure-iot-sdk

1
推荐指数
1
解决办法
1697
查看次数

如何将 Microsoft.Azure.Devices.Client.DeviceClient KeepAliveInSeconds 设置为大于 30 的数字

我正在研究通过卫星连接使用 MQTT(或 AMQP)。我正在使用基于 HTTPS 的 MQTT 来连接 Azure 中的 IoT 中心。卫星上的数据非常昂贵,我正在努力最大限度地减少此连接的“空闲”消耗。我可以通过更改 SaS 令牌的更新频率(默认 1 小时)和保持活动来实现此目的。

我正在使用 Microsoft.Azure.Devices NuGet 包中的 DeviceClient,在那里我可以创建一个 TransportSettings 对象并设置保持活动状态:

ITransportSettings transportSettings = new MqttTransportSettings(TransportType.Mqtt_WebSocket_Only)
{
    KeepAliveInSeconds = 90,
};
Run Code Online (Sandbox Code Playgroud)

然后我像这样创建连接:

var client = DeviceClient.CreateFromConnectionString(connectionString , new[] { transportSettings });
Run Code Online (Sandbox Code Playgroud)

我的经历是。如果我省略传输设置,连接每 5 秒发送一次保持活动状态。如果我将保持活动设置为 30 及以上的任何值,它总是每 30 秒发送一次保持活动。KeepAliveInSeconds 属性的描述告诉我们默认值为 300 秒: KeepAliveInSeconds 属性说明

但我的 Wireshark 跟踪讲述了一个不同的故事: Wireshark 跟踪

当 CreateFromConnectionString 中未给出 MqttTransportSettings 时,它将每 5 秒发送一次保持活动状态。当我添加设置时,我可以将保持活动时间设置为 10 或 30 秒,这可以工作,但如果我像本例一样将其设置为 90,它会保持 30 秒(大约 Wireshark 跟踪显示)。我尝试在 Azure 中查找是否可以更改其中的任何内容。而且IoT Hub上没有这样的设置。

因此,希望其他人经历过这种情况并找到解决方案,从客户端保持活动状态,而不是每 5 或 30 秒发送一次。我的目标是每隔 2-5 …

c# keep-alive azure azure-iot-hub azure-iot-sdk

1
推荐指数
1
解决办法
753
查看次数