Node Configuration

Nodes are slave units attached via serial to the main controller that run on micro-controllers (arduino). The nodes wait for configuration and commands from the main controller.

Nodes have four main configurations: name, address, type and sensors. You can find the address of attached serial devices with the following command on the pi: ls /dev

Below is an example of a node configuration with one attached sensor.

{
    "nodes": [
        {
            "name": "Node 1",
            "address": "/dev/ttyUSB0",
            "type": "arduino",
            "sensors": [
                {
                    "pin": 1,
                    "type": "Soil",
                    "name": "Garden_soil_moisutre"
                }
            ]
        }
    ]
}

Settings

OptionTypeRequiredDescription
name[String]YesFriendly display name of the node. Useful for UI.
address[String]YesSerial address of the node connected to our raspberry pi.
type[String]YesType of node that is connected to determine proper worker to load. Available options arduino, ADC-MCP3008
sensors[Array]NoArray of sensor object configs for sensors attached to the node.

Sensor Settings

OptionTypeRequiredDescription
type[String]YesType of sensor. Options: Soil, Rain, Float, Humidity Temperature
pin[Integer]YesGPIO pin number on arduino the sensor is connected to.
name[String]YesName of the sensor. The name will be slugged and used as key to store in redis if a key is not specified.
key[String]NoKey to store value under in redis. Alphanumeric with underscores only. Must be valid redis key. If a key is not provided it will use the name converted to lowercase and spaces replaced with underscores.
percent[Integer]Yes* (Float Type Only)For float sensors this value specifies the percent filled the container is. Useful for UI, not critical to core.
critical[Boolean]Yes* (Float Type Only) For float sensors this value specifies if the liquid level is critical to pump function. **If critical is set to true and the float sensor reads false, the relays will not turn on.

Sensor Types (Arduino)

Arduinos have analog GPIO support and allow us access to a larger range of sensors. Below is a list of available sensor types. You can find more about each sensor type under the nodes section in the docs.

TypeReturnsDescription
Humidity[Object]DHT11 / DHT22 Temperature and humidity reading.
Rain[Integer]Takes an analog reading of resistance across rain sensor to detect moisture level.
Soil[Integer]Takes analog reading of capacitive soil sensor to determine soil moisture.
Float[Boolean]0 or 1 digital read of liquid level. If marked critical it will prevent pump from running until it returns 1 (true)
Temperature[Object]A temperature sensor running on Onewire bus. Onewire can be buggy with other sensors running

Sensor Types (MCP3008)

MCP3008 is an analog to digital converter chip. This allows connecting analog signals to be converted before getting to the pi GPIO. This was a community added feature.

TypeReturnsDescription
Soil[Integer]Takes analog reading of capacitive soil sensor to determine soil moisture.