-
Resignation
02/28/2020 at 20:24 • 0 commentsI have now tried different approaches to save power with my setup, but unfortunately nothing really worked.
I have turned every unnecessary module off via the PMIC. With this setting the M5Stick+ENV Hat were five days in operation. After this test I thought that maybe the ENV Hat draws to much current. So I repeated the test without the Hat. This gave me one day more run time.
The deep-sleep mode that I used is actually called light-sleep. In this mode the RAM still has power (see https://lastminuteengineers.com/esp32-sleep-modes-power-consumption/).
So I tried the the real deep-sleep mode. Unfortunately in that case to Micropython scripts starts from the beginning. So I changed the code a little bit. I made it to connect, measure and send the data to the RasPi every hour. But the connecting costs to much battery power and this setup worked only for one and a half days.
Maybe I could save the data in the flash and then connect once a day like planned, but I am to lazy and do not have enough motivation to finish this project.
-
Power Save Mode
02/09/2020 at 13:22 • 0 commentsSince the last log entry I have made a lot of changes and tests:
1.) I have switched to a Raspberry Pi Zero W. I had troubles with the network port of the Banana Pi
2.) I found out that my USB-battery-pack turns off, if there is no current consumption. This means everytime the M5StickC switched to deep-sleep it turned off and the long term test failed. I am now using PowerBooster 1000 Charger from Adafruit with a 2000mAh Lipo.
Still with this change I got only one day of data. My time unit for the long term test is a day. Because the module connects only once in 24h and there is no way to have a console. I looked a little bit deeper in the schematic of the M5StickC and found out that there is a PMIC (AXP192) that supplies all ICs on the module. I have also learned (from here https://github.com/m5stack/M5StickC/blob/master/src/AXP192.cpp) that it is possible to turn all chips off except the RTC.
I have now implemented the turn off command in the condensation_alert.py (see https://github.com/Trifunik/condensation_alert/blob/master/condensation_alert.py) script and started again a new long term test.
From the datasheets I know that the ENV Hat consumes 1.5mA, but this module is just a place holder for the tests. The end version should have only one low power sensor.
-
M5StickC code read for long term test
01/02/2020 at 20:14 • 0 commentsI have now finished the code for the long term test. Now I want to know:
- How long will the M5StickC + ENV sensor run with my battery pack?
- Is the MicroPython code correct for a long term use?
- Is the BananaPi + Node-RED good enough for a long term use?
I have done some changes in the Node-RED flow and added the flow to the GitHub repository.
-
M5StickC - pre-version
12/15/2019 at 21:00 • 0 commentsI have successfully received the current time and the divisor. And also send data to the Node-RED server. The code is pushed to GitHub.
For now I have some troubles with the MicroPython code, but I am not sure where to locate the problem. Sometimes the code gets stuck and the ampy tool shows a timeout.
When this problem is fixed, I will start a long-time test run without deep-sleep (M5StickC plugged to a power supply).
-
Node-RED Server
12/11/2019 at 21:21 • 0 commentsThe installation of Node-RED in Armbian is straight forward. For the dashboard I installed the node-red-dashboard and for CoAP the node-red-contrib-coap node.
I have tested the Node-RED server over the Wifi with the coap-clieant (--> libcoap) installed on my laptop.
The Node-RED flow looks as follows
-
Concept
12/11/2019 at 21:11 • 0 commentsMy concept is to make a simple MicroPython script on the M5StickC. I have no experience with humidity measurement. I do not know how often is enough to measure. That’s why I will have a variable (divisor) in the script which is set by the Node-RED interface. Each measurement should be saved with time stamp. The M5StickC shall not connect to the Wifi for a time check. It should get once a day one time stamp from the Node-RED server and calculate the rest of the time stamps by adding 24h/divisor. Once a day the data should be pushed to the Node-RED server. The server should display the data on a dashboard (in a browser) and should save the data in a csv file on the BPI Berry. My preferred protocol for this kind of tasks is CoAP.
The following figure shows the workflow of the whole system.