This a continuation of the Plant Guardian project that’s generously sponsored by Conrad. This time the code has been slightly updated to include email notifications when the sensor values pass below a set threshold. In order to get started, please read the first parts that’s linked above, and use this guide for additional configuration help.
1. Enter the application directory
In the previous guide we installed Plant Guardian into an application directory in the main user home folder. To get there, enter the following command:
cd /home/pi/Applications/PlantGuardian
2. Update the software to the latest version
Updating the software is easy and requires you to execute the following command: git pull
. Now run the npm update
command to get the latest dependency versions. Once completed we’ve checked out the latest code and we’re ready to proceed to the configuration.
3. Configure the application
The application is easy to configure by opening the file index.js
. The lines we need to alter are #4-19, also represented in the image below. Here we can set the email to which the notification is being sent, the email subject as well as sender name and email. In the plants section we can also go ahead and name each plant and set a moisture threshold for which it will send a notification, should the level go below that. Once you’re done, save the file and continue to the next step.
4. Restart services
Since the application is running continuously we need to restart the service so that our new code is in the memory. To do so, simply enter the following command: sudo service supervisor restart
. Once you’ve done that, you’re done.
5. Profit
You’ve now updated the code to the latest version and are good to go. Enjoy your soil moisture watcher (Plant Guardian) with notifications!
Things other people recently wrote