Comments (3)
I have the same problem:
`public sealed class StartupTask : IBackgroundTask
{
public void Run(IBackgroundTaskInstance taskInstance)
{
string deviceConnectionString = "xxxxxxxxxxxxx";
var deviceClient = DeviceClient.CreateFromConnectionString(deviceConnectionString, TransportType.Mqtt);
deviceClient.OpenAsync().Wait();
deviceClient.SetMethodHandlerAsync("WriteToConsole", WriteToConsole, null).Wait();
}
static Task<MethodResponse> WriteToConsole(MethodRequest methodRequest, object userContext)
{
var pin = GpioController.GetDefault().OpenPin(5);
pin.SetDriveMode(GpioPinDriveMode.Output);
if (pin.Read() == GpioPinValue.High)
{
pin.Write(GpioPinValue.Low);
}
else
{
pin.Write(GpioPinValue.High);
}
return Task.FromResult(new MethodResponse(200));
}
}`
When from my webapi app call the method with:
`serviceClient = ServiceClient.CreateFromConnectionString(connectionString);
CloudToDeviceMethod oc = new CloudToDeviceMethod("WriteToConsole");
CloudToDeviceMethodResult r = await serviceClient.InvokeDeviceMethodAsync("RaspberryVecomp", oc);`
non function.
The error is:
"Device {"Message":"ErrorCode:DeviceNotOnline;Timed out waiting for device to connect.","ExceptionMessage":"Tracking ID:b467cb8e1c544fbea30eb68bc0fee870-G:6-TimeStamp:01/29/2017 23:16:41"} not registered"
from azure-iot-sdk-csharp.
@carlosaxpires - Thanks for filing. We'll provide a fix shortly.
from azure-iot-sdk-csharp.
latest package released with this fix.
from azure-iot-sdk-csharp.
Related Issues (20)
- AOT-compatible Microsoft.Azure.Devices.Client HOT 1
- SDK version :2.0.0-preview007 CreateAsync() Json Error
- [Bug Report] WebSockets not working on Web Assembly HOT 1
- Latest device client does not connect over MQTT HOT 9
- Errors while running e2e tests with .NET 8.0 HOT 1
- How to use tpm private key for TLS with IoT Hub SDK (Not TPM Attestation) - for DeviceAuthenticationWithX509Certificate HOT 4
- [Bug Report] AMQP DeviceClient is slow to respond to device being disabled
- Desired Properties callback not triggering after a reconnect HOT 5
- [feature request] Move to System.Text.Json to support AOT HOT 2
- [Bug Report] DeviceClient.SendEventAsync takes over one minute after update from 1.42.0 to 1.42.2 HOT 7
- [BUG] error CS0426: The type name 'Create' does not exist in the type 'ServiceClient' HOT 1
- Building digital twin of the robotic arm [Technical Question] HOT 2
- How do I send data stored in array (floating type) from my robot to IoT hub? [Technical Question]
- [Bug Report] Fails to establish TPM connection HOT 1
- [Technical Question] Security: Check root certificate on device-to-cloud connection HOT 10
- Unhandled exception. Microsoft.Azure.Devices.Client.Exceptions.IotHubException: Request 817bda7c-6fc4-40e0-8946-93eb851fcb12 returned status 403 [Bug Report] HOT 7
- [Bug Report] Send message in batch to multiple outputs using ModuleClient throws HOT 2
- Is it possible to send bulk messages in telemetry from device to IoT hub? [Technical Question]
- [Technical Question] HttpClientHelper error code 400030 HOT 3
- [Bug Report] When try to fetch reported properties after updating the reported property it will return previous version of reported property not the latest one. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-iot-sdk-csharp.