Skip to content

Latest commit

 

History

History
91 lines (63 loc) · 4.33 KB

README.md

File metadata and controls

91 lines (63 loc) · 4.33 KB

Inkplate 10 Weather Calendar Server

A service for the weather calendar client written in Python3, backed by Airium and Chromedriver.

Example 1 Example 2 Example 3
Screenshot 2023-05-17 at 01 07 53

Setup

Accuweather API

In order to obtain an API Key, you will need to:

  1. Sign up to developer.accuweather.com.
  2. Create an app in https://developer.accuweather.com/user/me/apps.
  3. Enter some details about the app's usage and purpose.
  4. Generate API key.

Make sure you update the config weather.apikey with your generated api key and update weather.service to accuweather.

OpenWeatherMap API

In order to obtain an API Key, you will need to sign up to OpenWeatherMap and generate an API key.

Make sure you update the config weather.apikey with your generated api key and update weather.service to openweathermap.

Google StaticMaps API

In order to generate a static map of your area you will need to sign up to Google's developer console:

  1. Create a new project.
  2. Go to Google Maps Platform → Maps Static APIEnable.
  3. Go to CredentialsCreate CredentialsAPI Key
  4. After generating your API key, copy and update google.apikey in config.yaml
  5. (Optional) add restriction to API Key and limit only to the Maps Static API service.

This will give us access to the Static Maps API service. In order to re-create the static map in the picture above, we first need to create a map style:

  1. In Google Maps Platform → Map stylesCreate style
  2. In order to replicate the style used above, select Import JSON and paste the contents of map-style.json into the text field. This should replicate the map style I use.
  3. Click Save and assign a name to the map style.

You can now use the map style to create a map ID that we can reference in our server:

  1. In Google Maps Platform → Map managementCreate Map ID.
  2. Give the Map ID a name and make sure map type is set to static, then click Save.
  3. Update the associated map style to the name of the map style created in the steps earlier.
  4. Copy the Map ID and update the google.staticmaps_id field in config.yaml.

Server setup

Ensure Python3 is installed on your system

python3 --version
Python 3.9.2

Download project and install dependencies

git clone https://github.com/chrisjtwomey/inkplate10-weather-cal.git
cd inkplate10-weather-cal
python3 -m pip install -r requirements.txt

Run the server manually:

python3 server.py

Run the server 9am each day:

crontab -e

Add this line:

0 9 * * * /usr/bin/python3 /path/to/server.py

/path/to/server.py should be updated to whatever the absolute path is to where server.py is on your filesystem.