#410

Поделиться
HTML-код
  • Опубликовано: 4 дек 2021
  • We all know we send our ESP32s to deep sleep to save energy. But do you know other energy-saving possibilities like light sleep and clock reduction? And what about modem sleep or hibernation?
    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 are usually affiliate links that support the channel (at no additional cost to 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
  • НаукаНаука

Комментарии • 247

  • @icarossavvides2641
    @icarossavvides2641 2 года назад +52

    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 года назад +11

      A cool & cheap solution for long distace I2C communication might be adding a P82B715P I2C Bus Extender.

    • @ragohy
      @ragohy 2 года назад +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 года назад +1

      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 года назад +5

      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 года назад +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.

  • @ytfp
    @ytfp 2 года назад +8

    I think the low power information is among your most useful videos

  • @DrGreenGiant
    @DrGreenGiant 2 года назад +28

    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 года назад +8

      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 года назад +11

      @@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 года назад +1

      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 года назад +1

      @@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 года назад +5

    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!

  • @WistrelChianti
    @WistrelChianti 2 года назад +1

    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.

  • @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.

  • @ronm6585
    @ronm6585 2 года назад

    Thank you Andreas.

  • @McTroyd
    @McTroyd 2 года назад +1

    Wow. That must have been quite the research project. Thanks for the effort!

    • @AndreasSpiess
      @AndreasSpiess  2 года назад +1

      Indeed, it took me a while. But know we know what works and what not...

  • @yekutielbenheshel354
    @yekutielbenheshel354 2 года назад

    Interesting video. Thanks Andreas.

  • @tonysfun
    @tonysfun 2 года назад

    Great video again Andreas! Thank you!

  • @PhG1961
    @PhG1961 2 года назад

    Indeed usefull ! Something to keep in mind when tinkering with ESP's.

  • @fadi0802
    @fadi0802 2 года назад

    Super Video! Vielen Dank für die interessanten und vielseitigen Themen in allen Videos

    • @AndreasSpiess
      @AndreasSpiess  2 года назад +1

      Bitte, gern geschehen. Meine Interessen sind halt auch vielfaltig ;-)

  • @koeiekop1973
    @koeiekop1973 2 года назад

    Thanks again for this informative video. I will for sure experiment with the 80MHz setting in new projects!

  • @dhruvagole7651
    @dhruvagole7651 2 года назад

    Was awaiting this one! Will help Alot in my lora battery powered projects

  • @scome98
    @scome98 10 месяцев назад

    Excellent!! Will use these recommendations in an upcoming project where I have a few ESP32 running on batteries.

    • @AndreasSpiess
      @AndreasSpiess  10 месяцев назад +1

      Good luck with your project!

  • @jomolinare2
    @jomolinare2 Год назад

    Fantastic videos

  • @U8uxa8SP
    @U8uxa8SP 2 года назад

    Thanks for another informative video. I always enjoy your lectures.

  • @danp762
    @danp762 2 года назад

    That mosfit breadboard hack was useful. Thanks for sharing.

  • @venkatyalamati3285
    @venkatyalamati3285 Год назад

    Excellent video sir

  • @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! :)

  • @oscarpeters1351
    @oscarpeters1351 2 года назад

    Very nice comprehensive video

  • @miru2583
    @miru2583 2 года назад +4

    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 3 месяца назад

      What is NTP?

  • @szabonandi
    @szabonandi 2 года назад

    Very good summary, thanks a lot!

  • @cyberbob4111
    @cyberbob4111 2 года назад

    vielen Dank, sehr hilfreich!

  • @miscellaneousHandle
    @miscellaneousHandle 2 года назад

    excellent!

  • @CristiIstrate
    @CristiIstrate 2 года назад

    Very interesting video as usual!

  • @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

  • @yahmk3978
    @yahmk3978 2 года назад

    Vielen Dank!

  • @jhonyaristizabal9244
    @jhonyaristizabal9244 2 месяца назад

    awesome video!

  • @leifclaesson2470
    @leifclaesson2470 2 года назад +6

    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 года назад +1

      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?

  • @israelgiron9089
    @israelgiron9089 2 года назад

    Useful Useful Use Thank you!

  • @rickharold7884
    @rickharold7884 2 года назад

    Juicy! Thx!

  • @avejst
    @avejst 2 года назад

    Great update
    Thanks for sharing :-)

  • @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!

  • @mahudson3547
    @mahudson3547 2 года назад +9

    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 года назад +5

      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 года назад +1

      @@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?

  • @bluegizmo1983
    @bluegizmo1983 2 года назад +1

    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 года назад +2

      I agree and you find quite a few tests on this channel which support your statement.

  • @chuxxsss
    @chuxxsss 2 года назад

    Evening Andreas, looking forward to this one. Pin 21 mate sounds like me on a good day. I hate them days.

  • @craiglarson2346
    @craiglarson2346 2 года назад +3

    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 года назад +7

      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 года назад +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!

  • @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 года назад +1

      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 года назад +1

      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

  • @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!

  • @uwezimmermann5427
    @uwezimmermann5427 2 года назад +7

    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 года назад +1

      @@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 года назад +1

      millis() worked ok. I was also skeptical and tried it. ;-)

    • @NathanSweet
      @NathanSweet Год назад

      ​@@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  Год назад

      @@NathanSweet Thanks for the info!

  • @franklee663
    @franklee663 2 года назад +3

    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.

  • @afzallent
    @afzallent 2 года назад

    Thank you 👏

  • @jameszahary
    @jameszahary 2 года назад +5

    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 года назад +5

      @@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.

  • @NextLevelCode
    @NextLevelCode 2 года назад +1

    Thanks for your big beautiful Swiss brain dumps :)

  • @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.

  • @SchmurtzAlex
    @SchmurtzAlex 2 года назад +1

    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 года назад +1

      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...

  • @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 года назад +1

      I do not understand DSP. So the chances are small :-(

    • @pubudumadhushan7305
      @pubudumadhushan7305 2 года назад

      @@AndreasSpiess i hope you can do it. 💪🏽💪🏽

  • @jmr
    @jmr 2 года назад

    I rate this video "interesting". One day it will also be "useful" when I have the right project.

  • @defenestrated23
    @defenestrated23 2 года назад +1

    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 года назад +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.

  • @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.

  • @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.

  • @matheokoning4456
    @matheokoning4456 2 года назад

    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  2 года назад

      I have no such plans. Sometimes it happens if I am again interested like in the TTN V3 update...

  • @wilfredosandovaldelgado3690
    @wilfredosandovaldelgado3690 2 года назад

    Ok

  • @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 года назад +1

      Somehow. But as we saw, the current consumption does not behave the same way.

  • @volodyakan5111
    @volodyakan5111 2 года назад +5

    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 года назад +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 года назад +3

      @@AndreasSpiess Thanks for answer. Yes, it's correct. Because they are friends ;)

  • @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

  • @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

  • @peterholst8875
    @peterholst8875 2 года назад +2

    Two weeks ago i sat with just that I2C problem 🤦🏼‍♀️
    It took me almost two hours to figure out 🙄

    • @AndreasSpiess
      @AndreasSpiess  2 года назад +1

      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 года назад +1

      The PCB

  • @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 года назад +1

      Unfortunately, I do not know this project. Maybe you ask the "inventors" ?

  • @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...

  • @EdFrench_uk
    @EdFrench_uk 2 года назад +4

    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 года назад +3

      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 года назад +1

      @@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 года назад +1

      @@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.

  • @qvisten999
    @qvisten999 2 года назад

    Curious to hear if you have ever tried the Toit language for your ESP32s?

  • @thiagotenoriojordao
    @thiagotenoriojordao 9 месяцев назад

    Andreas, did you found a way to reduce cpu clock on the ESP8266?

    • @AndreasSpiess
      @AndreasSpiess  9 месяцев назад

      I am not sure if I ever tried. But Google should know if it can be done

  • @jackflash6377
    @jackflash6377 11 месяцев назад

    Have you tried I2S with the lower clock rates?
    Is the CLK freq of I2S derived from the CPU speed?

    • @AndreasSpiess
      @AndreasSpiess  11 месяцев назад +1

      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.

  • @TMS5100
    @TMS5100 2 года назад

    Are these saving modes good enough for the first row?

  • @EdFrench_uk
    @EdFrench_uk 2 года назад +1

    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 года назад +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.

  • @nixon275
    @nixon275 Месяц назад

    Whats the best mode for ESP Rainmaker (Wi-fi based project), i want to read sensor readings/activate actuators every 5ish minutes.

    • @AndreasSpiess
      @AndreasSpiess  Месяц назад

      I never used this product, so I do not know :-(

  • @zyghom
    @zyghom 2 года назад +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 года назад +1

      @@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)

  • @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.

  • @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  Год назад +1

      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. :)

  • @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!

  • @catoom10
    @catoom10 2 года назад

    You show the description of CPU clock, but the max. is highlighted. But it tells: "... is adjustable from 80MHz to 240MHz"

  • @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.

  • @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 :)

  • @OmarMekkawy
    @OmarMekkawy 2 года назад +1

    Interesting video as usual, I think that @5:34, the capacitor C18 looks like its misplaced.

  • @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.

  • @qsdrfghgujfddyffguff
    @qsdrfghgujfddyffguff 10 месяцев назад

    very secret information

  • @satria4195
    @satria4195 2 года назад

    Hello, is there a video about temperature Sensor on your channel?

    • @AndreasSpiess
      @AndreasSpiess  2 года назад +1

      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 года назад +1

      Ok. Now I understand. Thank you.

  • @Bigman74066
    @Bigman74066 2 года назад

    5:40 what happened to C18?

    • @AndreasSpiess
      @AndreasSpiess  2 года назад

      I do mot know. But it seems to be misplaced.

  • @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.

  • @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...

  • @alexbristol5199
    @alexbristol5199 2 года назад +3

    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);

  • @wiki4001
    @wiki4001 2 года назад

    Light sleep not in github?

    • @AndreasSpiess
      @AndreasSpiess  2 года назад

      Yes.

    • @wiki4001
      @wiki4001 2 года назад

      @@AndreasSpiess can you share a sample light sleep program for me please

  • @andraznovak2139
    @andraznovak2139 2 года назад

    Who is deleting my comments?

  • @AerialWaviator
    @AerialWaviator 2 года назад +1

    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 года назад +1

      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