Python application that runs on Heroku, collects data pertaining to various cities and reports the data to AT&T M2X.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE initial commit Jun 4, 2015
requirements.txt initial commit Jun 4, 2015




This application runs on Heroku, collects data pertaining to various cities and reports the data to AT&T's M2X time-series data service.

Check out the data which I've made publicly available via my account on M2X @ M2X Public Device Catalog


You will need to have an account on the following services:

  1. M2X: M2X is an IoT time-series data storage service. The M2X developer tier account is free for up to 10 devices @ 100,000 max data points written per device/month. This application creates one M2X device per city listed in /data/cities.txt, as long as there are 10 or fewer cities listed in that file you will be able to utilize this application with a developer tier account. The current build of the application pushes less than 10,000 datapoints per device, well under the developer tier limit. Should you desire more capacity you'll need to upgrade your M2X Account.
  2. Heroku: Heroku is a PaaS that enables developers to build and run applications entirely in the cloud. Because this example application uses only one Heroku dyno, it should be free for you to use, no matter how many other Heroku applications you have.
  3. is a global weather service with an open API for accessing weather data. The developer account is free and allows for up to 1000 API calls per month. This application utilizes to retrieve weather data for the cities listed in /data/cities.txt.

API Keys

Obtain your API Key from their developer portal


Deploying your application

Click the Heroku button to deploy your application to Heroku:


Setup Config Variables in Heroku

Via Heroku CLI

(requires Heroku Toolbelt) API Key:


Via Heroku Dashboard

You can also edit config vars on your app’s settings tab on your Heroku Dashboard.

Adjust /data/cities.txt (optional)

Adjust the list of cities in /data/cities.txt if desired. This is a newline separated list of Cities that will be tracked by this app. Forecast data from is retrieved for the cities listed in /data/cities.txt.

Scaling Your Application

Scale the number of clock workers to 1, once this is done the script will start and is set up to run every 2 days. Why 2 days? Hourly forecast data from returns data for the past 48 hours, so the script is set up to run every 2 days.

Via Heroku CLI

heroku ps:scale clock=1

Via Heroku Dashboard

Go to the Resources tab on your application's dashboard on Heroku and scale the python process so that it uses one dyno.


Feel free to report any issues you encounter with this app via GitHub

Thanks to...


This sample application is released under the MIT license. See LICENSE for the terms.