Difference between revisions of "Change: Weather Data"
(Created page with "Currently, in version 0.1-0.2, the program on the hive computer reads the local weather from weather underground in xml, parses out the variables that are logged locally and a...") |
(No difference)
|
Revision as of 03:25, 10 January 2014
Currently, in version 0.1-0.2, the program on the hive computer reads the local weather from weather underground in xml, parses out the variables that are logged locally and appends the weather xml file to the hive data xml file.
Now that a central database is used and the hive computers are often behind firewalls and run more like data collectors, this is not efficient. Instead of the hive computer downloading the weather data and uploading it to the database, it make more sense for the data base to access the weather data.
A problem was observed with the script that reads the xml file posted by the hive. It was failing with this error
mismatched tag at line 14, column 2, byte 719 at /usr/local/lib/perl5/site_perl/5.8.8/i686-linux/XML/Parser.pm line 187
Weather Underground was down. cURL was returning an error message instead of the xml page. The xml file sent to the database was corrupted:
<hive_observation> <hive_id>XP001</hive_id> <hive_observation_time>2014/01/09 19:10:01</hive_observation_time> <hive_observation_time_rfc822>Mon, 08 Jul 2013 11:20:03 GMT</hive_observation_time_rfc822> <hive_weight_lbs>+ 66.5 lb</hive_weight_lbs> <hive_temp_c>22.3</hive_temp_c> <hive_ambient_temp_c>5.1</hive_ambient_temp_c> <hive_ambient_relative_humidity>62.2</hive_ambient_relative_humidity> </hive_observation> <HTML><HEAD><TITLE>Error</TITLE></HEAD><BODY> An error occurred while processing your request.<p> Reference #97.45ff4f17.1389312638.28562732 </BODY></HTML> [repeated 5 more times] </hive_data>