Hello All
I am currently posting data from a CR1000 to Weather Underground and all is OK apart from the rain data.
Weather Underground requires "Hourly Rainfall", Can some kind person suggest some code to help me with this ?
My program was developed with shortcut 3.0 .. Using Device Config Utility I can see the gauge tip count at each scan, then the next scan resets this to zero.
Thanks for any help.
Best regards.
In your Short Cut program you need an hourly output table with a Total Output for rainfall.
Dana W.
Hello Dana
Thanks for your support.
The Short Cut program in question is included below.
There is a second part to this program which takes the Public variables and sends them on to Weather Underground every 10 minutes. The Table 1 data being stored at hourly intervals. Can I ask how is possible to have the hourly rain data sent to Weather Underground ? I have also included the line of code for uploading the rainfall (but this just sends the Public variable.
Regards.
http_get_uri = http_get_uri & "&rainin=" & Round(Rain_mm / 25.0,1) 'Precipitation
'CR1000 'Created by Short Cut (3.1) 'Declare Variables and Units Dim AirTC_2 Public BattV Public PTemp_C Public Rain_mm Public AirTC Public RH Public VW Public WindDir Public WS_mph Public T107_C Public kohms Public TdC Public NR_Wm2 Public BP_mbar Units BattV=Volts Units PTemp_C=Deg C Units Rain_mm=mm Units AirTC=Deg C Units RH=% Units WindDir=degrees Units WS_mph=miles/hour Units T107_C=Deg C Units kohms=kilohms Units TdC=Deg C Units NR_Wm2=W/meter^2 Units BP_mbar=mbar 'Define Data Tables DataTable(Table1,True,-1) DataInterval(0,60,Min,10) CardOut(0,-1) Average(1,BattV,FP2,False) Average(1,PTemp_C,FP2,False) Totalize(1,Rain_mm,FP2,False) Average(1,AirTC,FP2,False) Sample(1,RH,FP2) Average(1,VW,FP2,False) Sample(1,WindDir,FP2) Average(1,WS_mph,FP2,False) Maximum(1,WS_mph,FP2,False,False) Average(1,T107_C,FP2,False) Average(1,kohms,FP2,False) Average(1,TdC,FP2,False) Average(1,NR_Wm2,FP2,False) EndTable DataTable(Table2,True,-1) DataInterval(0,1440,Min,10) Minimum(1,BattV,FP2,False,False) EndTable 'Main Program BeginProg 'Main Scan Scan(5,Sec,1,0) 'Default Datalogger Battery Voltage measurement 'BattV' Battery(BattV) 'Default Wiring Panel Temperature measurement 'PTemp_C' PanelTemp(PTemp_C,_50Hz) 'Generic Tipping Bucket Rain Gauge measurement 'Rain_mm' PulseCount(Rain_mm,1,1,2,0,0.2,0) 'HMP45C (panel switched power) Temperature & Relative Humidity Sensor (CSL) measurements 'AirTC' and 'RH' PortSet(9,1) Delay(0,150,mSec) VoltSE(AirTC,1,mV2500,2,0,0,_50Hz,0.1,-40) VoltSE(RH,1,mV2500,3,0,0,_50Hz,0.1,0) PortSet(9,0) If (RH>100) And (RH<108) Then RH=100 'ECHO Probe EC-5 measurement VW: BrHalf(VW,1,mV2500,4,1,1,2500,False,10000,_50Hz,2.975,-0.4) 'W200P Wind Direction Sensor (CSL) measurement 'WindDir' BrHalf(WindDir,1,mV2500,7,1,1,2500,False,20000,_50Hz,357,0) 'A100R Wind Speed Sensor (CSL) measurement 'WS_mph' PulseCount(WS_mph,1,2,2,1,0.7768,0) If WS_mph<0.01 Then WS_mph=0 '107 Temperature Probe (CSL) measurement 'T107_C' Therm107(T107_C,1,8,1,0,_50Hz,1,0) '237 Leaf Wetness Sensor measurement 'kohms' BrHalf(kohms,1,mV25,9,Vx1,1,2500,True,0,250,1,0) kohms=(1/kohms)-101 'Dew Point calculation 'TdC' AirTC_2=AirTC DewPoint(TdC,AirTC_2,RH) If TdC>AirTC_2 Or TdC=NAN Then TdC=AirTC_2 'NR-LITE Net Radiometer (no wind speed correction) measurement 'NR_Wm2' VoltDiff(NR_Wm2,1,mv25,3,True,0,_50Hz,100,0) 'PTB101B Barometric Pressure Sensor (CSL) measurement 'BP_mbar' If TimeIntoInterval(59,60,Min) Then PortSet(1,1) If TimeIntoInterval(0,60,Min) Then VoltSE(BP_mbar,1,mV2500,1,1,0,_50Hz,0.184,614.5709) BP_mbar=BP_mbar*1 PortSet(1,0) EndIf 'Call Data Tables and Store Data CallTable Table1 CallTable Table2 NextScan
As you mention, you are sending the Public variable, not the data table field which would contain the total. I am not familar with Weather Underground (you'll have to get help elsewhere on that) or using HTTP get, but you may be able to specify a table in the URI (e.g., Table1.Rain_mm). If you can only send from the public table, you may need to edit your program in CRBasic, use the data table access syntax to store the value from the table into a variable (or the GetRecord instruction), and then upload that. But then again, I don't know what you'll need to do for Weather Underground. Information on both GetRecord and the Data Table Access syntax is available in the CRBasic help.
You may want to consult this recent blog post on our web site: https://www.campbellsci.com/blog/post-cr6-data-to-weather-underground
Dana W.