I work as an Expert Distributed IIoT Software Solutions and have a passion for Azure, .NET and Angular.
- 🌍 I'm based in Germany
- 🖥️ See my portfolio at fzankl.de
- ✉️ You can contact me at [email protected]
GitHub Stats
Example how to work with Azure IoT Hub Device Streams
Home Page: https://www.fzankl.de/en/blog/remote-access-for-iot-devices-using-azure-iot-hub
License: MIT License
I work as an Expert Distributed IIoT Software Solutions and have a passion for Azure, .NET and Angular.
GitHub Stats
I get the following error from the ServiceProxy
when trying to open an SSH connection. I am running the DeviceProxy
and I have confirmed in the Azure portal that the device is reported as 'online' when the proxy is running.
info: ServiceProxy[0]
Waiting for TCP clients...
info: ServiceProxy[0]
Accepted TCP client using endpoint '127.0.0.1:2222'.
fail: ServiceProxy[0]
An error occured during streaming session.
Microsoft.Azure.Devices.Common.Exceptions.DeviceNotFoundException: {"Message":"{\"errorCode\":404103,\"message\":\"The operation failed because the requested device isn't online or hasn't registered the direct method callback. To learn more, see https://aka.ms/iothub404103\",\"trackingId\":\"91317EB1EDB7441FAC14F1A5B951DB18-G2:-TimeStamp:2023-04-04T08:52:34.476950757+00:00\",\"timestampUtc\":\"2023-04-04T08:52:34.476950757+00:00\",\"info\":null}","ExceptionMessage":""}
at Microsoft.Azure.Devices.HttpClientHelper.ExecuteAsync(HttpClient httpClient, HttpMethod httpMethod, Uri requestUri, Func`3 modifyRequestMessageAsync, Func`2 isMappedToException, Func`3 processResponseMessageAsync, IDictionary`2 errorMappingOverrides, CancellationToken cancellationToken)
at Microsoft.Azure.Devices.HttpClientHelper.ExecuteWithCustomOperationTimeoutAsync(HttpMethod httpMethod, Uri requestUri, TimeSpan operationTimeout, Func`3 modifyRequestMessageAsync, Func`2 isMappedToException, Func`3 processResponseMessageAsync, IDictionary`2 errorMappingOverrides, CancellationToken cancellationToken)
at Microsoft.Azure.Devices.HttpClientHelper.PostAsync[T,T2](Uri requestUri, T entity, TimeSpan operationTimeout, IDictionary`2 errorMappingOverrides, IDictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.Devices.AmqpServiceClient.CreateStreamAsync(Uri uri, DeviceStreamRequest deviceStreamRequest, CancellationToken cancellationToken)
at IoTHubDeviceStreamSample.ServiceProxy.DeviceStream.HandleIncomingConnectionsAndCreateStreams(String deviceId, ServiceClient serviceClient, TcpClient tcpClient, CancellationTokenSource cancellationTokenSource) in C:\git\devicestreams-dev\src\ServiceProxy\DeviceStream.cs:line 57
I'm running .NET7.0.
OS: Windows 10 Pro64-Bit-Betriebssystem,
**NET Target Framework :**6.0.300
Device: (Laptop, Raspberry)
SDK version used: 1.27.1.0
I am trying to set up an SSH channel through a streaming service. For this purpose, I am using Azure C# SDK.
This is done via two APIs:
Service Menager on the user side, which initiates the connection to the streaming service on the hub and addresses it with the device ID. (where I suppose the error lies).
Lisiting and handling API on the device side
it turned out that the streaming request does not reach devices with IDs containing numbers, which causes the connection to Rest Deu to TimeOut Error .
fail: ServiceProxy[0] An error occured during streaming session. Microsoft.Azure.Devices.Common.Exceptions.UnauthorizedException: {"Message":"{\"errorCode\":401002,\"trackingId\":\"33c7b424b11d46a0beed00726c8da89e-G:0-TimeStamp:06/14/2022 08:24:33\",\"message\":\"Unauthorized\",\"timestampUtc\":\"2022-06-14T08:24:33.8005084Z\"}","ExceptionMessage":""} at Microsoft.Azure.Devices.HttpClientHelper.ExecuteAsync(HttpClient httpClient, HttpMethod httpMethod, Uri requestUri, Func
3 modifyRequestMessageAsync, Func2 isMappedToException, Func
3 processResponseMessageAsync, IDictionary2 errorMappingOverrides, CancellationToken cancellationToken) at Microsoft.Azure.Devices.HttpClientHelper.ExecuteWithCustomOperationTimeoutAsync(HttpMethod httpMethod, Uri requestUri, TimeSpan operationTimeout, Func
3 modifyRequestMessageAsync, Func2 isMappedToException, Func
3 processResponseMessageAsync, IDictionary2 errorMappingOverrides, CancellationToken cancellationToken) at Microsoft.Azure.Devices.HttpClientHelper.PostAsync[T,T2](Uri requestUri, T entity, TimeSpan operationTimeout, IDictionary
2 errorMappingOverrides, IDictionary2 customHeaders, CancellationToken cancellationToken) at Microsoft.Azure.Devices.AmqpServiceClient.CreateStreamAsync(Uri uri, DeviceStreamRequest deviceStreamRequest, CancellationToken cancellationToken) at IoTHubDeviceStreamSample.ServiceProxy.DeviceStream.HandleIncomingConnectionsAndCreateStreams(String deviceId, ServiceClient serviceClient, TcpClient tcpClient, CancellationTokenSource cancellationTokenSource) in C:\Users\khaled.aldayeh\OneDrive - OMS Prüfservice GmbH\Desktop\munit-solutions-serviceproxyssh-52bd4c024d5d\ServiceProxy\DeviceStream.cs:line 57
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.