| Both sides previous revision Previous revision | |
| tutorials:it:microcontroller_environmental_sensor [2019/02/24 21:43] – Finalised setup instructions srmes | tutorials:it:microcontroller_environmental_sensor [2019/02/25 13:29] (current) – srmes |
|---|
| - Arrange the components on a breadboard as per the schematic | - Arrange the components on a breadboard as per the schematic |
| - Clone repoitory [[https://github.com/ScottA38/HAB_sensor/|External Link]] | - Clone repoitory [[https://github.com/ScottA38/HAB_sensor/|External Link]] |
| | - **Important:** enter the cloned repository and open 'DHT_Unified_Sensor.ino'. Find the field which starts '#define HOST' and change the variable's value to the *IP address of your current computer* (if debugging/testing) or the *IP address of an appropriate server* (if putting it into production) |
| - Connect the usb cable between your workstation and the NodeMCU v2 module | - Connect the usb cable between your workstation and the NodeMCU v2 module |
| - Open a terminal (Operating System dependent) and run './prepare.sh' in the cloned directory. Ensure there are no failures reported | - Open a terminal (Operating System dependent) and run './prepare.sh' in the cloned directory. Ensure there are no failures reported |
| - Run 'make' to ensure all files compile correcttly. Ensure there are no failures. | - Run 'make' to ensure all files compile correcttly. Ensure there are no failures. |
| - Run 'make upload' to flash the NodeMCU v2 device with the program | - Run 'make upload' to flash the NodeMCU v2 device with the program |
| - Use a program like 'NetCat' to monitor and print out incoming packets going to a specific port over LAN and print them out to screen on the terminal. Listen on port 1337 as this is the port designated within development as a port to test the transmission on. | |
| * **N.B:** if you do not have 'NetCat' you can download it with common package managers such as **'homebrew' (OSX), 'Chocolatey' (Windows), 'apt-get' (Debian-based Linux)** | ====Testing/debugging==== |
| | If you have completed step 4 by entering the IP address of your computer into the **.ino** script, then the following steps apply. |
| | - Ensure that the USB cable is connected to the ESP chip such that it has power |
| | - Within the terminal of your current computer run 'nc -l -p 1337 -u' to monitor and print out incoming packets going to a specific port over LAN and print them out to screen on the terminal. **N.B:** you must specify the '-u' flag (UDP flag) otherwise no network traffic will be received from the ESP chip. Ensure there are readings for all 3 environmental stimuli (temperature, humidity, light) |