mirror of
				https://github.com/KevinMidboe/ESP-Plant-Logger.git
				synced 2025-10-29 17:40:20 +00:00 
			
		
		
		
	Header formatting ✨
This commit is contained in:
		
							
								
								
									
										24
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								README.md
									
									
									
									
									
								
							| @@ -40,12 +40,12 @@ The number at the end is the baud rate (it's a measure of symbol rate and is one | |||||||
| ### Transfering files to the chip | ### Transfering files to the chip | ||||||
| We use ampy again with the following command: ` ` | We use ampy again with the following command: ` ` | ||||||
|  |  | ||||||
| Some important behaviour: | ## Some important behaviour: | ||||||
|  - boot.py is called where we can setup e.g. sensors, pins and wifi. |  - boot.py is called where we can setup e.g. sensors, pins and wifi. | ||||||
|  - main.py is always called after boot is finished, this will most oftenly be the execution start of our program.  |  - main.py is always called after boot is finished, this will most oftenly be the execution start of our program.  | ||||||
| (More details can be found here) | (More details can be found here) | ||||||
|  |  | ||||||
| Tricks:  | ## Tricks:  | ||||||
|  - os.listdir() |  - os.listdir() | ||||||
|  - machine.Timer use for timeouts without normal time package. |  - machine.Timer use for timeouts without normal time package. | ||||||
|  - ntptime to get universal time. Also our offset |  - ntptime to get universal time. Also our offset | ||||||
| @@ -61,14 +61,14 @@ Tricks: | |||||||
|  epochTime = ntpTime + NTP_OFFSET |  epochTime = ntpTime + NTP_OFFSET | ||||||
|  ``` |  ``` | ||||||
|  |  | ||||||
|  |  - - - | ||||||
|  | # Notes | ||||||
| First prototype has a ESP8266[0][1] strapped on a soil moisture sensor [2]. The the small form factor, easily flash-able firware and gpio pins made the ESP8266 a great fit for the task. The main focus is the try transmit the soil moisture of a plant to an elasticsearch endpoint. Kibana is used to visialize the time since laste watered compared to the soil moisture. | First prototype has a ESP8266[0][1] strapped on a soil moisture sensor [2]. The the small form factor, easily flash-able firware and gpio pins made the ESP8266 a great fit for the task. The main focus is the try transmit the soil moisture of a plant to an elasticsearch endpoint. Kibana is used to visialize the time since laste watered compared to the soil moisture. | ||||||
|  |  | ||||||
| Using micropython to interface with the pins and it makes it easy to send json data to our elastic endpoint.  | Using micropython to interface with the pins and it makes it easy to send json data to our elastic endpoint.  | ||||||
| Guide on how to flash your esp8266 with micropython can be found here: .  | Guide on how to flash your esp8266 with micropython can be found here: .  | ||||||
|  |  | ||||||
| Excecution path: | ## Excecution path: | ||||||
|  + boot.py - Start with setting up wifi |  + boot.py - Start with setting up wifi | ||||||
|  + main.py - Import logger. Call watercontent() |  + main.py - Import logger. Call watercontent() | ||||||
|  + watercontent.py |  + watercontent.py | ||||||
| @@ -76,8 +76,8 @@ Excecution path: | |||||||
|    - logMoisture inputs this value and after getting the ntp time is, sets up a json payload and sends it to logger. |    - logMoisture inputs this value and after getting the ntp time is, sets up a json payload and sends it to logger. | ||||||
|  + elasticLog.py - inputs json payload and sends it to elastic endpoint using urequests.   |  + elasticLog.py - inputs json payload and sends it to elastic endpoint using urequests.   | ||||||
|  |  | ||||||
| Measuring the power draw:   | ## Measuring the power draw:   | ||||||
|  Log interval 10 seconds using sleep   | ### Log interval 10 seconds using sleep   | ||||||
| 04.05.19   | 04.05.19   | ||||||
| 19:47 - 0 mAh   | 19:47 - 0 mAh   | ||||||
| 20:09 - 10 mAh   | 20:09 - 10 mAh   | ||||||
| @@ -87,14 +87,14 @@ Measuring the power draw: | |||||||
| 06.05.19   | 06.05.19   | ||||||
| 22:30 - 556mAh   | 22:30 - 556mAh   | ||||||
|     |     | ||||||
|  Log interval 30 seconds using deepsleep[3][4]   | ### Log interval 30 seconds using deepsleep[3][4]   | ||||||
| 22:30 - 0 mAh    | 22:30 - 0 mAh    | ||||||
| 00:01 - 5 mAh   | 00:01 - 5 mAh   | ||||||
| 07:36 - 30 mAh   | 07:36 - 30 mAh   | ||||||
| 16:58 - 65 mAh   | 16:58 - 65 mAh   | ||||||
|   |   | ||||||
|  |  | ||||||
| TODO: | ## TODO: | ||||||
|  - Special characters ÆØÅ seem to not be supported. |  - Special characters ÆØÅ seem to not be supported. | ||||||
|  - Wifi and elastic settings should be in a config |  - Wifi and elastic settings should be in a config | ||||||
|  - [Research] Get a better understanding of how our code executes |  - [Research] Get a better understanding of how our code executes | ||||||
| @@ -102,12 +102,12 @@ TODO: | |||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| Notes: | ## Meta notes: | ||||||
| 	Deepsleep | ### Deepsleep | ||||||
| If the code execution takes 100ms right before entering deepsleep there will be no time to connect and upload any new files to the chip. Remember to either have a your program check if a known digital pin is set to high which can act as a cutoff of main program execution by placing a jumper between power* and the known pin. Another way to allow a way of still interfacing with the board is by using machine.Timer[5][6] to create a callback to main function, all while giving us a window to interface or stop execution, delayed by a set interval e.g. 3 seconds.  | If the code execution takes 100ms right before entering deepsleep there will be no time to connect and upload any new files to the chip. Remember to either have a your program check if a known digital pin is set to high which can act as a cutoff of main program execution by placing a jumper between power* and the known pin. Another way to allow a way of still interfacing with the board is by using machine.Timer[5][6] to create a callback to main function, all while giving us a window to interface or stop execution, delayed by a set interval e.g. 3 seconds.  | ||||||
| * Double check that this should not be to ground pin. | * Double check that this should not be to ground pin. | ||||||
|  |  | ||||||
| 	Wemos D1 ESP8266 Pin for deepsleep | ### Wemos D1 ESP8266 Pin for deepsleep | ||||||
| While most documentation says to connect RESET/RST to pin D8 (physical ping 16), this does not apply to this board. Instead us pin D0 (physical pin 4)! | While most documentation says to connect RESET/RST to pin D8 (physical ping 16), this does not apply to this board. Instead us pin D0 (physical pin 4)! | ||||||
|  |  | ||||||
| [0] WTF is ESP8266   | [0] WTF is ESP8266   | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user