#410

  Переглядів 71,782

Andreas Spiess

Andreas Spiess

2 роки тому

We all know that we send our ESP32s to deep sleep to save energy. But do you know the other possibilities to save energy like light sleep and clock reduction? And what about modem sleep or hibernation?
I am a proud Patreon of @GreatScott!, @ElectroBOOM , @Electronoobs , @EEVblog , and others.
Links:
ESP32 Adapter board: s.click.aliexpress.com/e/_A1zQa8
Power Profiler Kit II: www.nordicsemi.com/Products/D...
USB-Serial Adapter 3.3V: s.click.aliexpress.com/e/_ANS7Wg or amzn.to/3lBqSqD
The links above usually are affiliate links that support the channel (no additional cost for you).
Supporting Material and Blog Page: www.sensorsiot.org
Github: www.github.com/sensorsiot
My Patreon Page: / andreasspiess
Discord: / discord
If you want to support the channel, please use the links below to start your shopping. No additional charges for you, but I get a commission of your purchases to buy new stuff for the channel
My Amazon.com shop: www.amazon.com/shop/andreassp...
For Banggood bit.ly/2jAQEf4
For AliExpress: bit.ly/2B0yTLL
For Amazon.de: amzn.to/2r0ZCYI
For Amazon UK: amzn.to/2mxBaJf
For ebay.com: ebay.to/2DuYXBp
profile.php?...
/ spiessa
www.instructables.com/member/...
Please do not try to email me. This communication channel is reserved for my primary job
As an Amazon Associate, I earn from qualifying purchases
#no#midroll#ads

КОМЕНТАРІ: 243
@ytfp
@ytfp 2 роки тому
I think the low power information is among your most useful videos
@AndreasSpiess
@AndreasSpiess 2 роки тому
Thank you for your feedback!
@icarossavvides2641
@icarossavvides2641 2 роки тому
Interesting video as usual. If I can mention a couple of things people need to be aware that I2C was never supposed to be used along significant lengths of wire (FYI it was invented by PHILIPS to reduce the number of traces on car radio PCBs I2C thus "Inter IC Communication") so if you hang a couple of metres of wire between your sensor and ESP, for instance, you may start getting strange results. Secondly, there has been some research showing that if you incorporate a small supercapacitor (these come in conveniently small PCB packages at reasonable prices) in your battery powered project it can extend battery life, this is because batteries will release more stored energy with a constant load compared to a 'spikey' load.
@koeiekop1973
@koeiekop1973 2 роки тому
A cool & cheap solution for long distace I2C communication might be adding a P82B715P I2C Bus Extender.
@ragohy
@ragohy 2 роки тому
My recommendation: LTC4311 I have best results with this chip. Easy to incorporate in PCB Design. ■Improves I2C Bus Rise Time Transition ■Ensures Data Integrity with Multiple Devices on the I2C Bus. ■Wide Supply Voltage Range: 1.6V to 5.5V Regards
@dan-nutu
@dan-nutu 2 роки тому
Your suggestions came just at the right time, I have to connect some I2C sensors at about 1.5 meters from the ESP32 and I was really worried about this. I am unsure if using twisted pair or shielded wire is a good idea because of its increased capacitance compared with regular wire. I'll look both these chips up, thank you very much!
@AndreasSpiess
@AndreasSpiess 2 роки тому
Thank you for the additional info. Twisted pair can help. Also keep in mind that the last sensor on the line has to have a pull-up resistor.
@slavric
@slavric 2 роки тому
I use the trick with super capacitors for more then ten years. Since I use LiSOCl2 battery and GSM module together, they are a must. This way I also drain the battery completely. GSM just works once a day for about 20 seconds and in the mean time the capacitors have enough time to charge. The only problem is determining the remaining capacity of the battery. This system works three days just on capacitors.
@DrGreenGiant
@DrGreenGiant 2 роки тому
It's worth mentioning that it may be better overall to use maximum clock then deep sleep. Maximum clock to get all your processing done as fast as possible, then sleep for the rest of your projects duty cycle. It's not always true, so measuring is recommended.
@AndreasSpiess
@AndreasSpiess 2 роки тому
You are right. I should have mentioned it. If no external dependency exist and you use deep sleep, slow clock rates are no good idea.
@DrGreenGiant
@DrGreenGiant 2 роки тому
@@AndreasSpiess I think the golden rule is to measure it, and you've done a really good job of showing us how to do that in this video
@horrorhotel1999
@horrorhotel1999 2 роки тому
Personally I'd use this mode if I wasn't running on Battery but a very low amperage power supply. It might be very useful for running the esp off of parasitic power etc.
@m.sierra5258
@m.sierra5258 2 роки тому
@@DrGreenGiant I agree though, because technically, the amount of energy consumed per clock cycle might even go down on higher frequencies. (if voltage is fixed)
@carltone
@carltone 2 роки тому
Great, thorough, technical instructional Andreas. I loved the pin twist technique for the TO220 flat leads.
@AndreasSpiess
@AndreasSpiess 2 роки тому
It is indeed astonishing how big this effect is!
@miru2583
@miru2583 2 роки тому
finally! I was rummaging about esp32 power saving options for the past few weeks. esp32 runs very warm with wi-fi + ble active even with modem sleep(which btw esp32 do it for you automatically when connected to an AP). deep sleep is too brutal & complicated for a simple project that need minimal down time. with reduced clock rate + ntp, I finally found an easier way to reduce power consumption for my project! thanks for the video, guy with Swiss accent.
@AndreasSpiess
@AndreasSpiess 2 роки тому
According my measurements, the modems still use energy also in AP mode. But who knows what "modem-sleep" really means ;-)
@aspuzling
@aspuzling 27 днів тому
What is NTP?
@leifclaesson2470
@leifclaesson2470 2 роки тому
Hi Andreas! Thank you for all your excellent videos. I myself used ESP32 lower frequencies just a few days ago. The reason you got gibberish from the serial port is that the clock rate must match the XTAL on your board! Your board crystal is 26 MHz, so if you choose 13 or 26 MHz the serial will work fine also at 115200 bps.
@AndreasSpiess
@AndreasSpiess 2 роки тому
Where would I chose these 13 or 26MHz?
@AubsUK
@AubsUK 2 роки тому
​@@AndreasSpiess I posted a comment which partially answers this, but it's not showing, I guess it is either in the spam list, or didn't post properly (it was quite long).
@leifclaesson2470
@leifclaesson2470 2 роки тому
Hi @@AndreasSpiess, sorry for late response! With ESP32 Arduino Core 1.0.6 or 2.0.1, when selecting "ESP32 Dev Module", in Arduino 2.0 IDE, my CPU Frequency menu fills with the following options: 240MHz (WiFi/BT) 160MHz (WiFi/BT) 80MHz (WiFi/BT) 40MHz (40MHz XTAL) 26MHz (26MHz XTAL) 20MHz (40MHz XTAL) 13MHz (26MHz XTAL) 10MHz (40MHz XTAL) Is the menu different for you? What ESP development board have you selected?
@WistrelChianti
@WistrelChianti 2 роки тому
Thanks so much! A wealth of effort to bring us the results of these experiments and some very handy and concise conclusions. When I get to worrying about power stuff, defo going to consider the clock reduction trick as I don't think my target project has any real need to run at full clock speed.
@AndreasSpiess
@AndreasSpiess 2 роки тому
You're very welcome!
@orionfields
@orionfields 2 роки тому
Very timely video while I wait on shipping of my Nordic Power Profiler. Thanks for another helpful video.
@AndreasSpiess
@AndreasSpiess 2 роки тому
You are welcome. I hope you will get it soon.
@scome98
@scome98 7 місяців тому
Excellent!! Will use these recommendations in an upcoming project where I have a few ESP32 running on batteries.
@AndreasSpiess
@AndreasSpiess 7 місяців тому
Good luck with your project!
@McTroyd
@McTroyd 2 роки тому
Wow. That must have been quite the research project. Thanks for the effort!
@AndreasSpiess
@AndreasSpiess 2 роки тому
Indeed, it took me a while. But know we know what works and what not...
@mahudson3547
@mahudson3547 2 роки тому
Very useful video and nice to see the power profiler in use. There was a paper looking at processor speed and energy consumption of a 328P. It showed that during computation, the energy consumption (not power!) is best at higher clock frequencies (inversely proportional to clock speed) due to reduced ‘on’ time while there was something to do. So beware of lowering clock frequencies! Could be an interesting subject with ESP32 doing communications as the energy cost when it is awake is most significant. Using current measurement alone is the wrong approach. Batteries are specified by their energy capacity.
@diydsolar
@diydsolar 2 роки тому
I think also that is not only how many mA consumes esp32 at different frecuencies. Please Andreas, you need to multiply mA x seconds to estimate power. That way, i think the best option is still 240mhz Isnt it ?
@tommasomorandini1982
@tommasomorandini1982 2 роки тому
I did some quick calculations. At 8:28 is said that "at 240MHz 1 million toggles take 278ms. At 10MHz it takes 7800ms (7.8s)". At 9.42 he mentions that power consumption at 240MHz without WiFi is 69mA". From the same graph we can see that at 10MHz the power consumption seems to be 10-13mA. By doing power x time at 10MHz divided by power x time at 240MHz we should get a rough estimate of how many times more power is consumed. Plugging in the number gives us a ratio between 4 and 5. This means that the same operation at 10MHz consumed 4-5 times more energy than at 240MHz. So it seems that unless one can't put the ESP32 to sleep going with the higher clock rate is the best choice.
@mikehudson3620
@mikehudson3620 2 роки тому
@@tommasomorandini1982 Exactly. The tricky part comes when you are waiting for something else to happen, like serial comms or wifi connections. This is where the power profiler is so useful - it provides average current during a selected time - therefore energy used. But lowering clock speed is a bad place to start.
@Alacritous
@Alacritous 2 роки тому
@@tommasomorandini1982 What are you going to be doing with your project that needs that kind of computational power? Sure, there's the mathematical best case scenario and then there's reality.
@tommasomorandini1982
@tommasomorandini1982 2 роки тому
@@Alacritous @Alacritous I don't think I understand your question, what do you mean when you say "a project that needs that kind of computational power"? As in a project that doesn't allow the ESP to go to sleep? Or that needs 240MHz?
@U8uxa8SP
@U8uxa8SP 2 роки тому
Thanks for another informative video. I always enjoy your lectures.
@AndreasSpiess
@AndreasSpiess 2 роки тому
Glad you like the content!
@koeiekop1973
@koeiekop1973 2 роки тому
Thanks again for this informative video. I will for sure experiment with the 80MHz setting in new projects!
@AndreasSpiess
@AndreasSpiess 2 роки тому
I hope you will be successful!
@o3rMeNs
@o3rMeNs 2 роки тому
Got to love that pointer stick you use! Your channel is great. Many thanks for your knowledge and greetings from the Netherlands! :)
@AndreasSpiess
@AndreasSpiess 2 роки тому
Welcome on the channel!
@o3rMeNs
@o3rMeNs 2 роки тому
@@AndreasSpiess I've been lurking here for some time, but thanks! :)
@PhG1961
@PhG1961 2 роки тому
Indeed usefull ! Something to keep in mind when tinkering with ESP's.
@AndreasSpiess
@AndreasSpiess 2 роки тому
Thank you!
@fadi0802
@fadi0802 2 роки тому
Super Video! Vielen Dank für die interessanten und vielseitigen Themen in allen Videos
@AndreasSpiess
@AndreasSpiess 2 роки тому
Bitte, gern geschehen. Meine Interessen sind halt auch vielfaltig ;-)
@dhruvagole7651
@dhruvagole7651 2 роки тому
Was awaiting this one! Will help Alot in my lora battery powered projects
@AndreasSpiess
@AndreasSpiess 2 роки тому
LoRa projects can profit, I think.
@tonysfun
@tonysfun 2 роки тому
Great video again Andreas! Thank you!
@AndreasSpiess
@AndreasSpiess 2 роки тому
You are welcome!
@danp762
@danp762 2 роки тому
That mosfit breadboard hack was useful. Thanks for sharing.
@AndreasSpiess
@AndreasSpiess 2 роки тому
You are welcome. I like it, too!
@yekutielbenheshel354
@yekutielbenheshel354 2 роки тому
Interesting video. Thanks Andreas.
@ronm6585
@ronm6585 2 роки тому
Thank you Andreas.
@AndreasSpiess
@AndreasSpiess 2 роки тому
You are welcome!
@michaelbyron9688
@michaelbyron9688 2 роки тому
Andreas, great video I appreciate your efforts into a very useful topic. Waiting for your new video on ESPNow. Thank you.
@AndreasSpiess
@AndreasSpiess 2 роки тому
We will see when it will come. I wait for a particular project to be ready
@avejst
@avejst 2 роки тому
Great update Thanks for sharing :-)
@AndreasSpiess
@AndreasSpiess 2 роки тому
You are welcome!
@szabonandi
@szabonandi 2 роки тому
Very good summary, thanks a lot!
@AndreasSpiess
@AndreasSpiess 2 роки тому
You are welcome!
@uwezimmermann5427
@uwezimmermann5427 2 роки тому
The commands to set the serial baud rate should take the clock frequency into account. And if you change the clock speed on-the-fly in your code you should be able to restart serial communication at a correct baud rate afterwards. I am not aware how this is implemented in poorly documented Arduino libraries, but from the hardware/low-level side it should be very simple.
@AndreasSpiess
@AndreasSpiess 2 роки тому
I just tried it and a Serial.begin(115200); at each frequency did not change anything :-(
@uwezimmermann5427
@uwezimmermann5427 2 роки тому
@@AndreasSpiess that's too bad and I would consider this a bug in the Arduino libraries. On AVR chips using e.g. the UART-library by Peter Fleury the adaption works flawlessly. This just adds to my general complaints about the Arduino framework - if you are trying to do anything outside of a quite narrow scope you are likely to run into problems. I assume that also millis() will not be reliable anymore after your clock frequency changes.
@AndreasSpiess
@AndreasSpiess 2 роки тому
millis() worked ok. I was also skeptical and tried it. ;-)
@NathanSweet
@NathanSweet 11 місяців тому
​@@AndreasSpiess Serial is corrupted below 80MHz if Serial.begin is called before setCpuFrequencyMhz. However if begin is called after then serial does work (using 115200).
@AndreasSpiess
@AndreasSpiess 10 місяців тому
@@NathanSweet Thanks for the info!
@craiglarson2346
@craiglarson2346 2 роки тому
Andreas, your video about ESPNOW is also worth mentioning for power conservation. I found this to be the case on the ESP8266's when occasional data loss is acceptable. I can only presume that applies to the ESP32 as well.
@AndreasSpiess
@AndreasSpiess 2 роки тому
Yes. ESPnow is very efficient. I had a talk to one of my viewers with an interesting ESP-Now project. He has to add some stuff before I can show it. Maybe beginning of next year...
@youliantroyanov2941
@youliantroyanov2941 2 роки тому
@@AndreasSpiess can't wait 👍
@koeiekop1973
@koeiekop1973 2 роки тому
@@AndreasSpiess thanks again for this insightful video! can’t wait to see the new ESPNOW video, currently experimenting with it as well, but it seems to loose connection after a long time. Keep up the great work!
@jameszahary
@jameszahary 2 роки тому
Re: modem sleep or "wifi PowerSave" Did you look at this call? esp_wifi_set_ps(WIFI_PS_NONE) Arduino ide seems to default to WIFI_PS_MIN_MODEM, but can be set to WIFI_PS_MAX_MODEM. I set it to WIFI_PS_NONE to keep the esp32 talking to router at max performance. In the esp32 manual: esp32/api-reference/network/esp_wifi
@AndreasSpiess
@AndreasSpiess 2 роки тому
No, I did not look at this command, probably because I wanted to save energy ;-) Which problem would it solve?
@jameszahary
@jameszahary 2 роки тому
@@AndreasSpiess esp_wifi_set_ps(WIFI_PS_MAX_MODEM) shuts off the modem receive function, and only turns it on every "listen interval" - it keeps the wifi functioning, but longer latency, and less current. I think this is what they mean by "modem sleep".
@AndreasSpiess
@AndreasSpiess 2 роки тому
I am not sure. I read that it disable power saving of the modem. Power saving seems to be the default setting.
@cyberbob4111
@cyberbob4111 2 роки тому
vielen Dank, sehr hilfreich!
@AndreasSpiess
@AndreasSpiess 2 роки тому
Gern geschehen!
@otroblogdemarcelo
@otroblogdemarcelo 2 роки тому
Nice! Will test 10Mhz in my ESP32 project, to see if I can get more runtime on my 4 AA Nimh batts! Thanks! Cheers from Argentina!
@AndreasSpiess
@AndreasSpiess 2 роки тому
Good luck!
@CristiIstrate
@CristiIstrate 2 роки тому
Very interesting video as usual!
@AndreasSpiess
@AndreasSpiess 2 роки тому
Thank you!
@yahmk3978
@yahmk3978 2 роки тому
Vielen Dank!
@AndreasSpiess
@AndreasSpiess 2 роки тому
Bitte, gern geschehen!
@israelgiron9089
@israelgiron9089 2 роки тому
Useful Useful Use Thank you!
@AndreasSpiess
@AndreasSpiess 2 роки тому
You're welcome!
@oscarpeters1351
@oscarpeters1351 2 роки тому
Very nice comprehensive video
@AndreasSpiess
@AndreasSpiess 2 роки тому
Thank you!
@venkatyalamati3285
@venkatyalamati3285 10 місяців тому
Excellent video sir
@AndreasSpiess
@AndreasSpiess 9 місяців тому
Thank you!
@bluegizmo1983
@bluegizmo1983 2 роки тому
Most people don't know that almost all ESP32 boards use way more power than they should in deep sleep. Most people think "oh the ESP32 will only use like 10ua in deep sleep!" But that's just not true of most ESP32 boards because of power regulation and extra stuff on the dev boards. Most ESP32 boards actually continue drawing around 2-5ma of power which is thousands of times more than expected. There are a few boards that were designed with low power deep sleep in mind and only just a few microamps, but not many.
@AndreasSpiess
@AndreasSpiess 2 роки тому
I agree and you find quite a few tests on this channel which support your statement.
@franklee663
@franklee663 2 роки тому
I think I read somewhere that wifi routines run on the second core of the ESP32. Thus when you specify Wifi.mode() command, the compiler actually compiles the code into the second core but put it in busy loop, thus not giving any energy savings. That is my hypothesis and maybe you would want to examine that.
@AndreasSpiess
@AndreasSpiess 2 роки тому
AFAIK both cores work with the same clock and also deep-sleep together.
@rickharold7884
@rickharold7884 Рік тому
Juicy! Thx!
@AndreasSpiess
@AndreasSpiess Рік тому
Glad you like it!
@wjn777
@wjn777 2 роки тому
Great video and thanks for sharing. A look at using a bare bones ESP32 with and external RTC would be interesting. I also find that using the ESP32 with LoRa point to point uses less power for battery projects, and for many "simple" projects like weather stations this is a good solution.
@craigs5212
@craigs5212 2 роки тому
I did a similar project, used a low power (low clock rate) CPU to do my sensor and control work. To report the results over WiFi I connected up and ESP8266 which is kept if deep sleep. When my main processor needs to report the status over WiFi it wakes up the ESP32 with a GPIO pin, sends the JSON sensor data to the ESP via SIO line. I use a simple 2 wire Request/Acknowledge hand shake protocol . The low power cpu wakes up the ESP with an Req, the ESP wakes up and connects to WiFi and return an Ack. The sensor cpu then sends the sensor data to the ESP. Once the ESP has delivered the dat it drops the Ack and goes back to sleep. I send data about every 5 minutes. Limit timers assure no lockup if WiFi can't be connected.
@AndreasSpiess
@AndreasSpiess 2 роки тому
There are a few projects with external timers (usually, not RTCs) like the trigboard or the Microwakeupper. They use very low power chips to wake the ESP. For LoRa sensor projects I do not use the ESP32. Usually, I use other processors (as shown in the Mailbox notifier video). They are even more low-power.
@wjn777
@wjn777 2 роки тому
@@AndreasSpiess I only used the ESP32 because I was familiar with it, and it was convenient using deep sleep. Still, using a standard Wemos D32 v1, RFM95 and lithium battery it provides months of battery life
@jomolinare2
@jomolinare2 Рік тому
Fantastic videos
@AndreasSpiess
@AndreasSpiess Рік тому
Thank you!
@miscellaneousHandle
@miscellaneousHandle 2 роки тому
excellent!
@AndreasSpiess
@AndreasSpiess 2 роки тому
Thank you!
@chuxxsss
@chuxxsss 2 роки тому
Evening Andreas, looking forward to this one. Pin 21 mate sounds like me on a good day. I hate them days.
@AndreasSpiess
@AndreasSpiess 2 роки тому
:-)
@chuxxsss
@chuxxsss 2 роки тому
@@AndreasSpiess ;-)
@enzolombardi9631
@enzolombardi9631 2 роки тому
Superb. My only wish was to have a BLE only based analysis as many of my projects don't need wifi. Grazie!
@AndreasSpiess
@AndreasSpiess 2 роки тому
:-)
@SchmurtzAlex
@SchmurtzAlex 2 роки тому
As always very interesting ! How do you find interesting subjects so often ? 😄 Esp8266 is able to clock down too? I know that deep sleep is less good but may be it stay interesting for some scenarios… Also with wpa2 may be at lower clock speed the time to etablish the connection is longer so may be it is finally a lower difference than expected to transmit the same thing.
@AndreasSpiess
@AndreasSpiess 2 роки тому
I do not know if you can clock the ESP8266 at lower speeds. The Arduino IDE only offers 80 and 160MHz. And I did nto test how long it takes to connect to Wi-Fi. This is not simple because it is not a constant time (at least in my case)
@AllanHjberg
@AllanHjberg Рік тому
Hi Andreas I love your videos 😊 Did you have a look at the da16200 SoC?
@AndreasSpiess
@AndreasSpiess Рік тому
No. So far it did not appear on my usual sources...
@NextLevelCode
@NextLevelCode 2 роки тому
Thanks for your big beautiful Swiss brain dumps :)
@AndreasSpiess
@AndreasSpiess 2 роки тому
You are welcome!
@ReneKnuvers74rk
@ReneKnuvers74rk 2 роки тому
Question: at lower clock freq’s wifi will not work. Still you were able to measure its current consumption. Would ESP-NOW still work and would ESP’s with different clock frequencies be able to communicate over ESP-NOW? A use case would be when sensors are throttles down to 10MHz and a grid-powered gateway would be at 240MHz to communicate over wifi with an MQTT server. I guess even an ESP32 would allow for a reasonable battery life at 10MHz. Would these tricks work with ESP8266 too?
@AndreasSpiess
@AndreasSpiess 2 роки тому
1. I assume, ESP-Now also does not work below 80MHz. But I did not try. 2. The ESP8266 has no such menu on the Arduino IDE. So I do not know if you could do it. I hardly use it anymore.
@axelhertwig8258
@axelhertwig8258 2 роки тому
In your video, I see that you use an adapter board with some pre-soldered(?) R/Cs, most likely as minimum circuitry for the reset, boot and Vdd. Do you have a link to this board as well, maybe even with the ESP pre-soldered?
@AndreasSpiess
@AndreasSpiess 2 роки тому
My boards had these components pre-soldered and indeed, they are for the reset and the GPIO0 pins. So far I did not see such boards with soldered modules on it. But this is not too complicated.
@wilfredosandovaldelgado3690
@wilfredosandovaldelgado3690 Рік тому
Hi Andreas, i have try to run the time library by Diageo, and found that in light sleep the counting runs with no problem, so, maybe some one is needing that. Thanks for the vídeo.
@AndreasSpiess
@AndreasSpiess Рік тому
Thanks for the info!
@defenestrated23
@defenestrated23 2 роки тому
If you wanted a low power remote sensor with periodic broadcasts, I wonder if you could use this pattern: have a flag in non-volatile memory, or even a hardware flipflop, which the mcu checks on boot. If unset, go into low power mode, logging data w/o wifi. Then after X measurements or time, set the flag and reboot. Mcu comes up, reads the flag, goes into wifi mode, sends packets, resets the flag, and reboots. Too bad you can't seem to just turn wifi mode off and get the same effect. Maybe there's some errata buried in the docs.
@AndreasSpiess
@AndreasSpiess 2 роки тому
This can easily be done with an ESP32. Just declare a counter variable with the attribute: RTC_DATA_ATTR int counterValue; . It will survive deep-sleep. Then you check its value and only start Wi-Fi every 10th or 100th restart.
@thiagotenoriojordao
@thiagotenoriojordao 7 місяців тому
Andreas, did you found a way to reduce cpu clock on the ESP8266?
@AndreasSpiess
@AndreasSpiess 6 місяців тому
I am not sure if I ever tried. But Google should know if it can be done
@volodyakan5111
@volodyakan5111 2 роки тому
Hi Andreas, is it possible to turn off one of CPU Core in ESP32 and use the second ? Or turn one CPU in deep sleep and use another ?
@DanBowkley
@DanBowkley 2 роки тому
By default if you're using the Arduino IDE everything gets executed on core 0. The RTC core is only used if you explicitly put stuff on it, and core 1 works basically the same way: you have to set subroutines up as tasks to put them on a specific core, and you have to move over to full C++ to do that (well to do it so it actually runs, theoretically the Arduino IDE can do it but it's buggy AF). I generally make tasks to run MQTT and wifi connection management stuff on core 1 and then just leave everything else alone so it defaults to core 0. The task assignment stuff can actually automatically assign tasks to whichever core it thinks would be better, however you have to beware of not-quite-thread-safe libraries that don't like talking to other things running on other cores. MQTT is one of those libraries.
@ebukaezike9308
@ebukaezike9308 2 роки тому
@@DanBowkley how do you turn off the second one since it not used ?
@volodyakan5111
@volodyakan5111 2 роки тому
@@DanBowkley When it's no attached subroutine to the second core, this core is idle. But it's not in deep sleep and continue to use power ?
@AndreasSpiess
@AndreasSpiess 2 роки тому
I made a video on how to use the cores in Arduino IDE (using RTOS). As written, both cores are clocked at the same speed and also go to sleep together (I hope this is the politically correct expression)
@volodyakan5111
@volodyakan5111 2 роки тому
@@AndreasSpiess Thanks for answer. Yes, it's correct. Because they are friends ;)
@pubudumadhushan7305
@pubudumadhushan7305 2 роки тому
Great lecture, can you do some ESP32 ADC noice cancelation(hardware level and software level) tips, tricks and calculations. It's very useful.
@AndreasSpiess
@AndreasSpiess 2 роки тому
I do not understand DSP. So the chances are small :-(
@pubudumadhushan7305
@pubudumadhushan7305 2 роки тому
@@AndreasSpiess i hope you can do it. 💪🏽💪🏽
@matheokoning4456
@matheokoning4456 Рік тому
Been watching your videos again lately. Would it be an idea to recreate some of the videos again since a lot has changed and added in terms of sensors, chips, microcontrollers and equipment?
@AndreasSpiess
@AndreasSpiess Рік тому
I have no such plans. Sometimes it happens if I am again interested like in the TTN V3 update...
@peterholst8875
@peterholst8875 2 роки тому
Two weeks ago i sat with just that I2C problem 🤦🏼‍♀️ It took me almost two hours to figure out 🙄
@AndreasSpiess
@AndreasSpiess 2 роки тому
So we are already 2. Because it is not a usual problem I had quite some time to discover it...
@jamfotografie7724
@jamfotografie7724 2 роки тому
Just to be sure, is due to the used PCB or due to the esp32 model?
@AndreasSpiess
@AndreasSpiess 2 роки тому
The PCB
@zyghom
@zyghom 2 роки тому
super nice Andreas but you did not touch impact of lower frequency on wifi (re)connection time I tried this as well (most of my sensors wake up from DS, measure, send over WiFi and go to sleep for 5-10min accordingly) now, the entire process takes 3-7s depending which sensor is connected but the longest time is always from wake up to "IP assigned". When I tried lower frequency the connection time increased dramatically - 2 seconds from 5 is 40%. So the savings due to lower frequency are diminished by longer connection time. Try and let us know what you found ;-)
@dave00011
@dave00011 2 роки тому
I understand assigning static ip address to the esp32 board reduces time to connect/authenticate to wifi network
@zyghom
@zyghom 2 роки тому
@@dave00011 it does. But if you have 50+ devices in you wifi you still fight for your time slot. I actually have 80+ in my 2.4GHz (considering all sockets, bulbs etc.) - traffic jam ;-)
@dave00011
@dave00011 2 роки тому
@@zyghom add another ap for your iot devices only
@zyghom
@zyghom 2 роки тому
@@dave00011 already done (second router) but that lowered from 80 to 50 ;-) - this however decreased the wifi time-to-connect by around 1.5-2s. Problem is however different now: home assistant needs to be in the same network segment (dispite I wanted to separate "home machines" from IoT) - I am not sure how to tackle this issue (both: IoT in separate segment yet home assistant secure)
@AndreasSpiess
@AndreasSpiess 2 роки тому
Zygfyd: A good point. Thank you for sharing your experience! BTW: I needed a trick in my router to get a "one way" path from the IOT segment to the general segment. But I do no more remember how we did it (a colleague helped me)
@myloveisvyvy
@myloveisvyvy 2 роки тому
Hi Andreas i cant seem to be able to find the video of the ultra low power atmega1284p lora. The module which is sold on Tindie. Can you please link me up? I am a novice and would like to make use of the board and thought that video of yours was an awesome guideline. Thank you
@AndreasSpiess
@AndreasSpiess 2 роки тому
it is #402
@daledroesse8279
@daledroesse8279 2 роки тому
I would like your thoughts on WiFi Halo, WiFi Mesh and WiFi 7 and how this might affect LoRa
@AndreasSpiess
@AndreasSpiess 2 роки тому
Below 1GHz things become complicated because of the different frequency ranges available in different regions and the legal restrictions. I looked at WiFi Halo and I think it is a niche product, maybe even only for the American market (big bandwith). The bandwith of LoRa is very small compared to standard WiFi. This produces range but limits its usage more or less to sensors
@qvisten999
@qvisten999 2 роки тому
Curious to hear if you have ever tried the Toit language for your ESP32s?
@AndreasSpiess
@AndreasSpiess 2 роки тому
No, I did not (so far).
@jackflash6377
@jackflash6377 9 місяців тому
Have you tried I2S with the lower clock rates? Is the CLK freq of I2S derived from the CPU speed?
@AndreasSpiess
@AndreasSpiess 9 місяців тому
I did not try with lower speeds. And I assume the CPU and I2S clock have the same source. Maybe you find the details in the datasheet.
@ambroribo6079
@ambroribo6079 Рік тому
Good day, I have a question about the sampling rate of the esp32: what is the maximum sampling rate for the ESP32 ? How could I achieve it please ?. Thanks in advance for the kind reply. Regards iw2fvo
@AndreasSpiess
@AndreasSpiess Рік тому
There is no maximum ESP32 sampling rate. It depends on the interface technology as well as your coding.
@andrewward4419
@andrewward4419 Рік тому
Andreas.. Thank you.. Can you please expand "you can use Light Sleep if you do not use WiFi"? If I use ESPNOW to send a message only when an event occurs, but not receive anything other than immediate responses and Acts from the receiver, can I power down Wifi and then go into light sleep for a while, then come back up and power on Wifi and send another message? BTW I also am anxious to see your ESPNOW reviews and techniques. Especially interested in power saving in ESPNOW scenarios. (My App is a small hand held Kayak motor speed controller, remote battery monitor that I must keep working for 9-10 hours with reliability for ocean use.. otherwise I get eaten by sharks or can't get back to shore.
@AndreasSpiess
@AndreasSpiess Рік тому
You have to try. I never used light sleep and WiFi.
@paulgray1318
@paulgray1318 2 роки тому
So are you able to toggle wifi on and off just by lowering the CPU clock below the 80MHz frequency?
@AndreasSpiess
@AndreasSpiess 2 роки тому
Somehow. But as we saw, the current consumption does not behave the same way.
@tenminutetokyo2643
@tenminutetokyo2643 2 роки тому
Can you do one one the ESP32-C3 ESP-C3-01M?
@AndreasSpiess
@AndreasSpiess 2 роки тому
Maybe I will cover the -C3 in a future video. I have some ideas...
@alexbristol5199
@alexbristol5199 2 роки тому
Hi Andreas, to work with WiFi and esp_light_sleep_start() I have found removing all WiFi tasks before going to sleep works, so as a very simplified code example: esp_now_deinit(); WiFi.disconnect(true); WiFi.mode(WIFI_OFF); esp_light_sleep_start(); [And then on ESP32 wakeup] WiFi.mode(WIFI_STA); WiFi.begin(wifiSsid, wifiPassword); esp_now_init(); esp_now_add_peer(peer_info);
@AndreasSpiess
@AndreasSpiess 2 роки тому
Thank you for the info!
@afzallent
@afzallent 2 роки тому
Thank you 👏
@AndreasSpiess
@AndreasSpiess 2 роки тому
You are welcome!
@rcpoisond
@rcpoisond 2 роки тому
Any idea where to buy the Nordic PPK2 as a private customer in the EU? I've been trying to get my hands on one but I only found distributors selling exclusively to company's :/
@mahudson3547
@mahudson3547 2 роки тому
I bought privately from Farnell
@AndreasSpiess
@AndreasSpiess 2 роки тому
I also bought from Mouser if I remember right. But they were in backlog because of the chip shortage.
@rcpoisond
@rcpoisond 2 роки тому
Thanks!
@qzorn4440
@qzorn4440 2 роки тому
i would like to use remotexy, esp32, android smartphone BLE. what is the procedure to set the phone up for a basic app to pair to the esp32? thanks a lot...:)
@AndreasSpiess
@AndreasSpiess 2 роки тому
Unfortunately, I do not know this project. Maybe you ask the "inventors" ?
@sirhotpain
@sirhotpain Рік тому
Have you been able to test light sleep + wifi on the ESP32-S2 by now? Would be incredible if it enables us to significantly reduce power usage during delay periods.
@AndreasSpiess
@AndreasSpiess Рік тому
Still on the "To-Do" list :-(
@sirhotpain
@sirhotpain Рік тому
@@AndreasSpiess No worries, just wanted to make sure I didn't miss anything. You have so many great videos that it's difficult to keep up. :)
@jmr
@jmr 2 роки тому
I rate this video "interesting". One day it will also be "useful" when I have the right project.
@AndreasSpiess
@AndreasSpiess 2 роки тому
Exactly! Same here.
@nkronert
@nkronert 2 роки тому
So how about a setup with two ESP32s, where one doesn't use WiFi and therefore can run in light sleep mode (and use both cores for processing without the risk of killing WiFi by hogging core 0). The second one by default is in deep sleep and only wakes up when the other processor needs to send data over WiFi. But what would be the best way to connect the two modules?
@defenestrated23
@defenestrated23 2 роки тому
Uart, SPI or I2C is probably best to get the two to talk.
@craigs5212
@craigs5212 2 роки тому
That is what I do but the second cpu is not an ESP
@nkronert
@nkronert 2 роки тому
Interesting. Would you mind telling us which CPU you are using for the WiFi part and which interface you use to communicate between the two?
@AndreasSpiess
@AndreasSpiess 2 роки тому
I would say that UART is the simplest way and works with all processor types. For I2C your processor needs to support I2C slave mode.
@nkronert
@nkronert 2 роки тому
I was looking into the slave mode stuff but it seemed complicated. Thanks for your suggestion, Andreas. I guess since most iot devices will not share huge amounts of data, the UART interface should suffice.
@satria4195
@satria4195 2 роки тому
Hello, is there a video about temperature Sensor on your channel?
@AndreasSpiess
@AndreasSpiess 2 роки тому
No, I do not think so. Only about a thermal camera sensor.
@satria4195
@satria4195 2 роки тому
@@AndreasSpiess is there gonna be a video about this subject (temperature sensor)?
@AndreasSpiess
@AndreasSpiess 2 роки тому
I have no such plans for the moment. What would it show?
@satria4195
@satria4195 2 роки тому
@@AndreasSpiess maybe like type of Temperature Sensor like Thermistor (NTC, PTC) Thermocouple, RTD, Thermophile, Semiconductor Based. For Microcontroller DIY that use temperature measurement
@AndreasSpiess
@AndreasSpiess 2 роки тому
Ok. Now I understand. Thank you.
@lalithkumar9807
@lalithkumar9807 2 роки тому
what is the least current consumption you got in modem sleep mode of esp32?
@AndreasSpiess
@AndreasSpiess 2 роки тому
That differs from board to board. I made some comparison videos
@lalithkumar9807
@lalithkumar9807 2 роки тому
@@AndreasSpiess ok ill check it out!Thanks
@lalithkumar9807
@lalithkumar9807 2 роки тому
@@AndreasSpiess can we achieve current consumption of around 2mA on esp32s3-mini in modem sleep mode?
@AndreasSpiess
@AndreasSpiess 2 роки тому
@@lalithkumar9807 I never tried
@lalithkumar9807
@lalithkumar9807 2 роки тому
@@AndreasSpiess cool!Thanks...do let me know if u do any such tests!Thanks in advance.
@TMS5100
@TMS5100 2 роки тому
Are these saving modes good enough for the first row?
@AndreasSpiess
@AndreasSpiess 2 роки тому
Of course!
@EdFrench_uk
@EdFrench_uk 2 роки тому
I find I am able to repeatedly sleep wifi providing I do WiFi.disconnect(true) first, then WiFi.mode(WIFI_OFF) afterwards.
@AndreasSpiess
@AndreasSpiess 2 роки тому
Thank you for your feedback. In my case, WiFi was also off after the command. But deep-sleep and lower clock rates did no more properly work after issuing this command :-( I do no more remember if the ESP also changed to the higher current consumption curve.
@EdFrench_uk
@EdFrench_uk 2 роки тому
Great video. I finally got to grips with the ULP, I managed to get a simple program working in platformio with arduino as the framework. It is amazing to be able to do useful, if simple, stuff during deepsleep, but the documentation is so poor I'm not sure I'll rush to do it again!
@AndreasSpiess
@AndreasSpiess 2 роки тому
One of my viewers stared to write a C compiler for the ULP. Unfortunately, teh project is dead and I never was able to get it running. Would be easier, I think.
@EdFrench_uk
@EdFrench_uk 2 роки тому
Yes, but I would be quite content for most purposes with a good assembler that worked with platformio and arduino. I would be tempted to try and write one, but it feels a little pointless as the newer esp32's move to a proper risc core!
@axelhertwig8258
@axelhertwig8258 2 роки тому
I have made good experience with ESP deep sleep stub. It can be programmed in C, use some ROM functions and can be more power efficient than ULP if the wake up rate is low enough, e.g 2ms every 2s.
@EdFrench_uk
@EdFrench_uk 2 роки тому
@@axelhertwig8258 interesting. I always found the minimum wake time was quite long- longer than 2ms- even without wifi etc. I wonder what I was doing wrong?
@axelhertwig8258
@axelhertwig8258 2 роки тому
@@EdFrench_uk Just checked some notes that I made on this. For very simple tasks in the wakeup stub it takes ~8ms with an average of ~25mA (200uAs). Unfortunately the Power Profiler Kit is out of stock, otherwise I would do some more accurate measurements. Wake up stub avoids bringing up the overall system and provides a (very) limited environment (see espressif docu). In comparison waking up into main() takes between 150-250ms.
@catoom10
@catoom10 2 роки тому
You show the description of CPU clock, but the max. is highlighted. But it tells: "... is adjustable from 80MHz to 240MHz"
@badushashaik8429
@badushashaik8429 8 місяців тому
very secret information
@AndreasSpiess
@AndreasSpiess 8 місяців тому
:-)
@Bigman74066
@Bigman74066 2 роки тому
5:40 what happened to C18?
@AndreasSpiess
@AndreasSpiess 2 роки тому
I do mot know. But it seems to be misplaced.
@OmarMekkawy
@OmarMekkawy 2 роки тому
Interesting video as usual, I think that @5:34, the capacitor C18 looks like its misplaced.
@AndreasSpiess
@AndreasSpiess 2 роки тому
Possible. I did not do it ;-)
@horrorhotel1999
@horrorhotel1999 2 роки тому
3:00 PLEASE PLEASE PLEASE add Chapters to this Video and a caption stating No. 3 will surprise you
@AndreasSpiess
@AndreasSpiess 2 роки тому
I decided to not add chapters because my videos are not made for that. I already have plenty of comments where it becomes clear that the commenter did not watch the whole video before commenting...
@MrAssHolev
@MrAssHolev 2 роки тому
In short ... If you change to
@AndreasSpiess
@AndreasSpiess 2 роки тому
I do not know if this is needed for I2C. I did it to stay on the safe side
@MrAssHolev
@MrAssHolev 2 роки тому
Stay on that side with IFD :)
@wiki4001
@wiki4001 Рік тому
Light sleep not in github?
@AndreasSpiess
@AndreasSpiess Рік тому
Yes.
@wiki4001
@wiki4001 Рік тому
@@AndreasSpiess can you share a sample light sleep program for me please
@wilfredosandovaldelgado3690
@wilfredosandovaldelgado3690 2 роки тому
Ok
@andraznovak2139
@andraznovak2139 2 роки тому
Who is deleting my comments?
@defenestrated23
@defenestrated23 2 роки тому
Probably youtube lol
@AndreasSpiess
@AndreasSpiess 2 роки тому
UKposts if they contain links.
@AerialWaviator
@AerialWaviator 2 роки тому
Extremely fascinating and pragmatic content as always. ♥👍👍 This left me wondering the effects of the various energy saving modes as it relates to the cores in the ESP32. You touched on using multiple cores in video #168. It would be insightful to see what impact these various modes have on ability to use cores, and how it impacts energy usage. Maybe there is even a way to hibernate a core, while using the other in different modes? (particularly at lower clock rates)
@AndreasSpiess
@AndreasSpiess 2 роки тому
AFAIK both cores use the same clock as well as start the sleeping mode together. So I would not expect anything.
@AerialWaviator
@AerialWaviator 2 роки тому
@@AndreasSpiess Thanks. :)
@PY1SAN
@PY1SAN 2 роки тому
Very interesting. 73 de PY1SAN
@AndreasSpiess
@AndreasSpiess 2 роки тому
Thank you! 73 de HB9BLA
#363 Which ESP32 pins are safe to use?
11:53
Andreas Spiess
Переглядів 123 тис.
Getting started with ESP32 Deep Sleep
13:36
Programming Electronics Academy
Переглядів 8 тис.
Não pode Comprar Tudo 5
00:29
DUDU e CAROL
Переглядів 63 млн
BRAWLER MUTATIONS WILL BREAK THE GAME! - Brawl Talk
09:34
Brawl Stars
Переглядів 24 млн
Use the very attractive new ATTINY chips for your projects
14:34
Andreas Spiess
Переглядів 188 тис.
Best power saving mode - Much Deeper Deep Sleep ESP8266
10:30
DIY TECH BROS
Переглядів 94 тис.
#328 ESP32 Secrets: Interrupts, and Deep-Sleep under the Hood
18:57
Andreas Spiess
Переглядів 171 тис.
#400 The Best Power Source for ESP32/ ESP8266 Projects
14:30
Andreas Spiess
Переглядів 110 тис.
#149 ESP32 Deep Sleep, RTC Memory, "Secret" LoLin Pins
13:28
Andreas Spiess
Переглядів 145 тис.
Arduino Garden Controller - Automatic Watering and Data Logging
9:13
Practical Engineering
Переглядів 3,1 млн
USB-C Tutorial for Everybody (Connector, Cable, PD, Data Transfer, Devices)
26:08
ESP32 Deep Sleep: Ultra-Low Power Coprocessor
15:27
atomic14
Переглядів 28 тис.
Это БЕСИТ ВСЕХ пользователей iPhone!!! 😡
28:07
Яблочный Маньяк
Переглядів 25 тис.
Phone sees the future ! 📲🫣👽
0:38
BOGDANCHIKI
Переглядів 11 млн
Геймер с самым быстрым интернетом
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Переглядів 388 тис.
ИГРОВОЙ ПК c WILDBERRIES за 40 тысяч рублей
30:17
Ремонтяш
Переглядів 459 тис.