LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to send a URL from within LabView

Solved!
Go to solution

I have written a personal weather station application.  Now I would like to upload data to Weather Underground per their wiki at PWS - upload protocol.  Basically this says to send the string below: 

 

http://rtupdate.wunderground.com/weatherstation/updateweatherstation.php?ID=KCASANFR5&PASSWORD=XXXXXX&dateutc=2000-01-01+10%3A32%3A35&winddir=230&windspeedmph=12&windgustmph=12&tempf=70&rainin=0&baromin=29.1&dewptf=68.2&humidity=90&weather=&clouds=&softwaretype=vws%20versionxx&action=updateraw&realtime=1&rtfreq=2

 

When I cut and paste a similar string, from my LabVIEW application into a browser, the string is correct and works fine.   However I have not been able to send the string succesfully from within the application.

 

The post How do I send an HTTP request to a web server using the TCP functions?  seems to apply, but I have been unsuccessful in applying it to my application.

 

Any help is very much appreciated.

Message Edited by alyeska on 10-12-2008 03:49 PM
Message Edited by alyeska on 10-12-2008 03:49 PM
0 Kudos
Message 1 of 19
(8,738 Views)

Hi alyeska,

if you can send it with your browser, then it should also be possible to connect this string to the "Open URL in Default Browser.vi" at to get the same result. If this doesn´t work for you, then you can use the HTTP format and send it over TCP/IP.

 

Hope it helps.

Mike

0 Kudos
Message 2 of 19
(8,707 Views)

Mike and all,

 

It DOES work with the open_browser_send_url.vi as pictured in the "this works" attachment.  HOWEVER, I am uploading data every two seconds and this is a lot of browser windows and not very "elegant"....

 

It does NOT work with HTTP and TCP functions as picture in "this does not work" attachment.  This is the approach I have been working on, but without success.  It produces no errors, but weather underground does not get the data either.

 

Your help is appreciated,

 

Dave

Download All
0 Kudos
Message 3 of 19
(8,680 Views)

Hi Dave,

you have to send it in the HTTP style. Smiley Wink

 

See the attached picture as an example. You have to replace the part between "GET " and "HTTP" in the first line with your specific data.

May be you need an empty line after all this.

 

Mike

Message Edited by MikeS81 on 10-13-2008 04:33 PM
0 Kudos
Message 4 of 19
(8,666 Views)

Mike,

 

Yes, I thought that was the case, and spent most of yesterday trying that approach ..... with your help this morning I must be close, but not quite there.  Based on some other reading, I need Host:  rtupdate.wunderground.com and a User-Agent: (no idea what goes here)  statements.....

 

Attached is the relevant part of the .vi (minus passwords..)

 

What "little" detail am I missing?

 

Dave

 

ps:  the attachment shows HTTP//1.1 which I have corrected to HTTP/1.1  (sorry)

 

 

Message Edited by alyeska on 10-13-2008 10:19 AM
0 Kudos
Message 5 of 19
(8,656 Views)
Solution
Accepted by topic author Dave@Ventec

Hi Dave,

i can´t exactly say what you have to send, but you can find out. You can use an TCP/IP analyzer or the attached WebServer. Smiley Wink Run the WebServer.Main.vi and call your webside with all your parameters from your browser with one change. Connect to localhost instead of the server you really want. Press first the start button, use show vi history to see the dynamical loaded vi. Open it. There you can see everything you send from the browser to this webserver and this is what you also have to send later to your real webside.

 

Hope it helps.

Mike

Message 6 of 19
(8,640 Views)

Mike,

 

OK, got the WebServer working and I do see some differences.  Not all of which I understand at this point, looks like carriage returns and line feeds are important components.  So I will be doing some more studying after I return from a two day trip.

 

Just wanted you to know that you have helped and I appreciate the TIMELY responses.

 

Best,

David

0 Kudos
Message 7 of 19
(8,624 Views)

Mike,

 

Well I had a few more minutes to test today, and GOT IT WORKING.  Need \r\n in three places! 

 

Thank you so much for your timely assistance!

 

David

0 Kudos
Message 8 of 19
(8,618 Views)

Hi alyeska,

 

I had similar project. I need upload stock file (Qty, price,etc.) on to Amazon.com (had always kept logining to my accoun first). 

Can you help ?

0 Kudos
Message 9 of 19
(8,134 Views)

Hi vcxo,

can you explain something more? Where do you have problems?

 

Mike

0 Kudos
Message 10 of 19
(8,128 Views)