This is a WaziApp that runs on the WaziGate. It gets sensor data of a specific device and also has a switch for an actuator. Once the different sensor data of a device are obtained, we analyze them and display relevant insights on the WaziApp dashboard.
Link to GitHub Repository: Waziup/smart-irrigation-waziapp
You first need to have WaziGate setup . For instructions on how to do this, you can use Waziup’s tutorial from the WaziApp course.
From the tutorial, the steps that you are required to carry out are under Preparing the development environment section.
These are:
- Setup Wazigate firmware
- Setup communication channels
- Find WaziGate’s IP address
- IDE installation
- Install FTP on WaziGate
-
SSH into the WaziGate (Tutorial here)
-
Navigate to waziup : ~/waziup-gateway/apps/waziup
cd /home/pi/waziup-gateway/apps/waziup
- Download the repository to current directory
git clone https://github.com/Waziup/smart-irrigation-waziapp
- Navigate into the repository
cd smart-irrigation-waziapp
A device’s JSON needs to have sensors data of : soil moisture, humidity and temperature; in the listed order. This requirement is so that the main.py can correctly obtain the 3 sensors from the JSON. Also, an actuator is needed to have been created from the dashboard.
- First open docker-compose.yml and under volumes uncomment line:
- ./:/root/src/ # Uncomment for development
- Open Dockerfile and uncomment the line:
ENTRYPOINT ["tail", "-f", "/dev/null"]
-
Open main.py. Change deviceID with your Device ID. Where XXXXX is the Device you want to get its sensor data.
-
Open ui/toggle.js script. Here, change deviceID and actuatorID values with the IDs of the same device you used in main.py. Actuator ID is for the actuator of that device. This script makes POST requests which sets the actuator states: true or false.
-
Build the container:
docker-compose build
- Start the container in background:
docker-compose up -d
Once the WaziApp has been configured successfully and started, you can open the Smart Irrigation WaziApp on your gateway. You will see the sensor data, insights from the data and also and actuator switch which toggles your actuator to ‘true’ or ‘false’. These actuator states are sent back to the WaziDev/WaziAct/WaziGate as payloads.
You can then control your motors, relays, solenoid, lamps or pumps; from the WaziApp!