System for controlling water pumps and valves. Designed for automatic and/or remote watering of indoor/garden plants.
Here you can find an example of a GUI application
yarn devto start the server and emulator.
If the application is not running on Raspberry Pi, the server automatically saves the state of inputs/outputs in emulator/state.json file. A webpage is available at http://localhost:3030 displaying a diagram and the status of individual outputs.
You must have NodeJS installed on your device.
npm install
node server.jsto start the server on your Raspberry Pi
If you want to run the applications on Raspberry startup (Linux), execute the install.sh script
./install.shThe script will add new services to systemd service manager.
By default, the server operates on port 3001. Communication with the server is established using the WebSocket protocol (Socket.IO).
Opens given output and runs pump.
⚠ One module is designed to have only one pump, so in order to calculate the appropriate amount of water and prevent a significant voltage drop, only one output can be open at the same time.
You can send more startWater messages, but they will be added to the queue.
// REQUEST
{ action: 'startWater', device: 'MODULE_01', output: '1', volume: 10 }
// ANSWERS
// Get remaining times of watering queue
{
status: "remainingTimes",
device: "MODULE_01",
remainingTimes: {
1: {wateringIn: 0, wateringTime: 3, wateringVolume: 10}
}
}
// Sent when output starts watering
{ status: "watering", device:"MODULE_01", output: "1", duration: 3 }
// After watering is done
{ status:"done", device: "MODULE_01", output: "1" }Stops pump and closes output. If watering is not started yet, the message is removed from the queue.
// REQUEST
{action: "stopWater", device: "MODULE_01", output: "2"}
// ANSWERS
{
status: "remainingTimes",
device: "MODULE_01",
remainingTimes: {...}
}
// If output is watering
{status: "stopped", device: "MODULE_01", output: "2"}
// If output is scheduled
{status: "aborted", device: "MODULE_01", output: "2"}Gets remaining times of watering queue
{ action: "getRemainingTimes", ... }Edits output configuration
{ action: "editOutput", ... }Edits device configuration
{ action: "editDevice", ... }Edits pins and enable/disable outputs
{ action: "editDeviceOutput", ... }Starts calibration of a given output. Calibration is needed because the water delivery tubes to the flowers may have varying lengths and different heights, which affects the amount of water being dispensed.
{ action: "calibrate", ... }Stops pump and close calibrating output
{ action: "stopCalibrating", ... }Determines how much water output gives in determines how much water flows from a specific output per second.
{ action: "calculateRatio", ... }Configuration is stored in config.default.yml (or config.yml). It is available at http://localhost:3001/config.
