Skip to content

Cloud4RPi in a Docker Container. Cloud4RPi is a Cloud platform for Raspberry Pi and other IoT devices

License

Notifications You must be signed in to change notification settings

meetyg/cloud4rpi_docker_image

Repository files navigation

Docker Image for running Cloud4RPi (https://cloud4rpi.io/) monitoring script on SBCs


Prerequisites:

  • Register at Cloud4rpi (https://cloud4rpi.io/)
  • In Cloud4Rpi site add a new device and get a device TOKEN (do this for each device you want to monitor on Cloud4Rpi)
  • On your SBC (Raspberry pi, Odroid etc...) make sure you have docker installed.

Usage:

You can pull this image from docker hub (https://hub.docker.com/r/meetyg/cloud4rpi), or build it yourself (usefull for customization).

Run it:

sudo docker run -d --name c4rpi -e TOKEN=<YOUR-DEVICE-TOKEN> --hostname $(hostname) --restart unless-stopped meetyg/cloud4rpi:<architecture>

Currently the following architectures are supported:
arm64v8 or aarch64 - for 64 bit ARM devices
arm32v7 or armhf - for 32 bit ARM devices

NEW Feature: Support for Getting Weather data from OpenWeatherMap ! In order to get data from OpenWeatherMap, you need to register, and get an API key. You need to specify this key, and your city and country code (as recognized in OWM) as environment variables. So just add to the docker run command the following variables (after specifying your Cloud4Rpi token): -e OWM_API_KEY=<YOUR-OWM-KEY> -e OWM_CITY_COUNTRY="London,GB" for example.

Build it yourself:

In order to use the image, you need to build it first. Please note: Building the docker image should be on your SBC.

  1. Clone this repo:
    git clone https://github.com/meetyg/cloud4rpi_docker_image.git

  2. Build the Dockerfile (this may take a while, please be patient!):
    cd cloud4rpi_docker_image
    sudo docker build -t cloud4rpi .

  3. Now you can run the image.
    Don't forget to replace <YOUR-DEVICE-TOKEN> with the specific device token you got from Cloud4Rpi
    sudo docker run -d --name c4rpi -e TOKEN=<YOUR-DEVICE-TOKEN> --hostname $(hostname) --restart unless-stopped cloud4rpi The docker container will run at startup, unless you stop it.

  4. Check at Cloud4Rpi site to see if you device's info shows up. If so, you can create dashboards and alerts as you wish. If it doesn't show up, check the docker logs to make sure the image is running without problems: sudo docker logs c4rpi or sudo docker ps and check if its still running.

This was tested and is working on the following SBCs running DietPi:

  • Raspberry Pi 3
  • Odroid XU4
  • Pine Rock64 (Running 64 bit Linux)

License

Feel free to clone this repo and change the monitoring script cloud4rpi_monitor.py or the Dockerfile as you wish. If you run into any problems open an issue, and I'll try to help as best as I can. Please see the Cloud4Rpi licenses and terms/conditions.

Disclaimer

I am not affiliated with Cloud4RPi in any way.

Use this at your own risk!
I do not take any responsability what so ever...

About

Cloud4RPi in a Docker Container. Cloud4RPi is a Cloud platform for Raspberry Pi and other IoT devices

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published