Azure / connectthedots

Connect tiny devices to Microsoft Azure services to build IoT solutions
http://connectthedots.io
MIT License
399 stars 274 forks source link

Executing ConnectTheDots #259

Closed olivierbloch closed 7 years ago

olivierbloch commented 7 years ago

Originally posted on by @jeywinlizy here

I have downloaded the code ConnectTheDots http://connectthedots.io I am able to successfully comiple & build it. To execute this app do I need to have the below ?

  1. Windows 8 or above
  2. IIS 8 I am having Windows 7 and IIS 7. Will I be able to execute with this system spec If no are there any updates that I can run in my system to make this workable in my system?
olivierbloch commented 7 years ago

Hi @jeywinlizy When you say "execute this app", do you mean the website backend or one of the device samples? If it's about the Website, it is meant to be hosted on Azure Website and instructions detail how to deploy it using an ARM template. To debug the site, you can use Visual Studio 2015 which comes with IIS 10 express.

jeywinlizy commented 7 years ago

To execute this application in my system what are the system requirements. Do I need to have IIS 8 and Windows 10 in my system?

olivierbloch commented 7 years ago

Hi @jeywinlizy As I mentioned in my previous comment, I need to know what you are trying to run. Is it the Web App (a.k.a. Web Site) that you are trying to run locally or on your own VM? The Web App is an ASP.Net app and you can see/modify it's settings in the Visual Studio project. But it has been designed to run in Azure App services, so I have not tested on self hosted configurations

jeywinlizy commented 7 years ago

Ok Thanks I have set it up.

The page displays the devices in the IoT Hub. But no data that's being sent by those devices are getting displayed on the page. Can you help me on the how the data is expected to be sent \ data structure sent by the devices or Am I missing something here that the data continuously sent by my devices are not displayed on the page. connect_the_dots

olivierbloch commented 7 years ago

Data should definitively be sent if it's sent with the right format (see the main readme doc for format details and check out the various device samples). Can you make sure that WebSockets is enabled in your website (if you see an "ERROR" text message towards the bottom of the web page then it might be that the websocket connection between the browser client and the site backend is not allowing Websockets which is used to stream data from backend to front end). Now I recommend you put breakpoints and start debugging the sites to identify the issue. start by opening the website solution in Visual Studio, edit the web.config file to apply the web site settings as they appear in the portal web app settings section. Once this is done, search for the function CreateEventProcessorHostClient in the Global.asax.cs file and put a breakpoint to ensure the event processor host clients are well created. then, in WebSocketEventProcessor.cs, search for the ProcessEventsAsync function and go step by step in there to confirm the back end is indeed receiving events from the device and if that's the case, see what's going wrong in there. Hope this will unblock you

jeywinlizy commented 7 years ago

Yes SAME Data STRUCTURE resolved the issue

sending the data from my simulated device (Console App) in the same structure given in the readme doc went fine and displayed the graph(tho no data displayed on table - yet to analyse this)

But I would like to connect my Raspberry Pi3 device to send data.. Please help me on using the right project (under Device folder) available within this Connect_The_Dots app, ==> to use configure to send data to the IoT Hub. Should I be using UWPSimulatedSensors? It would be really helpful if you can give me step by step details to add the require project to connect Raspberry Pi to send data to IoT Hub. I have already created a unique device key for my Raspberry Pi3 in my IotHub.

olivierbloch commented 7 years ago

Hi @jeywinlizy Are you running Windows IoT Core or Raspbian on your Raspberry Pi?

jeywinlizy commented 7 years ago

Windows IoT Core

olivierbloch commented 7 years ago

Then the UWPSimulated sensor sample is a good starting point. You should be able to run it as is on the Pi running IoT Core, then you will need to hook up your sensors within the app.

olivierbloch commented 7 years ago

CLosing as the original issue is solved

jeywinlizy commented 7 years ago

Please excuse me ;I have another one query on executing Connet-The_Dots. With the mentioned data structure where should the device sent the data - to --> IoT Hub or Event Hub? I have read in the read me doc as below

Whats new in the V2 :- ...The main change is the use of Azure IoT Hub instead of Event Hubs for connecting devices to the Cloud...

But the app drafts the graph if only the device send data to EventHub. Or am I missing something here and that its still possible to subscribe data from IoTHub?

olivierbloch commented 7 years ago

@jeywinlizy all app samples have been updated to send data to IoT Hub. The website feeds from the same IoT Hub for the real time data and from an event hub where alerts (posted by Stream Analytics) are.

jeywinlizy commented 7 years ago

I guess then I have not given my connection strings properly. Please help me on config side connection string of Connect_The_Dots.


    <add key="azure.IoT.IoTHub.ConnectionString" value="HostName=**I have given the connection string of IoT Hub.  Is that RIGHT?**="/>
    <add key="azure.IoT.IoTHub.EventHub.Name" value="Name of the event Hub            OR   should it be the string =====>        messages/events"/>
    <add key="azure.IoT.IoTHub.EventHub.ConnectionString" value="Connection String taken from the IoT Hub's End_Points `/>
    <add key="azure.IoT.IoTHub.EventHub.ConsumerGroup" value="$Default"/>
    <add key="azure.ServiceBus.EventHub.Name" value="`???   What should be given here   ???`"/>
    <add key="azure.ServiceBus.EventHub.ConnectionString" value="`Connection String of the created Event `Hub"/>
    <add key="azure.ServiceBus.EventHub.ConsumerGroup" value="$Default"/>
    <add key="azure.Storage.ConnectionString" value="???   SHould a Storage be created in the IoT Hub ???"/>

A comment is given for these settings as : The below app settings are set by the ARM template - which should be for App Service deploy. But am able to execute in my local system with the setting of IoT\Event Hub Connection string value for the above keys. I am able to execute the code and get graph continuously plotted too when data (with the defined structure) is sent to Event Hub WHILE am not seeing the Graph when data is sent to IoT Hub.

Also should I be creating a new ticket for this query. If so let me know I shall create a new thread on my queries of Executing Connect-The-Dots

olivierbloch commented 7 years ago

Hi @jeywinlizy Please create a separate issue if you are still having problems.