Purpose
The purpose of this project is to provide a simple device which users can configure to connect to the internet and begin upload time-series data for the plant(s) they are monitoring.
How does the device work?
-
User registers the sensors / instruments the device will be using through the Mikaponics website or Mikaponics staff will manually registering through the Mikaponics API web-service. Once registered, the API web-service will provide
UUID
values for each sensor / instrument. -
User registers
OAuth 2.0 Client Credentials
from the Mikaponics API web-service either manually or done by staff to be provided with theclient_id
andclient_secret
values. -
This device pulls the Mikaponics Soil (Arduino) device every minute to get the latest sensor data.
-
This device saves the time-series data to the local database.
-
This device uploads the time-series data to Mikaponics API web-service it has saved in the local database. This process uses the registered UUID and OAuth credentials.
-
Local time series data gets purged once successfully uploaded.
How is the software work?
-
The application is structured in a microservices architecture . This means every application is an independent program, running indepdently in the system.
-
Every application is connected to each other using the
Python
remote distrubuted objects library calledPyro4
. -
Every independent program is called a
service
in our system. -
Every
service
automatically boots at startup
What services are there available?
Nameserver
We are using the Pyro4
library which will connect all the applications.
Storage
The storage_service.py
application is responsible for providing an interface for all applications to access and GET/SET key-value paired data in a local database.
Instruments
The instrument_service.py
application is responsible for providing service for polling the instrumentation in the Arduino sensor's and sends the data to the storage application through rpc
.
Logging
The logging_service.py
application is responsible for maintaining a runtime clock with an interval of every minute to poll our time-series data from our instruments and save them to our local storage.
Remote
The remote_service.py
application is responsible for interfacing with Mikaponics API Web-Service.
What Raspberry Pi devices does this code work on?
The following devices were tested and confirmed working:
- Raspberry Pi 3 Model A+ 1.4GHz