To demonstrate the use of a 64-bit container, we’ve developed a sample multi-container project that uses a few different technologies. The main idea is to plot a live chart containing the temperature and humidity of any city in the world.
- A download of the project from GitHub
- Software to flash an SD card (balenaEtcher)
- A free balenaCloud account to setup and manage the Pi Download and install the balena CLI tools - to be installed on your computer, allowing you to install the project code on the Raspberry Pi 4.
You will also need to set up environment variables from the balena dashboard:
Name | Value |
---|---|
CITY_LATLNG | The code corresponding to the latitude and longitude of the desired city comma separated. Ex: 38.722252,-9.139337 . |
API_KEY | api key retrieved after signing up at https://darksky.net |
FREQ | Frequency(in minutes) with which to retrieve weather data. |
To get the Lat & Long for your city, you can use latlong.net and type the name of the desired city, such as Lisbon or London. On the
environment variable
, just combine both information comma separated such as38.722252,-9.139337
.
The project is divided into three containers:
- A mongoDB database instance with persistent storage, in which we will store all data.
- A Python 3 application that fetches the weather information from the Dark Sky API and saves it to the database every minute.
- Node.js, ExpressJS, and VueJS application that fetches the data from the mongo database and displays it in a chart, which is refreshed automatically every minute.
Note, the express app is based on https://zellwk.com/blog/crud-express-mongodb/