Skip to content

ZotPonics Testing Verification

kathymn1 edited this page Mar 4, 2020 · 9 revisions

ZotPonics Testing Verification

This document is used to test a completed ZotPonics System. The following sections to test include (1) API, (2) Sensor and Actuator Activation, (3) System, (4) Electrical

API Testing

Testing POST

To test all the API's POST functionalities, run the following code: pythonanywhereTest.py

This script simply tests each POST API function. This includes:

  • /add-sensor-data
  • /add-lastwatered-data
  • /usercontrolgrowth
  • /userdemo

If it is not working make sure you have set-up your pythonanywhere configurations properly. You can refer to this wiki here:ZotPonics API Documentation

Testing GET

To test all the API's GET functionalities, test each GET API function by accessing each of the following URLs on a web browser:

  • YOUR_URL/recentsensordata
  • YOUR_URL/add-lastwatered-data
  • YOUR_URL/usercontrolgrowth
  • YOUR_URL/userdemo

You should be able to see the raw JSON data retrieved from the API.

Sensors and Actuator Activation

To test the sensor and actuator activation, please refer to the following: Sensor & Actuator Testing

To test the sensor and actuators activation, check the current and voltage through the humidity/temperature sensors, ultrasonic sensors, pumps, and fans.

The purpose of this is to make sure that the individual components are properly powered before putting it all together. Using a multimeter, we can check the components are being powered as expected.

System Testing

To test all the system functionalities, perform the following using ZotPonics_raspi.py:

The ZotPonics.run() function has parameters allowing sensor data to be simulated. Simulated sensor data can be used to test the system design logic and ensure that the appropriate actuators are activated based on certain sensor data. More information can be found here: ZotPonics Class Documentation

ZotPonics.run() also contains a parameter to activate Demo Mode. In demo mode, the user will be able to toggle each actuator in the system through the API (YOUR_URL/userdemo).

Each actuator may also be tested individually through their respective functions:

  • runFan()
  • stopFan()
  • openVent()
  • closeVent()
  • dispenseWater()
  • turnOnLight()
  • turnOffLight()

You're Done!

🎉🎆

Clone this wiki locally