Comments (7)
Hi @jeywinlizy
The Azure IoT Suite Remote Monitoring dashboard is an ASP.Net MVC app and you can find the code here: https://github.com/Azure/azure-iot-remote-monitoring
You'll see that it is using an event processor host to get Device to Cloud messages.
If you are looking for a little bit simpler example of an ASP.Net app (not MVC) you can also check out this project: http://connectthedots.io
from azure-iot-sdk-csharp.
Thanks @olivierbloch . I shall have a look on that and try.
from azure-iot-sdk-csharp.
Hi @jeywinlizy
Shall we close this "issue" considering it is not an issue?
Thanks
from azure-iot-sdk-csharp.
Hi @olivierbloch
I went thru' the code at a higher level. It looks like you have used Storage Table in your app.
My understanding is that the device sent messages are inserted to the Storage Tables, from where the message are retrieved as per the updated time stamp to display the message on the View(web page).
Is my understanding correct?
It would really be helpful if you can help me with the details of sequence of actions taking place to Receive the message from IOT Hub and displaying continuously on the web page.
As per my code I am calling Receive method
EventData eventData = await eventHubReceiver.ReceiveAsync();
After this call , what & how next ==> I would like to know how to take it next to display the message continuously on the View; as the message is being received on the device in the IOT hub
My requirement is to get the message from IoT HUb and keep displaying continuously on the View.
Kindly suggest on how to take this forward. Thanks in advance.
from azure-iot-sdk-csharp.
Hi @jeywinlizy
You are actually right for the Remote Monitoring dashboard (which I don't own and don't know all the details about).
In the ConnectTheDots project I am not using the MVC model, but I leverage WebSockets to stream the data update to the browser client from the ASP.Net site backend.
from azure-iot-sdk-csharp.
Thanks @olivierbloch .
From your suggestion I was looking into the webSocket to implement my solution.
I have the Receive method in a page as below that receives the message from IotHub.
private static async Task ReceiveMessagesFromDeviceAsync(string partition, CancellationToken ct)
{
var eventHubReceiver = eventHubClient.GetDefaultConsumerGroup().CreateReceiver(partition, DateTime.UtcNow);
while (true)
{
if (ct.IsCancellationRequested) break;
EventData eventData = await eventHubReceiver.ReceiveAsync();
if (eventData == null) continue;
string data = Encoding.UTF8.GetString(eventData.GetBytes());
Console.WriteLine("Message received. Partition: {0} Data: '{1}'", partition, data);
}
}
the above variable data gets the message sent by the IoTHub
- Kindly help me here--- after this how should I pass\link this message in the var data to be displayed on the web page using the Websocket?
- What should be the url and protocol that I need to pass to the Websocket in my js?
I have the below in the js file
socket = new WebSocket(url, "echo-protocol");
- Where should I notify about my IotHub Connection string?
Kindly help me with these details so that I can update my app and make it up and complete --- which would be able to display the message sent from device in Iot Hub in the web page.
from azure-iot-sdk-csharp.
Hey @jeywinlizy
unfortunately I am not the WebSocket expert and can't help you further on this very topic. All I have a know is in the ConnectTheDots.io project.
Additionally, considering this is not an issue related to our SDKs, I will close this thread,
I would suggest you post the question on StackOverflow to ensure the right people can help you out.
from azure-iot-sdk-csharp.
Related Issues (20)
- [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
- [QUERY] How to properly acknowledge IoT hub messages HOT 6
- [feature request] Make DPS Queries testable HOT 2
- MQTT Channel is Closed / Migrating Sample to .net8 caused an issue HOT 5
- DeviceNotFoundException results in InvalidErrorCode (404103) HOT 2
- [Bug Report] v2.0.0 now removed from nuget package HOT 4
- Getting PlatformNotSupportedException on .NET Framework 4.6.1 HOT 3
- [Technical Question] HOT 1
- [Bug Report] HOT 2
- [Bug Report]Edgehub - Unknown feedback message - HOT 3
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.