Repository for the web application course.
- Installed React Native: https://facebook.github.io/react-native/docs/getting-started.html
-
Install dependencies:
cd ReactNativeApp npm install react-native link
-
Configure the host of your REST API under
app\network\host.{platform}.js
-
App quits after start or when selecting a plant image:
- Check whether manual configuration of the image-cropper is correct: https://github.com/ivpusic/react-native-image-crop-picker#post-install-steps
-
App quits when selection a plant image:
- Check whether the permissions to the Photo Library are configured in your XCode-Project
- Python 3
- Sqlite
- Running Redis server
-
Create a virtualenv to isolate our package dependencies locally
cd server virtualenv env
-
Start virtual environment
source env/bin/activate # On Windows use `env\Scripts\activate`
-
Install dependencies
pip install -r requirements.txt
-
Init database
python manage.py makemigrations api python manage.py migrate api
-
Adjust the config files for your setup
- MQTT-Broker: watering_of_things/config/mqtt_settings.py
- Redis-Server watering_of_things/celery.py Here you can find a list of public mqtt brokers: https://github.com/mqtt/mqtt.github.io/wiki/public_brokers
-
Start server
python manage.py runserver
-
Start Celery beat and worker (for regular moisture measurements)
celery -B -A watering_of_things worker -l info
-
Add a valid controller id, e.g.
python manage.py shell # Switch to the python shell from watering_of_things.api.models import MicroController MicroController(’<your valid id>’).save() exit()
- Hardware setup similar to this: https://github.com/wochinge/WateringOfThings/blob/master/Technical%20Documentation/Pictures/platinenlayout.png
- Arduino IDE: http://www.arduino.org/downloads
- Set up your board in the IDE (we used a NodeMcu v.1.0)
- Create a file called
WifiConfig.h
(seeWifiConfig_example.h
for an example) which stores the credentials for your wifi - Create a filed called
MqttConfig.h
(seeMqttConfig_example.h
for an example) which stores the credentials for your mqtt broker - Create a filed called
ID.h
(seeID_example.h
for an example) which stores the unique ID of the hardware controller. Note: This unique ID should also be stored on the server as valid controller id - Install the following libraries through the Arduino IDE:
- PubSubClient (Nick O’Leary)
- ArduinoJson (Benoit Blanchon)
- You might change the pin settings to fit your hardware
- Compile it and load it on your hardware