Azure / connectthedots

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

Nothing Happening #126

Closed RubenvWyk closed 9 years ago

RubenvWyk commented 9 years ago

Hi All,

I followed the steps provided to get my ConnectTheDots and Azure platform up and running, but at the moment nothing is being recorded by the name.azurewebsites.net ...

  1. This is the message the CTD website gives me:

Connected. Connecting to ws://name.azurewebsites.net/api/websocketconnect?clientId=none

  1. I also notice that in your instructions:

The application has now created a web.config file and put it on your desktop. You need to copy that file over the existing web.config file in the ConnectTheDotsWebSite folder of the Website project before you publish your site.

There is no web.config file in the ConnectTheDotsWebSite folder. I just copied the file from the desktop in there.

  1. At this section:

My Microsoft.ServiceBus.ConnectionString has this structure: value="Endpoint=sb://{namespace-name}.servicebus.windows.net/;SharedAccessKeyName=WebSite;SharedAccessKey={key}" />

not: value="Endpoint=sb://{namespace-name}.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue={key}" />

Where do I begin troubleshooting?

Regards, Ruben

olivierbloch commented 9 years ago

Hi Ruben. Using the SharedAccessKey or the SharedSecretIssuer method for the service bus connection string doesn't matter, both work. Let's try and debug this :-)

olivierbloch commented 9 years ago

Actually you can now find a simple event hub monitor tool in our ehconsole branch: https://github.com/MSOpenTech/connectthedots/tree/ehconsole/EHConsole

RubenvWyk commented 9 years ago

Hi Olivier,

I just got into the office :)

  1. do you mean the values that need to be placed in the web.config file? (which is located in \Azure\WebSite\ConnectTheDotsWebSite)
  2. I have a device "sending", but I see no data here. Checking to see if my Pi setup is correct. I am definitely sending it a JSON string from my Arduino.
  3. I will check this out now.
RubenvWyk commented 9 years ago

On my Pi I can see the folders:

/home/pi/ctdgtwy/logs -> contains startup log /home/pi/ctdgtwy/staging -> empty

I have this feeling that my Pi is not configured correctly

RubenvWyk commented 9 years ago

Compiling this gives me weird errors...

Error 1 The name 'AzureConsoleHelper' does not exist in the current context "pathway" 69 34 Microsoft.ConnectTheDots.EHConsole

Do I need to do everything from the start? I am thinking some files just aren't being created...

UPDATE: I got this working :)

dinarisio commented 9 years ago

Did you get everything working or just EHConsole?

RubenvWyk commented 9 years ago

At the moment, just the console.

But I am checking there are no files in the /staging/ directory... I am going through the deploy.cmd file and manually adding the files that gets specified by:

Copying Gateway Files Copying Scripts Marking executables

dinarisio commented 9 years ago

Can't remember such issues. Have you noticed any errors on running deply.cmd? If not, erros could be shown at putty window that could close pretty fast, so you can try adding 'sleep 1000' command in putty's command lines. Are all files placed in exact same folders as it is expected by script? Also, please ensure that you are building the same configuration as it set in deploy.cmd.

RubenvWyk commented 9 years ago

W00000000t!

Ok, so the problem is definitely in the deploy.cmd on my side. Just started up EHconsole and getting my data :)

I am thinking (I have noticed this with the NOOBS installation) that commands should be executed with sudo in front. If not, it sometimes does not apply the changes, even though it gives no permission error.

Another thing, in your instructions: "Change the Putty and Project directories in the .CMD file as necessary", maybe just specify to what level prjdit should be changed. (for us n00bs :P ), I had to change mine to the level: "...\Devices\Gateways\GatewayService\". I only figured this out after looking at the deploy.cmd code.

So ya, deploy.cmd still does not work for me, I fixed it manually :)

dinarisio commented 9 years ago

So, did you just added sudo in front of all commands or there are another changes that was required to perform? Or it works anyway if putty and project directories are well configured?

RubenvWyk commented 9 years ago

Well, what I did was putty into my Pi and use WinSCP to copy all the files to there correct folders. Then I used command line: sudo chmod 755 on the 4 files that needed to be made executables.

When I ran deploy.cmd, the directories: /home/pi/ctdgtwy/logging and /staging where created, but /staging was empty... leading me to believe that for some reason the files never copied.

Currently my deploy.cmd has this:

set puttydir="c:\Program Files (x86)\PuTTY\" set prjdir="x:\CTDconsole\Devices\Gateways\GatewayService\" <- this might be incorrect? set rpi_ip=192.168.1.114 set rpi_usr=pi set rpi_pw=raspberry set Configuration=Release

dinarisio commented 9 years ago

I use ....\ as prjdir, it's relative path to deploy.cmd. Maybe there is just no pscp at putty's dir? Strange enough.. You are building in release configuration, right?

RubenvWyk commented 9 years ago

Yip, done in release.

Checked, pscp is present.

I will play around with the deploy.cmd and let you know what gets sorted out.

I now have another issue, but starting a new thread :)

olivierbloch commented 9 years ago

Hi Ruben do you have updates on this one for us?

RubenvWyk commented 9 years ago

Please refer to #128 , continuing my explanation and discussion over there...

cavalier67 commented 9 years ago

Hello, I am having this exact same problem. What exactly did you change in the deploy.cmd file to get this functioning? Can you post your cmd file (remove things that you don't want to share)?

cavalier67 commented 9 years ago

I think I figured it out.

rajat007 commented 9 years ago

plz tell me how you had figured it out

cavalier67 commented 9 years ago

I was wrong. It is still not working. The log files say "GatewayService is running..." and I can see the data coming across the serial port in the Arduino, but nothing is getting sent to Event Hubs that I can see. I don't know if it isn't getting to the Raspberry Pi on the USB or if the data is incorrect in some way. I am not really sure where to go from here.

Anyone know where to begin troubleshooting this?

One thing I had to do was manually copy all of the files over using WinSCP as Putty did not seem to be able to get the permissions it needed, even with sudo in front of the commands.

dinarisio commented 9 years ago

Hello, could you please set logging level to 'Verbose' and send produced log file to me so I can take a look?

ghost commented 9 years ago

Build, run EHConsole in the Azure folder. That will show you what messages are being received by your Event Hub, and at least narrow down the issue.

dinarisio commented 9 years ago

Also, please check that Microsoft.ConnectTheDots.SerialPortAdapter.dll contained in the same folder as GatewayService - this dll accepts connection from Arduino.

rajat007 commented 9 years ago

i am having trouble in giving the path which is required in deploy.cmd ,i am giving the path where my project is but it is giving following error

appk_ue7ubrpthfokfr9vytzwxdlw7ftqnwfkkoqxrpl

dinarisio commented 9 years ago

rajat007, did you set 'puttydir' in deploy.cmd to location of putty and pscp executables?

rajat007 commented 9 years ago

what location should be of putdir ?

dinarisio commented 9 years ago

Where you have putty.exe and pscp.exe files downloaded.

cavalier67 commented 9 years ago

This is the only thing that the EHConsole produced:

Starting worker to process partition: 0 Starting worker to process partition: 2 Starting worker to process partition: 5 Starting worker to process partition: 1 Starting worker to process partition: 6 Starting worker to process partition: 4 Starting worker to process partition: 7 Starting worker to process partition: 3 Waiting for start receiving messages: 4 ... Waiting for start receiving messages: 2 ... Waiting for start receiving messages: 5 ... Waiting for start receiving messages: 6 ... Waiting for start receiving messages: 0 ... Waiting for start receiving messages: 3 ... Waiting for start receiving messages: 7 ... Waiting for start receiving messages: 1 ...

It then stopped everything and asked if I wanted to save to a file. It is not really clear what this means.

cavalier67 commented 9 years ago

@dinarisio: All of the files from the GatewayService/WindowsService/bin/Release folder are in the ctdgtwy/staging directory on the Raspberry Pi.

dinarisio commented 9 years ago

@cavalier67 This dll should be in GatewayService\DeviceAdapters\SerialPort\bin\Release. Please refer to deploy.cmd lines.

ghost commented 9 years ago

Your EHConsole output means that the EH is not receiving any data from the Pi. Otherwise you would see rows and rows that were essentially identical to what you see in the Serial Monitor from the Arduino. So focus on whether the amqps string in the Pi config file is correct (did you encode it to remove +/- etc?), and on other setup issues.

rajat007 commented 9 years ago

what should i do to save the log data into database?

cavalier67 commented 9 years ago

First, thank you both very much for the assistance. I have been pounding my head against a wall with this for almost two weeks now.

@dinarisio: My mistake about the source location. The file you referenced is in its proper place on the Raspberry Pi.

@spyrossak: Yes, the amqps strings are encoded correctly. I got them from the log file generated in the AzureSetup.

I got it to run by downloading the latest build and starting over from scratch. However, I scaled the website up to basic to avoid it hitting the cpu limits and it stopped showing data. The EHConsole says data is still coming onto the Event Hub and the Streaming Analytics say Processing, but nothing is showing on the website. Any idea what may have caused that? I have even tried republishing the website to no effect.

This came back up last night, so all is well. Must have just been a hiccup.

dinarisio commented 9 years ago

@cavalier67 Did you placed web.config produced by CreateWebConfig tool to ConnectTheDotsWebSite folder to connect it to correct EventHub?

rajat007 commented 9 years ago

data is not logging on my cloud , arduino is sending data to the pi but data is not logging on service bus

dinarisio commented 9 years ago

@rajat007 is there anything informative in gateways's log files?

rajat007 commented 9 years ago

the log value which i am getting from arduino is in form of json but it is logging on the website , any other steps i had to take in order to get log values into cloud

cavalier67 commented 9 years ago

@dinarisio: It came back up last night, so all is well. I guess scaling caused a hiccup. Thanks for all the help!

shubhkmr commented 9 years ago

I executed deploy.cmd command it seems that everything is fine there and it connected the pi (i guess ) i stopped with 3 second after that i checked my pi log files and no raspberrypi log file is there apart from booting.log in logs folder (ctdgtwy) and staging folder is empty Please help urgently!! iot iot2

cavalier67 commented 9 years ago

@shubhkmr: I had to manually copy the files listed in the CMD file over to the Pi using WinSCP and then manually run the chmod commands on the Pi directly. Look in your ctdgtwy/staging directory and see if there is anything in there. If not, then the CMD file did not copy the files.

rajat007 commented 9 years ago

@cavalier67 your project is now working well plz help me

shubhkmr commented 9 years ago

Sir @cavalier67 please make a detailed description of device prepare part.

I am in urgent need of this. Thanks in advance

Or u can also contact me On Shubhkumar101@gmail.com or Facebook.Com/shubhkmr

cavalier67 commented 9 years ago

@shubhkmr and @rajat007: I did the following in order.

  1. I downloaded the latest build from GitHub
  2. I followed all of the instructions from the guide below. I am not sure that it matters, but I had my Arduino plugged into the Pi when setting up the Pi. https://github.com/MSOpenTech/connectthedots/blob/master/readme.md
  3. The deploy.cmd file did not seem to have the permissions that I needed to transfer files from my PC to the Pi, so I did the following:

    A: Installed WinSCP (not sure I can put a link to it here, so do a search)

    B: Log into the Pi with WinSCP

    C: Copy all of the following files to the ctdgtwy/staging directory (if you get a permission error, then see E below):

          a. Everything in the "GatewayService\WindowsService\bin\Release\" folder
          b. DeviceAdapters\SerialPort\bin\Release\Microsoft.ConnectTheDots.SerialPortAdapter.dll
          c. DeviceAdapters\Socket\bin\Release\Microsoft.ConnectTheDots.SocketAdapter.dll
          d. Scripts\RaspberryPi\Modified\certificate_update.sh
          e. Scripts\RaspberryPi\Modified\autorun_install.sh
          f.  Scripts\RaspberryPi\Modified\kill_all.sh

    D: Copy the following file to the ctdgtwy directory (if you get a permission error, then see E below): a. Scripts\RaspberryPi\Modified\deploy_and_start_ctd_on_boot.sh

    E. It is possible that you will not have permission to copy directly to those folders. If so you will need to copy to the Home/Pi folder with WinSCP and then move the files in a normal SSH (Putty) session using the following:

          a. Log into the Pi using Putty 
          a. Go to the Home/Pi folder
          c. Run this following commands:
                   sudo mv deploy_and_start_ctd_on_boot.sh ctdgtwy
                   sudo mv *.* ctdgtwy/staging

    F: Now you need to make some of the files executable, so run the following: sudo chmod 755 ctdgtwy/staging/certificate_update.sh sudo chmod 755 ctdgtwy/staging/autorun_install.sh sudo chmod 755 ctdgtwy/staging/kill_all.sh sudo chmod 755 ctdgtwy/deploy_and_start_ctd_on_boot.sh

Outside of this, the instructions that you follow in the guide are great.
From here I just plugged it all in and it just started working.

Auto-formatting for the forum has really screwed with this, but it is still readable.

rajat007 commented 9 years ago

@cavalier67 right now we are not getting values on cloud ,in ehalert and ehdevice uit is just showing me the request failed ?

rajat007 commented 9 years ago

plz help what to do on the cloud part so the logged values can be seen there

shubhkmr commented 9 years ago

We got request but they got failed in ehdevices, i dont know why is time set on raspberry pi also affect this bcoz it is set wrong @cavalier67 Please help ASAP

iotgda iotgda1

rajat007 commented 9 years ago

anyone can tell why mine project is not working i have followed the same step

On Sat, Apr 18, 2015 at 2:04 PM, shubhkmr notifications@github.com wrote:

We got request but they got failed in ehdevices, i dont know why is time set on raspberry pi also affect this bcoz it is set wrong @cavalier67 https://github.com/cavalier67 Please help ASAP

[image: iotgda] https://cloud.githubusercontent.com/assets/11982170/7214671/9a93c396-e5d3-11e4-9761-ad407f10cf85.png [image: iotgda1] https://cloud.githubusercontent.com/assets/11982170/7214674/9fb9b560-e5d3-11e4-8975-734a955f918b.png

— Reply to this email directly or view it on GitHub https://github.com/MSOpenTech/connectthedots/issues/126#issuecomment-94144347 .