Weather Station and Faw Counting
-
2.1. Hardware
2.2. Software
2.2.1. Node-RED
2.2.2. MongoDB Client
2.2.3. FawPredict
Pending ...
- ESP32
- GY1145
- Weather Station (DF Robot)
- Faw Counter (custom design)
- Install ESP32 Add-on in Arduino IDE.
- In Arduino IDE, go to File > Preferences.
- Copy and paste the following line to the Additional Boards Manager URLs field:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json - Open the Boards Manager:
- You can go to Tools > Board > Boards Manager…
- Search for ESP32 and press the install button for esp32 by Arduino.
- You can go to Tools > Board > Boards Manager…
- Add SoftwareSerial Lib:
- In the menu bar, select Sketchs > Include Library > Add .Zip Library...
- Select espsoftwareserial-main.zip in Libs folder.
- Add GY1145 Libs:
- In the menu bar, select Tools > Manage Libraries…
- Search "Adafruit SI1145" and install.
- Wifi Lib:
- The PubSubClient library provides a client for doing simple publish/subscribe messaging with a server that supports MQTT (basically allows your ESP32 to talk with Node-RED).
Click here to dowload Libs
You should have a .zip folder in your Downloads folder Unzip the .zip folder and you should get pubsubclient-master folder.
Rename your folder from pubsubclient-master to pubsubclient. - In the menu bar, select Sketchs > Include Library > Add .Zip Library...
- Select pubsubclient.zip.
ESP32 | Weather | GY1145 | Counter |
---|---|---|---|
5V | 5V | x | 5V |
3.3V | x | x | Vin |
GND | GND | GND | GND |
TX2 | RX | x | x |
RX2 | TX | x | x |
SCL | x | SCL | x |
SDA | x | SDA | x |
GPIO33 | x | x | OUT |
- Install Node-RED: Click here
- Import flows.json to Node-RED
- Open terminal: Run command: node-red and open link local server.
cd Software/MongoDBClient
pip install -r requirements.txt
- Clone repo
cd Software/FAWpredict
pip install -r requirements.txt
- Copy .env.example into .env and fill in the API key
Open the terminal and type
python FAWPredict.py --mode [SELECT_MODE] --location [SELECT_LOCATION] --date [SELECT_DATE] --age [SELECT_AGE]
- [SELECT_MODE]:
regression
mode orlookup
mode - [SELECT_LOCATION]: location to analyze (for example: Hanoi)
- [SELECT_DATE]: format: yyyy-mm-dd (Example: 2022-04-01)
- [SELECT_AGE]: a number from 0-8 represent for development stages of worm
0: egg
1: first instar
2: second instar
3: third instar
4: fourth instar
5: fifth instar
6: sixth instar
7: larval stage
8: adult stage