Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See the Wiki for download

Weather Update to S3

Discussion and questions about Cumulus weather station software version 1. This section and its subforums are the main place to get help with Cumulus. Anything which is not specific to the type of weather station goes in here; for anything specific to a type of weather station, please use the appropriate subforum. Use the 'website development' section for any questions relating to creating or running a web site for Cumulus data. Discussion of the stations themselves in these sections is fine.
Post Reply
NJITman
Posts: 1
Joined: Sun Jan 14, 2018 12:22 pm
Weather Station: Davis Vantage Pro2
Operating System: Windows 10

Weather Update to S3

Post by NJITman » Sun Jan 21, 2018 7:10 pm

Just converted my Cumulus 1.94 setup to use a S3 bucket setup for static web hosting. Since FTP to S3 is not an option, I created two batch files that use AWS CLI to upload the files to the S3 bucket. Here are the complete steps to getting it working. A little high level, but enough details are provided to get your through it.

For those that are interested, here are the steps for using S3 for your weather site.

1. Create a public hosted zone in AWS Route 53 for the domain you are going to use. Skip if you already registered or transferred your domain to AWS.

2. Update the name server entries with your current registrar for your domain to use the AWS provided name servers. You will find them in the hosted zone records in AWS Route 53. Skip if you already registered or transferred your domain to AWS.

3. Create an S3 bucket called <your-domain-name>. For example, weatherons3.com.

4. Configure the bucket to be publicly accessible and set static web site hosting for the bucket. Set the index and error files to index.htm. Alternately, you can create a simple error.htm file to include. It should never be called anyway, since the bucket is publicly accessible.

5. Create images and dbimages "folders" in your S3 bucket root.

6. Copy the files from your Cumulus directory into S3. You can use drag and drop in the AWS S3 console or use a program like CloudBerry Explorer.
webfiles/dbimages/*.* -> /dbimages
webfiles/images/picture.jpg -> /images
CumulusRealtime.swf -> /
weatherstyle.css -> /
wz_jsgraphics.js -> /

7. Create a batch file for normal web update - I called it WeatherUpdate15.bat since it updates every 15 minutes. Place this file in your Cumulus directory on your computer.

aws s3 cp realtime.txt s3://<your-domain-name>/ --acl public-read
aws s3 cp wxnow.txt s3://<your-domain-name>/ --acl public-read
cd web
aws s3 cp . s3://<your-domain-name>/ --recursive --acl public-read

8. Create a batch file for real time web update - I called it WeatherUpdateRT.bat. Place this file in your Cumulus directory on your computer.

aws s3 cp realtime.txt s3://<your-domain-name>/ --acl public-read

9. Download and install AWS CLI for your operating system (32 or 64 bit). https://aws.amazon.com/cli/

10. Create an IAM User in AWS (for example, call it weather) and give the user just programmatic access. For permissions, you can use S3 Full Access, so that you can upload files and set the file permissions. Save the Access Key ID and Secret Access Key for the user - you will need it below.

11. Open a command prompt and run the following. This step only has to be done once.

aws configure

When prompted, enter the Access Key ID and Secret Access Key for the IAM User created. Enter the region that you use for your account. Output format can be default.

I always run the command again and verify the values I entered are in place - they will be shown in brackets. Just hit enter to keep the saved values.

12. Test the batch files and make sure files are being uploaded to S3. Open a command prompt and navigate to the Cumulus directory. See below. The aws copy command will show output and error messages if there are any issues.

cd \Cumulus
WeatherUpdate15.bat

13. Open Cumulus and go to Configuration and then Internet.

14. Under External Programs, enter the full path name to the batch files created above. For example:

Program = C:\Cumulus\WeatherUpdate15.bat
Realtime = C:\Cumulus\WeatherUpdateRT.bat
Daily = C:\Cumulus\WeatherUpdate15.bat

15. Click OK to save changes and restart Cumulus.

16. Go back to AWS Route 53 and into the hosted zone for your domain.

17. Create a record set to point the domain to the S3 bucket that is hosting the site.

Create Record Set
Name (leave this blank for naked domain name)
Type = A - IPv4
Alias = Yes
Alias Target - Click in the box and wait for the S3 target to be shown. Select it.
Click Create.

18. Allow some time for DNS propagation changes to take place, especially if the name servers were just changed to AWS.

19. Browse to <your-domain-name> and verify the pages work.

Optional - these steps will allow http://www. access as well.
1. Create an S3 bucket called http://www. For example, http://www.weatherons3.com.

2. Configure the bucket to be publicly accessible and set static web site hosting for the bucket. Set to redirect and pick the naked domain S3 bucket <your-domain-name>.

3. Go back to AWS Route 53 and into the hosted zone for your domain.

4. Create a record set to point the domain to the S3 bucket that is hosting the site.

Create Record Set
Name = www
Type = A - IPv4
Alias = Yes
Alias Target - Click in the box and wait for the S3 target to be shown. Select it.
Click Create.

Post Reply