我之前使用过 Azure IoT Hub,现在我发现了一个Azure IoT Central与Azure IoT Hub.
我很困惑与这些物联网服务之间的差别,任何人都可以解释我的差异,哪一个更好之间Azure IoT Central和Azure IoT Hub?
提前致谢
connectionState从1000台设备中获取数据的最佳方法。当前没有那么多设备,但是需要有效的解决方案。
根据我的理解,目前我可以connectionState使用
Queries(select * from devices)  或registryManager.GetDevicesAsync(100);-这些方法在查询1000个设备时不是实时的,或者在设备数量增加时效率不高。如果以上任何一项我有误,请提出一些建议并纠正我。
azure azure-eventhub azure-iot-hub azure-iot-sdk azure-iot-edge
我只是尝试使用 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 …我打算使用 IoT 中心利用其双向功能更新我的 Edison 设备的固件,尽管我不确定在哪里可以找到有关如何操作的详细说明。我在这个主题上找到的唯一信息是这里,但没有详细说明如何做到这一点,更多的是高级概述。有没有人知道如何做到这一点或知道任何有帮助的链接?
谢谢
我正在运行一个 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()
输出- 在 input1 上收到消息 <class 'coroutine'> <coroutine object receive_message_on_input at 0x7f1439fe3a98>
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我正在研究通过卫星连接使用 MQTT(或 AMQP)。我正在使用基于 HTTPS 的 MQTT 来连接 Azure 中的 IoT 中心。卫星上的数据非常昂贵,我正在努力最大限度地减少此连接的“空闲”消耗。我可以通过更改 SaS 令牌的更新频率(默认 1 小时)和保持活动来实现此目的。
我正在使用 Microsoft.Azure.Devices NuGet 包中的 DeviceClient,在那里我可以创建一个 TransportSettings 对象并设置保持活动状态:
ITransportSettings transportSettings = new MqttTransportSettings(TransportType.Mqtt_WebSocket_Only)
{
    KeepAliveInSeconds = 90,
};
然后我像这样创建连接:
var client = DeviceClient.CreateFromConnectionString(connectionString , new[] { transportSettings });
我的经历是。如果我省略传输设置,连接每 5 秒发送一次保持活动状态。如果我将保持活动设置为 30 及以上的任何值,它总是每 30 秒发送一次保持活动。KeepAliveInSeconds 属性的描述告诉我们默认值为 300 秒:

当 CreateFromConnectionString 中未给出 MqttTransportSettings 时,它将每 5 秒发送一次保持活动状态。当我添加设置时,我可以将保持活动时间设置为 10 或 30 秒,这可以工作,但如果我像本例一样将其设置为 90,它会保持 30 秒(大约 Wireshark 跟踪显示)。我尝试在 Azure 中查找是否可以更改其中的任何内容。而且IoT Hub上没有这样的设置。
因此,希望其他人经历过这种情况并找到解决方案,从客户端保持活动状态,而不是每 5 或 30 秒发送一次。我的目标是每隔 2-5 …