Code Monkey home page Code Monkey logo

iot-hub-devicestreams-sample's Introduction

Hi 👋 I'm Fabian

Expert Distributed IIoT-Software Solutions

I work as an Expert Distributed IIoT Software Solutions and have a passion for Azure, .NET and Angular.

Skills

.NET C# JavaScript TypeScript HTML5 CSS3 Sass Bootstrap Angular Microsoft Azure Photoshop

Socials

Badges

GitHub Stats

fzankl's GitHub stats

iot-hub-devicestreams-sample's People

Contributors

fzankl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

alifeonmars

iot-hub-devicestreams-sample's Issues

DeviceNotFoundException from ServiceProxy

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.

serviceClient.CreateStreamAsync() returns timeout if device ID contains numbers

Context

OS: Windows 10 Pro64-Bit-Betriebssystem,
**NET Target Framework :**6.0.300
Device: (Laptop, Raspberry)
SDK version used: 1.27.1.0

Description of the issue

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 .

Console log of the issue

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, Func3 modifyRequestMessageAsync, Func2 isMappedToException, Func3 processResponseMessageAsync, IDictionary2 errorMappingOverrides, CancellationToken cancellationToken) at Microsoft.Azure.Devices.HttpClientHelper.ExecuteWithCustomOperationTimeoutAsync(HttpMethod httpMethod, Uri requestUri, TimeSpan operationTimeout, Func3 modifyRequestMessageAsync, Func2 isMappedToException, Func3 processResponseMessageAsync, IDictionary2 errorMappingOverrides, CancellationToken cancellationToken) at Microsoft.Azure.Devices.HttpClientHelper.PostAsync[T,T2](Uri requestUri, T entity, TimeSpan operationTimeout, IDictionary2 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.