Installing MudPi

To get started, download the MudPi repository from GitHub, edit your mudpi.config configuration file and run the main MudPi script by executing python3 mudpi.py from the root of your MudPi installation. Make sure to install the prerequisites below if you have not already.

Prerequisites

There are a few libraries that need to be installed for a minimal setup. However, if you want to take advantage of all the features of MudPi you will need to also install the additional requirements. If you have followed the getting started guide you will have all the minimal requirements already installed.

Minimal Requirements

  • Raspberry Pi
  • Python 3.4+ (Comes with Raspbian)
  • RPi.GPIO 0.6.3 (Comes with Raspbian)
  • Redis 3.2* (Redis to store values and Pub/Sub)

Visit the preparing your raspberry pi guide if you need help installing any of the above requirements.

Install MudPi

Once you have met the prerequisites above you are ready to install MudPi which only takes a few minutes to get up and running.

Clone MudPi repository from GitHub into a folder of your choice.

cd path/to/install/mudpi
git clone https://github.com/olixr/mudpi.git

Alternatively you can also download the MudPi repo as a zip file if you prefer it to using git.

Plug in Hardware

Connect your components to your pi. MudPi is built so you can add sensors and configure the system to your specific setup. There are a variety of components supported already by MudPi. You just need to connect your hardware and make sure to update the configuration file with proper pins.

Here is a basic hardware example to get started with a DHT11 Humidity sensor hooked up to the pi on GPIO pin 25. This will work the the configuration file example below and included by default.

MudPi Smart Garden

You can review more info under the sensors section about all the sensor types available to you.

Create a Configuration File

MudPi loads everything it needs from a JSON formatted file in the root installation folder named mudpi.config. Below is an example of a basic configuration file for a single temperature sensor attached to a raspberry pi.

{
    "name": "MudPi",
    "debug": false,
    "redis": {
        "host": "127.0.0.1",
        "port": 6379
    }
    "workers":[{
        "type":"sensor",
        "sensors": [
            {
                "type":"Humidity",
                "pin": 25,
                "name":"Weather Sensor"
            }
        ]
    }]
}

This configuration file example is included when you install MudPi. You can find it in the root install folder named mudpi.config.example

I have also designed a configuration tool to create your file as well because I like making your life easier. However, if you plan to edit the config file manually or want know more about it, you can find details about each of the configuration options available in the configuration section.

Run MudPi

MudPi was built on python 3 and everything is executed from the main script. All you need to do after you have configured MudPi is run the mudpi.py script from the root folder of your MudPi installation.

cd your/path/to/mudpi
python3 mudpi.py
MudPi Smart Garden

I suggest running MudPi in the background and keep it up with a process monitor like supervisord.