iot hub
20 TopicsGet Device to Cloud messages in IoT Hub using Rest API
Hello, I'm currently trying to get the messages that I sent to my azure iot hub using rest api (postman), but without success, I always got 204 no content. thats how i'm sending the message: Type: POST Url: https://{{iothub-north}}/devices/{{new-device}}/messages/events?api-version={{api-version}} Authorization:SharedAccessSignature sr={my sas-key}&sig={my-sig}se={my-se}. Answer:204No Content. thats how i'm trying to get the messages: Type: GET Url: https://{{iothub-north}}/devices/{{new-device}}/messages/deviceBound?api-version={{api-version}} Authorization:SharedAccessSignature sr={my sas-key}&sig={my-sig}se={my-se}. Answer:204No Content. I was searching for some documentation and found this:https://learn.microsoft.com/en-us/rest/api/iothub/device/receive-device-bound-notification however, for what I understood, it only works for cloud to device messages, so can someone help me how can I get the messages that I sent from my device to my azure iot hub? Obs: I've created one service bus to link in my azure iot hub just to be sure that I'm receiving the messages that I sent, and it's working, so probably the issue is something about the way I'm trying to GET these messages.830Views0likes0CommentsFails to publish with user-defined topic to IoT hub
Hi all, I am new to azure ecosystem. I followed some examples and documents and able to connect to the Azure IoT Hub and able to send data. The data is being sent on device/<deviceID>/messages/events topic(telemetry message) topic. From same application, I am not able to publish the message on custom topic(user-defined). Can you please help me if I am missing any additional configuration/settings for Azure IoT?802Views0likes0CommentsVisual Studio 2019 extension for building REST APIs exposing IoT Hub features
Hi all, If you need to write REST APIs (.Net Core) to expose or complete IoT Hub APIs or create a facade, this extension will help you to save a few minutes. It creates a ready to use solution in a few seconds and allows you to focus on important code (business logic, etc). The created API includes other features like: - API versioning - Automatic OpenAPI generation (versioned according to API versions) - separated layers - minimalistic solution with required dependencies only The only thing you need to do is to set the IoT Hub connection in the configuration file (appsettings.json). More details here.1.9KViews1like3CommentsQuerying IoT Devices on IoT Hub
Hi All, today I deployed 3 IoT Hubs (SKU S3) in region "West Europe" and I got the same issue for all IoT Hubs, when I select IoT Devices, I get an error message that querying devices failed: There was an error querying devices: InternalServerError:{ "Message": "ErrorCode:ServerError;InternalServerError", "ExceptionMessage": "ErrorCode: ServerError\r\nMessage: \r\nTimestamp: 02/22/2021 13:17:58\r\nTracking ID: b916cd1004554b5586f14eaed10e7073-G:0-TimeStamp:02/22/2021 13:17:58\r\nPublic Message: \r\nPublic Info: null\r\nException: Microsoft.Azure.Devices.Common.Core.Exceptions.IotHubException ---> System.ArgumentNullException: Value cannot be null.\r\nParameter name: documentCollectionOrDatabaseUri\r\n at Microsoft.Azure.Documents.Client.DocumentClient.CreateDocumentQuery[T](Uri documentCollectionOrDatabaseUri, String sqlExpression, FeedOptions feedOptions)\r\n at Microsoft.Azure.Devices.DocumentDb.PassThroughDocumentClientProxy.CreateDocumentQuery[T](Uri documentCollectionUri, String sqlExpression, FeedOptions feedOptions) in C:\\source\\common\\Microsoft.Azure.Devices.Common\\DocumentDb\\PassThroughDocumentClientProxy.cs:line 65\r\n at System.Lazy`1.CreateValue()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Lazy`1.get_Value()\r\n at Microsoft.Azure.Devices.DocumentDb.FeatureFilterCheckDocumentQueryProxy`1.<GetDocumentQueryProxyWithFeatureCheckAsync>d__7.MoveNext() in C:\\source\\common\\Microsoft.Azure.Devices.Common\\DocumentDb\\FeatureFilterCheckDocumentQueryProxy.cs:line 60\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.DocumentDb.FeatureFilterCheckDocumentQueryProxy`1.<ExecuteNextAsync>d__6`1.MoveNext() in C:\\source\\common\\Microsoft.Azure.Devices.Common\\DocumentDb\\FeatureFilterCheckDocumentQueryProxy.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.DeviceManagement.DataAccess.TransactionalStore.DocumentDb.DmDocumentDbClient.<QueryDevicesInternalAsync>d__51.MoveNext() in C:\\source\\dm\\Microsoft.Azure.Devices.DeviceManagement\\DataAccess\\TransactionalStore\\DocumentDb\\DmDocumentDbClient.cs:line 2513\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.DeviceManagement.DataAccess.TransactionalStore.DocumentDb.DmDocumentDbClient.<QueryDevicesAsync>d__50.MoveNext() in C:\\source\\dm\\Microsoft.Azure.Devices.DeviceManagement\\DataAccess\\TransactionalStore\\DocumentDb\\DmDocumentDbClient.cs:line 2491\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.DeviceManagement.Registry.ManagedDeviceRegistry.<QueryDevicesAsync>d__19.MoveNext() in C:\\source\\dm\\Microsoft.Azure.Devices.DeviceManagement\\Registry\\ManagedDeviceRegistry.cs:line 133\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Management.Providers.DeviceApiProvider.<QueryDevicesInternalAsync>d__102.MoveNext() in C:\\source\\gateway\\mgmt\\Providers\\DeviceApiProvider.cs:line 2328\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Management.Providers.DeviceApiProvider.<QueryDevicesAsync>d__49.MoveNext() in C:\\source\\gateway\\mgmt\\Providers\\DeviceApiProvider.cs:line 1061\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Management.DeviceApiActionResult`1.<ExecuteAsync>d__7.MoveNext() in C:\\source\\gateway\\mgmt\\DeviceApiActionResult.cs:line 94\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Management.ActionFilters.GlobalActionFilter.<ExecuteActionFilterAsync>d__0.MoveNext() in C:\\source\\gateway\\mgmt\\ActionFilters\\GlobalActionFilter.cs:line 42\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\r\n --- End of inner exception stack trace ---", "ExceptionType": "Microsoft.Azure.Devices.Common.Core.Exceptions.IotHubException", "StackTrace": null, "InnerException": { "Message": "An error has occurred.", "ExceptionMessage": "Value cannot be null.\r\nParameter name: documentCollectionOrDatabaseUri", "ExceptionType": "System.ArgumentNullException", "StackTrace": " at Microsoft.Azure.Documents.Client.DocumentClient.CreateDocumentQuery[T](Uri documentCollectionOrDatabaseUri, String sqlExpression, FeedOptions feedOptions)\r\n at Microsoft.Azure.Devices.DocumentDb.PassThroughDocumentClientProxy.CreateDocumentQuery[T](Uri documentCollectionUri, String sqlExpression, FeedOptions feedOptions) in C:\\source\\common\\Microsoft.Azure.Devices.Common\\DocumentDb\\PassThroughDocumentClientProxy.cs:line 65\r\n at System.Lazy`1.CreateValue()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Lazy`1.get_Value()\r\n at Microsoft.Azure.Devices.DocumentDb.FeatureFilterCheckDocumentQueryProxy`1.<GetDocumentQueryProxyWithFeatureCheckAsync>d__7.MoveNext() in C:\\source\\common\\Microsoft.Azure.Devices.Common\\DocumentDb\\FeatureFilterCheckDocumentQueryProxy.cs:line 60\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.DocumentDb.FeatureFilterCheckDocumentQueryProxy`1.<ExecuteNextAsync>d__6`1.MoveNext() in C:\\source\\common\\Microsoft.Azure.Devices.Common\\DocumentDb\\FeatureFilterCheckDocumentQueryProxy.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.DeviceManagement.DataAccess.TransactionalStore.DocumentDb.DmDocumentDbClient.<QueryDevicesInternalAsync>d__51.MoveNext() in C:\\source\\dm\\Microsoft.Azure.Devices.DeviceManagement\\DataAccess\\TransactionalStore\\DocumentDb\\DmDocumentDbClient.cs:line 2513\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.DeviceManagement.DataAccess.TransactionalStore.DocumentDb.DmDocumentDbClient.<QueryDevicesAsync>d__50.MoveNext() in C:\\source\\dm\\Microsoft.Azure.Devices.DeviceManagement\\DataAccess\\TransactionalStore\\DocumentDb\\DmDocumentDbClient.cs:line 2491\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.DeviceManagement.Registry.ManagedDeviceRegistry.<QueryDevicesAsync>d__19.MoveNext() in C:\\source\\dm\\Microsoft.Azure.Devices.DeviceManagement\\Registry\\ManagedDeviceRegistry.cs:line 133\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Management.Providers.DeviceApiProvider.<QueryDevicesInternalAsync>d__102.MoveNext() in C:\\source\\gateway\\mgmt\\Providers\\DeviceApiProvider.cs:line 2328\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Management.Providers.DeviceApiProvider.<QueryDevicesAsync>d__49.MoveNext() in C:\\source\\gateway\\mgmt\\Providers\\DeviceApiProvider.cs:line 1061\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Management.DeviceApiActionResult`1.<ExecuteAsync>d__7.MoveNext() in C:\\source\\gateway\\mgmt\\DeviceApiActionResult.cs:line 94\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Devices.Gateway.Management.ActionFilters.GlobalActionFilter.<ExecuteActionFilterAsync>d__0.MoveNext() in C:\\source\\gateway\\mgmt\\ActionFilters\\GlobalActionFilter.cs:line 42\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()" } }. I try to create a new IoT Device (that worked based on notification) but still the query is broken, therefore I can't read the DeviceConnectionString. Any ideas, what I can do to solve this issue? Thanks & with best regards, Alex1.6KViews0likes4CommentsLearn TV -Learn how to develop secure IoT solutions with Azure Sphere and IoT Hub 13th October 2020
In this session Dave and Mustafa will deploy an Azure Sphere application to monitor ambient conditions for laboratory conditions. The application will monitor the room environment conditions, connect to IoT Hub, and send telemetry data from the device to the cloud. You'll control cloud to device communications and undertake actions as needed.2.4KViews0likes0CommentsPowershell for opening and running CAD files
Hello Community, I am new to Powershell and scripting language. I am trying to automate a sequence of steps that I do in my process of 3D printing which are repetitive. Can anybody guide on it? I have used the Powershell script to open a file, and run it on a MATLAB platform. The basic steps are as listed here. 1. Open the software (3D sprint or any CAD software like Solidworks) 2. Import the CAD design from a location 3. Make an array of the design (optional step) 4. Export the design in the printable format 5. Select the printing material 6. Send the design to print Since these are repetitive steps, I want to know how can I automate these? Thanks2.2KViews0likes1CommentVision DevKit sending to IoT Hub, now how do I get Images?
I have successfully have setup the Vision DevKit, in which is connected and currently sending data (assuming images of camera feed) to IoT Hub, yay! Here is what I'm looking to do next: Label images from feed in Azure (which is necessaryto create a custom ML Vision Model) I'm new to IoT Hub, so i need to extract this data feed into a way I can access. I setup Message Routing to Storage for now. But when I look at Storage/Container files they are .avro. I'm looking for ideas on how to access this feed and organize these images without have to go through using memory card on the Camera. I'd like to manage this whole process in the Azure Cloud. I'm thinking a jupyter notebook in python or any other Azure projects that can help? But first, i would need how to take those .avro (assuming messages) and convert them to something meaningful. Or perhaps the messages to the Storage isn't the correct path. Thank youSolved2KViews1like1Comment