#71 Schedule a daily task at exact the same time with the ESP8266. The rest is deepsleep

แชร์
ฝัง

ความคิดเห็น • 198

  • @jims408
    @jims408 7 ปีที่แล้ว +1

    Grüezi Andreas. Another excellent video, thank you! The ESP8266 is a great little dev. board.

  • @deangreenhough3479
    @deangreenhough3479 7 ปีที่แล้ว

    Wow👍 your really pulling it all together now. Well done Andrea's. Thank you

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      You are welcome. I thought, this function could be used in various projects.

    • @deangreenhough3479
      @deangreenhough3479 7 ปีที่แล้ว +2

      +Andreas Spiess I believe this is where you are way ahead of the curve. Your approach in breaking everything down and building it into modules, showing us how these modules can work together, for me has been a blessing from the Gods.
      Your are much like the famous Swiss clocks, always on time and the quality and precision of your work is second to none.
      Your just an incredibly talented man and I thank you for sharing and for actually communicating.
      I wish you a very happy weekend, right I had better get on and see if I can also make this module work too

  • @jct4647
    @jct4647 7 ปีที่แล้ว +4

    Excellent explanation as always.

  • @asiw
    @asiw 7 ปีที่แล้ว

    Wow, that's brilliant. I think your approach of using the case statement is wonderful. I have quite a few sketches with complex if, then clauses but they could be simplified with Case. I must try this approach. Thanks for the tip.

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      You are welcome! I usually do a drawing of the different states as bubbles and the state changes including the conditions for the change with arrows from one state to the other. Even it is not simpler, it is much easier to change. To change nested if-then-else construction often ends with unwanted results...

  • @gaetano222
    @gaetano222 7 ปีที่แล้ว +1

    Excellent work! Much appreciated!

  • @wjn777
    @wjn777 4 ปีที่แล้ว

    Thank you for sharing your work Andreas, bedankt!

  • @distancelab2010
    @distancelab2010 7 ปีที่แล้ว

    Awesome ... Love your videos, and appreciate the work you put in..... Thank You

  • @Emtron_Technologies
    @Emtron_Technologies 7 ปีที่แล้ว +1

    Excellent idea. I just saw your code & library, Very Nice. I subscribed. Love from India.

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว +2

      :-) 30 minutes time difference is especially made for India...

    • @Emtron_Technologies
      @Emtron_Technologies 7 ปีที่แล้ว

      Yeah. You mentioned in the video. I get motivation, every time i watch your video.

  • @xennelul
    @xennelul 7 ปีที่แล้ว +1

    great idea! thanks for explaining the code in such detail!

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      You are welcome! Hope it helps some day...

  • @raybrok4724
    @raybrok4724 7 ปีที่แล้ว

    Thanks again for the educational information and pieces of code.

  • @nThanksForAllTheFish
    @nThanksForAllTheFish 7 ปีที่แล้ว +1

    Genius! Thank you.

  • @sreekumar4
    @sreekumar4 4 ปีที่แล้ว

    Man . You are a genius . This one is really a great help for me !

    • @AndreasSpiess
      @AndreasSpiess  4 ปีที่แล้ว +1

      Glad it helped!

    • @sreekumar4
      @sreekumar4 4 ปีที่แล้ว

      @@AndreasSpiess any suggestion on how to modify this code to make it work for specific time period in day and then go to sleep in the night ...... means no reading in night time.

  • @stephenunderwood7566
    @stephenunderwood7566 5 ปีที่แล้ว

    Has always nice work. You always have a solution for the problem I am facing.

  • @deangreenhough3479
    @deangreenhough3479 6 ปีที่แล้ว +1

    I'm just building a sensor for my water softener to advise me when to top the salt blocks up.
    I've been grappling with minimising power usage and this video along with your others on batteries for the ESP has been wonderful.
    Wonderful work, I aim to replicate this asap.
    Thank you for all your efforts, I feel confident that I can do it and importantly that I will understand why also👍😀

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว +1

      Good idea. I also have one of these devices. So, please advice when yours work. I am interested, too.

    • @sgurprit
      @sgurprit 3 ปีที่แล้ว

      I am trying to build similar project. Did you make your work?

  • @Dhamian
    @Dhamian 7 ปีที่แล้ว

    I think this is exactly what I needed for my battery powered sensor. Have you run any tests on power consumption? Thanks alot Andreas!

  • @biker2k3
    @biker2k3 4 ปีที่แล้ว

    Excelente trabajo!

  • @ambernishad7596
    @ambernishad7596 4 ปีที่แล้ว

    A big thanks from INDIA....It really help me

  • @hatemelborai
    @hatemelborai 5 ปีที่แล้ว

    Thank you very much for help

  • @baggadap
    @baggadap 6 ปีที่แล้ว

    Thank you so much for all the great videos!
    I find this one very usefull. An idea of going a little further: A scheduled task in relation to sunset/sunrise, in a simple yet accurate way. I find must dusk-dawn libraries very complex and inaccurate. Maybe the times can be fetched online?

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว +1

      You could call a service to get the actual sunset times from the internet. Should be possible (e.g. sunrise-sunset.org/api)

  • @vincentiuswahyu8701
    @vincentiuswahyu8701 4 ปีที่แล้ว

    Hello sir, Great Video. Very helpful.
    I just want to ask. Can I use that library to make my esp wake multiple times a day at exact time?
    Thank you

    • @AndreasSpiess
      @AndreasSpiess  4 ปีที่แล้ว

      No. This library is only for once a day.

  • @thermalmuell6417
    @thermalmuell6417 7 ปีที่แล้ว

    Lieber Andreas,ich kann mich den vielen Kommentaren nur anschliessen - vielen Dank für die vielen tollen Tutorials!
    Nun zu meiner Frage: ich möchte deinen Sketch insofern adaptieren, damit _stündlich_ ein Task durchgeführt wird.
    Wenn ich das richtig verstehe, müsste man dafür ESPDailyTaskNTP.h editieren (in Zeilen 42 & 43 "int hours" löschen) und im Sketch (OncePerDayNTP.ino, Zeile 48) die Stundenagabe ("12")?Korrekt?VG aus Wien!

  • @XerotoLabs
    @XerotoLabs 7 ปีที่แล้ว

    Great video and lib. LOL my time is offset by 30 min too .you make this very easy for us .

    • @aerobyrdable
      @aerobyrdable 7 ปีที่แล้ว

      Where are you located?

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      I thought, only India is on this trip ;-)

    • @XerotoLabs
      @XerotoLabs 7 ปีที่แล้ว

      Newfoundland, we are a 30 min offset too . :
      UTC -2:30 NDT Newfoundland Daylight Time for summer

    • @aerobyrdable
      @aerobyrdable 7 ปีที่แล้ว

      Thanks :). I've never heard of that. Seems a bit unwieldy, really.

    • @XerotoLabs
      @XerotoLabs 7 ปีที่แล้ว

      NP , and than the rail ways for the time zones . We stick just far enough into the Atlantic to be the first point of land in NA that gets light in the morning . we are 30min more east than Atlantic time in theory . LOL
      Im not 100% sure but Saint Pierre and Miquelon ( French owned islands just south of us ) are in the same time zone , so add part of France to that too. LOL

  • @oscarilmio7148
    @oscarilmio7148 4 ปีที่แล้ว

    Sempre bello seguire i tuoi tutorial Andreas.
    Hai dato uno sguardo al lavoro che stanno facendo i ragazzi di let's control it ( con la realizzazione chiamata "mega") ?
    Che ne dici di lasciarci un video di recensione?

    • @AndreasSpiess
      @AndreasSpiess  4 ปีที่แล้ว

      There are many home Automation frameworks, but I did not look at them.

  • @sreeprakashneelakantan5051
    @sreeprakashneelakantan5051 7 ปีที่แล้ว

    Thanks for the adaptation for India time 🙏

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      You are welcome!

    • @ThermaRay
      @ThermaRay 6 ปีที่แล้ว

      FYI, it's more than just India that has a non-hour offset:
      North Korea, Newfoundland, India, Iran, Afghanistan, Burma, Sri Lanka, the Marquesas, as well as parts of Australia use half-hour deviations from standard time, and some nations, such as Nepal, and some provinces, such as the Chatham Islands of New Zealand, use quarter-hour deviations.

  • @wjn777
    @wjn777 4 ปีที่แล้ว

    Excellent video, well explained and clear. Thank you for sharing. In your opinion, would it be hard to get this to run on the ESP32?

    • @AndreasSpiess
      @AndreasSpiess  4 ปีที่แล้ว

      I do not know. Maybe you try?

    • @wjn777
      @wjn777 4 ปีที่แล้ว

      @@AndreasSpiess I am planning to try, thanks for the inspiration

    • @johnchaplinsky5587
      @johnchaplinsky5587 3 ปีที่แล้ว

      I have it working on ESP32. just had to go into the library file [SNTPtime.h] in Documents / Arduino / library / SNTPtime-Master and substitute this code .
      REmove:
      #include
      Add in place :
      #ifdef ESP32
      #include
      #elif defined(ESP8266)
      #include
      #endif
      so far has been running for over an hour keeping constant on the seconds.

    • @wjn777
      @wjn777 3 ปีที่แล้ว

      Thanks for sharing, John

    • @eduardoibarraarcos365
      @eduardoibarraarcos365 2 ปีที่แล้ว

      Hi @@johnchaplinsky5587 how are you? John, I have a problem with the compilation: Error compilando para la tarjeta ESP32 Dev Module. I do what you say, but nothing happen. Can you help me, please?

  • @mohammadshaaban1345
    @mohammadshaaban1345 7 ปีที่แล้ว

    Hello, Great Video!
    What do you recommend I do assuming my sampling time is every half a minute, and I would like my data samples to be time stamped and be sent to a server when WiFi is available, and to get stored in the internal RTC memory when WiFi is not available, to be sent later on. Keeping in mind the esp needs to be in deepsleep when not sampling for power issues.

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      You can watch my videos #58 and #60. There you find the needed information

    • @eduardo9626
      @eduardo9626 5 ปีที่แล้ว

      Hello Mohammad Shaaban, did you get what you wanted? I have exactly the same need you said here.

  • @adilmalik7066
    @adilmalik7066 7 ปีที่แล้ว

    excellent video as usual. do you how to use the ESP8266 as an SPI slave using the Arduino IDE?

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      I found this link, but I did not try: github.com/esp8266/Arduino/tree/master/libraries/SPISlave

  • @ahmadhassan4158
    @ahmadhassan4158 3 ปีที่แล้ว

    That was great idea. Is it possible to make a daily task like takeing measurements from a sensor from 8 to 17. Thank you

  • @TheCopperneck
    @TheCopperneck 7 ปีที่แล้ว +1

    My teacher !

  • @johanneswerner1140
    @johanneswerner1140 3 ปีที่แล้ว

    German railway clocks used to work in the same way as the Swiss ones. Confused the heck out of me as a little kid!

    • @AndreasSpiess
      @AndreasSpiess  3 ปีที่แล้ว

      I did not know. But I think it was a simple and very useful concept back then...

  • @adonis1969pt
    @adonis1969pt 5 ปีที่แล้ว

    Great job and great sntp library. It simplified alot my oled wristwatch code. I have only one serious problem, when it gets offline, exacly 1 hour after it starts running it resets, and as it is offline it loses the time. Do you have any tip? Or where should I look for the "bug"?

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      If you use deep sleep you have to connect GPIO 16 with the RST pin.

  • @davidaliaga2933
    @davidaliaga2933 6 ปีที่แล้ว

    Excellent tutorial! thanks for your time. One a question: the NTP server can are any? for example for my country (Chile) is: cl.pool.ntp.org
    - again thanks! -

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว

      Yes, you can use any existing server. The closer, the faster the transmission.

  • @0ScHoRsCh
    @0ScHoRsCh 6 ปีที่แล้ว

    Hallo Herr Spiess! Vielen Dank für Ihre tollen Tutorials!
    Ich habe eine Frage zur SNTP Library. Ist es möglich einen UNIX Timestamp, den ich mir von einem ESP8266 Controller über ESPNOW sende, auf einem zweiten ESP8266 Controller zu setzen? Ich möchte mindestens zwei Controller zeitsynchron (auf Millisekunden genau) haben.
    Vielen Dank im Voraus.

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว

      Via ESPnow kann man sicher den Timestamp übertragen und die Uhr auf dem zweiten Board danach stellen. Ob die beiden dann im ms Bereich synchron laufen wage ich zu bezweifeln (Übertragungszeit)

    • @0ScHoRsCh
      @0ScHoRsCh 6 ปีที่แล้ว

      Das habe ich bereits versucht. Die Übertragung per ESPNOW liegt im µs Bereich - kein Problem. Die interne Clock, bzw millis() zu verändern, ist gescheitert. configTime() setzt die interne Clock nur über den Zeitserver?

  • @AlexLPD
    @AlexLPD 6 ปีที่แล้ว

    Hi Andreas, I love you videos, I have two NodeMCU, I have them "loosing" data printing on Thing Speak, and the other dont respont to Io Adafruit MQTT Command, do you recomend to put them on a fixed IP? or any idea of anything else?? Thanks.

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว +1

      There are speed/updates per second limitations on Thingspeak. So, maybe the problem is not on your side.

  • @celiog
    @celiog 7 ปีที่แล้ว

    I was impressed by your video and I tried to install both libraries(ESPDaily... and SNTPtime-master) via Arduino IDE: Sketch->Include Library->AddZipLibrary, but it said it is not a valid .zip library. The original NTPtimeESP library from video 67 did install OK. My board is a NodeMCU (ESP-12E).

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว +1

      The way you used does not work, because there are two independent "libraries" in the file. Just copy the two directories "ESPdailyTaskNTP-master" and "credentials" into your Arduino library folder and include your WLAN credentials in the "credentials.h" file. Then it should work.

    • @loganrose2791
      @loganrose2791 5 ปีที่แล้ว

      I separated the two but it still says that something is wrong. :(

  • @MichaGounski
    @MichaGounski 6 ปีที่แล้ว

    That drift you mention is higher than in reality because of your code. Thing is that your code does something in X ms and sleep for Y ms. So you don't wake up every Y ms like you would like but every (X+Y) ms.

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว

      I thought the drift should be corrected by calling the NTP time and adjusting the needed seconds.

  • @Chris0612
    @Chris0612 4 ปีที่แล้ว

    Great work, iam doing a project similar to yours at the moment.
    I need to esp.restart() the Chip every Day, is your method suitable to do that?
    To do that seems almost impossible to me.
    Right at the moment, i can read senor values, send them to ThingSpeak and display them 1602. Want to add a min max temperature saving variable what resets during the esp.reset() too.
    TH-cam help :D

    • @AndreasSpiess
      @AndreasSpiess  4 ปีที่แล้ว

      The ESP8266 resets every time it wakes up from deep sleep. But it only can sleep for max one hour and a few minutes. If you need more, you have to create an external trigger.

  • @kamalphoolwani6075
    @kamalphoolwani6075 4 ปีที่แล้ว

    Hello sir great video I have a question if I want to change the time sometime rather than changing the code can we take the input from an app and change it. If yes how can we do

    • @AndreasSpiess
      @AndreasSpiess  4 ปีที่แล้ว +1

      You can program anything if you want. For me I had no need the change the time, only the time zone.

    • @kamalphoolwani6075
      @kamalphoolwani6075 4 ปีที่แล้ว

      @@AndreasSpiess thanks for replying. Ya we can program it but then for doing this I have to set a time also for taking input from user too. Can it happen that we can externally on and off esp from an app or something

  • @martinyoung7512
    @martinyoung7512 7 ปีที่แล้ว

    Thanks for your interesting code. I have a battery powered window sensor and I wanted the ESP8266 to wake up once per day and transmit the battery voltage (I'm OK message). This is easy to do with your code. BUT - I wanted the ESP8266 to wake up randomly if the window was opened. I tried the reset pin/switch but it did not wake the ESP8266 up and transmit. Any ideas would be appreciated.

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      Martin Young You should be able to reset the device manually, but I never tried, what happens if you disconnect GPIO16 from RST and operate it manually. Did you try that?

  • @zachreyhelmberger894
    @zachreyhelmberger894 3 ปีที่แล้ว

    THANK YOU ANDREAS! It is Oct 6, 2020 and I just pulled down the zip library and added it to Ubuntu Arduino IDE using the "Add .Zip Library", edited "credentials.h"and tried to compile the example but it won't compile. It says it cannot find "credentials.h" and it cannot find "SNTPtime.h". I search on github for SNTPtime.h but found nothing.
    Any ideas on what I did wrong?
    I am trying to develop a daily task to run a recirculating water pump for one hour at, say, 9am.

    • @AndreasSpiess
      @AndreasSpiess  3 ปีที่แล้ว +1

      Just delete the line with the credentials.h and define the SSID and password in your sketch

    • @johanneswerner1140
      @johanneswerner1140 3 ปีที่แล้ว

      Some versions of the arduino ide really struggle with header files and the correct parsing of function definitions and the order in which they are parsed (if at all). The newer versions solve this issue. I had code that was correct, and the compiler failed to parse it correctly, telling me the function was undefined. Same code now works.

  • @KrischerBoy
    @KrischerBoy 6 ปีที่แล้ว

    Hello Mr. Spiess, do you have an idea why i can not add the library? Everytime the Error says: "Angegebener Ordner/ZIP-Datei enthält keine gültige Bibliothek"
    which means that the ZIP inludes no valid library

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว

      Just copy the two folders in the .zip file to your library folder and restart Arduino IDE. Then, you should find it.

    • @KrischerBoy
      @KrischerBoy 6 ปีที่แล้ว

      Ah ok thank you. The problem was that the Library Folder was in another Folder in the Zip file. Thank you a lot :)

  • @AndyDillbeck
    @AndyDillbeck 6 ปีที่แล้ว

    Can this be used without putting it to sleep? I'm doing stuff with MQTT so it can't sleep very long, but I want it to do a thing at a specific time

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว +1

      You can use sntp to get your actual time and then loop till the right time arrived without sleeping. Then, you only need the sntp time library. You should be able to reduce the number of calls to the ntp time server by using the internal "time()" command, which is not very precise in the long run, but ok for the short term (below 1 hour for sure). So, you can correct the time every hour by calling ntp.

  • @mlevif
    @mlevif 7 ปีที่แล้ว

    All we need now is a WiFi configurable alarm clock with a dawn simulator!
    Imagine this, an ESP8266 with a single button attached to an interrupt. That button would make the ESP start a web server so your could configure the alarms. After configured, it would go into deep sleep until it was time to wake up!

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      This should be not to complicated project. Just add WiFi Manager (library)

    • @mlevif
      @mlevif 7 ปีที่แล้ว

      I'll look into it, ESP8266 is still pretty new to me, thanks!

  • @sgurprit
    @sgurprit 3 ปีที่แล้ว

    Great video and very helpful code. In my case, the code stops after printing 'X'. Not sure what I am doing wrong. I am novice at Arduino, will have to find a way to debug.

    • @AndreasSpiess
      @AndreasSpiess  3 ปีที่แล้ว

      Unfortunately I cannot do remote debugging :-(

  • @RupinChheda
    @RupinChheda 6 ปีที่แล้ว

    It's unclear what hardware configuration is required to get this to work, is it still GPIO16 and REST which have to be tied together? What is the purpose of the pin defined in the code, which is the last parameter of the function call?

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว

      1. If you want to deep sleep and automatically wake-up, you have to connect GPIO16 to RST
      2. I explain hte pin at 4:10

  • @rodo19724
    @rodo19724 2 ปีที่แล้ว

    Hi ! do you have a 4 relay nodemcu wifi calendar schedule to activate any of the 4 relays, and programmed days and hours ? You know, the code and the index.html, .css and .js code

  • @bipinpanchal5630
    @bipinpanchal5630 6 ปีที่แล้ว

    Dear SIr,
    i am using nodemcu with sd card for data logging where i want to take the date and time in the logging with sensor value
    please guide for the same
    Thanks

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว

      I think you need the example sketch of the SD library and some time. It should not be too complicated.

  • @stephenunderwood7566
    @stephenunderwood7566 5 ปีที่แล้ว

    Andreas after doing some testing and modifying it a bit so I can use it with wifi.manager (activated by a jumper), it may have a slight bug . It appears that wherever the code sleeps for a microsecond it hangs. I changed the three locations that state _sleepTime=1; to _sleepTime=ONE_SECOND; in RESET, COUNT, and CHECK. It does not hang anymore. It kept hanging on RESET and it did not make sense because the code looked good. I figured out what was happening when I set the scheduled time to run less than 2 minutes away (that section of code under CHECK also had a sleep for a microsecond in it). Not sure why it corrected the issue, or whether it was just due to wifi.manager.

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      This is an old project. If you want you can send me a pull request and I will integrate your changes into the code.

  • @norberthartmann5075
    @norberthartmann5075 7 ปีที่แล้ว

    update: da ich ein fan dieser uhr bin habe ich jetzt alles Wemos uhren auf das schweizer "sync-model" umgestellt :-) (y)
    thanks for the idea!
    ps.: dateTime = NTPch.getTime(1.0, 1); macht immer eine ausgabe auf den ser. monitor ... ist das gewünscht ?

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว +1

      Das mit dem Serial kann gut sein. Die library hat nicht den letzten "Schliff" und wenn die Devices irgendwo montiert sind, spielt eine Message am Serial keine Rolle ;-)

  • @jorgmuller641
    @jorgmuller641 7 ปีที่แล้ว

    Hi Andreas, great ideas and cool video. thx for it.
    But sorry, I didn't get it to work.
    1st: with a clean Arduino IDE Installation the file "credentials.h" is missing. So I commented it out an it brings me to the next poblem.
    2nd: the function in c++
    ESPDailyTaskNTP::ESPDailyTaskNTP(int hours,int minutes, double timeZone, char *mySSID, char *myPASSWORD, byte RESET_PIN){}
    needs a parameter timeZone - in the example sketch this parameter is missing in the function call:
    ESPDailyTaskNTP dailyTask(13, 9, my_SSID, my_PASSWORD, RESET_PIN);
    should be: ESPDailyTaskNTP dailyTask(13, 9, 1.0, my_SSID, my_PASSWORD, RESET_PIN);
    now it compiles an loads up to the ESP8266. (my_SSID and my_PASSWORD should be set individually)
    But now I'm searching for the connection to my wifi-router. Can you tell me where this should be in the code?
    Best regards
    Jörg

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      just add #define myPassword "xxx" and #define mySSID "yyy". Xxx and yyy are your credentials. Or replace mySSID and myPASSWORD with your credentials.

  • @bipinpanchal5630
    @bipinpanchal5630 6 ปีที่แล้ว

    Dear Sir,
    i have made date logger the data is comming but i need date and time for data to be record.
    pl help for that.
    Thanks

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว

      To get date and time you can use any NTP library. You find a few of them in the Arduino IDE

  • @hennieventer1398
    @hennieventer1398 5 ปีที่แล้ว

    i can't seem to include the sntp library any help?

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      Now it should work. Download it again.

  • @johnbeard4006
    @johnbeard4006 3 ปีที่แล้ว

    I'm using a esp32 to monitor temperatures and when they go above or below my setpoint it sends me a email. How can I have the esp32 send me a email once a day at a specific time so I know it's still on and working?

    • @AndreasSpiess
      @AndreasSpiess  3 ปีที่แล้ว

      You have to know time and then select a time to send the mail, I assume.

  • @sargamchauhan908
    @sargamchauhan908 6 ปีที่แล้ว

    Sir I to play songs according to the time.Please help me i didn't understand what time unit i put in code.

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว

      I am sure you will find it out yourself. and by asking Google.

  • @kris_maussen
    @kris_maussen 6 ปีที่แล้ว

    is it possible to use it with an ehternet shield instead of WIFI?

  • @manouchehrmail
    @manouchehrmail 5 ปีที่แล้ว

    Hi, what if the application needs to execute only two tasks a day. For example, at 8:00 AM to turn on the light, and from 18:00 to turn off the light. I thought maybe for the second task I can create a new object of the class "ESPDailyTaskNTP dailyTask2" but where to write the code when the second task has to turn off the light. I appreciate your a hint.

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว +1

      Then you have to write your own code. This sketch can only do one per day.

    • @manouchehrmail
      @manouchehrmail 5 ปีที่แล้ว

      I see. I am almost done with my own code. Thanks a lot.

  • @felixcat4346
    @felixcat4346 7 ปีที่แล้ว +1

    These videos on the esp8266 is interesting but I would like it if the arduino business was missing. This module could be programmed using the Esplorer using a the node mcu or the simpler at commands. Esplorer is a cool and more intuitive interface for the esp8266.

    • @aerobyrdable
      @aerobyrdable 7 ปีที่แล้ว +2

      There may be more efficient methods for the experienced gamer, but most of us are simply familiar with this IDE already. Personally, I appreciate that he is staying within it.

    • @felixcat4346
      @felixcat4346 7 ปีที่แล้ว

      Puzzling since this channel seems to be concentrating on esp8266 stuff. I don´t like the arduino ide, it jumps all over the place in use and everything is so proprietary with the word Adafruit for example leading off ever library, makes it hard to use and read..

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว +3

      I like the Arduino IDE because I not only work with the ESP8266 but also with Arduino, Attiny and even sometimes STM32. When I started with ESP8266 I also tried LUA, but then it was horrible to use because it was not stable and I had to learn everything again. So I was quite happy when the Arduino IDE was ready.
      I think, LUA language was developped to be easier than C++. So, you are absolutely right about this. However, my videos are usually not at the "easy end" (at least, this is my aspiration). There are a few other channels which use LUA.
      Concerning AT commands: I like very much the concept that I do not need another MCU to build Wi-Fi enabled devices. This is probably the reason, why I did a lot with ESPs recently. I grew up when such devices were very expensiveand big and I really like this new stuff. If you watch my videos concerning the A6 module, you see, that I have to deal with AT commands from time to time...

    • @aerobyrdable
      @aerobyrdable 7 ปีที่แล้ว

      Andreas Spiess Yeah, they just don't make lipo-powered Wifi microcontrollers running off of NTP servers like they used to in the 60s :P

    • @felixcat4346
      @felixcat4346 7 ปีที่แล้ว

      The arduino IDE for me is not the way to go as it puts added complication to programming the esp. The arduino ide jumps around in use and I know it can be configured differently to make it your own but I think it sucks. Try the Esplorer and see what I mean. I´d be willing to bet that the arduino library's are the same coding that lua uses. If you are interested in coding learn lua and fix the bugs.

  • @katerinapanayi5825
    @katerinapanayi5825 6 ปีที่แล้ว

    How can you make the esp8266 execute a task once every day, Without sending it to sleep the rest of the time? I need it to stay awake to perform other tasks

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว +1

      You can get NTP time once in a while and compare it with the desired time. There are a few libraries around for that, including one on my Github.

  • @Ed19601
    @Ed19601 7 ปีที่แล้ว

    using the SNTPtime library I get nothing but error messages about the analog ports not being declared and the suggestion that the library is not suitable for esp8266 archtecture. Did I perhaps misunderstand something in yr video?

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      Shouldn't happen. Did you use the library from my github?

    • @Ed19601
      @Ed19601 7 ปีที่แล้ว

      yes I did

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      Did you choose the right (ESP) board? Maybe you post the error messages here and we have a look at it.

    • @Ed19601
      @Ed19601 7 ปีที่แล้ว

      yes the general esp board. I will try again and see what i get. Thanks for your reply and thanks for yr great videos

  • @prakash52kar
    @prakash52kar 2 ปีที่แล้ว

    I have real use of this code to switch off my Wifi during nighttime (I believe it is not good to have wifi On for unnecessary radiation in the house) and esp will configure itself in the evening, as esp8266 could not connect to the internet after wifi gets switched off to which it got connected. But I always had difficulty uploading using Arduino IDE, how to do the same using PlatformIO?

    • @AndreasSpiess
      @AndreasSpiess  2 ปีที่แล้ว

      If you have problems with uploading, you will have it also with PIO

    • @prakash52kar
      @prakash52kar 2 ปีที่แล้ว

      @@AndreasSpiess Thanks, However, if I get the proper library and compile in IO I could easily upload on esp. Arduino IDE gives me error after successful compilation while uploading, I could not figure out it.

  • @loganrose1512
    @loganrose1512 5 ปีที่แล้ว

    Does not contain valid library?.... How do I add it to arduino?

  • @matejhlaca5171
    @matejhlaca5171 5 ปีที่แล้ว

    Helo.. I have a problem. I have air conditioner in a place where no internet. I must turn the air conditioner on every Tuesday at 8AM. The air conditioner has wifi module but this cannot help. When power lose al the settings in the AC are lost and you must program the timer again. I already copyed the IR ON command there is no problem to send it from ESP. Now I need the timer that will send the IR command every Tuesday. I like to have battery powered module...soo it must sleep a week to save the battery. What you sugest me? The 8 AM is not fixed it can be 8:10 or 9AM doesn matter. The goal is that when I will come at 4PM that the room will be hot (I dont need precise RTC). Thank you for help.

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      Maybe you use an RTC module to switch the power of the ESP on. You find them on aliexpress

    • @matejhlaca5171
      @matejhlaca5171 5 ปีที่แล้ว

      @@AndreasSpiess What about to use the ESP RTC. The actual time is not inportant...just send the IR abd sleep for a week and repet all over. If there is some minutes drift there is no problem...can the esp deepsleep a week?

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      The ESP8266 can only deepsleep for a little more than 1 hour.

  • @asiw
    @asiw 7 ปีที่แล้ว

    Hi Andreas
    I have tried running your OncePerDayNTP.ino sketch but get the error message "no matching function for call to 'ESPDailyTaskNTP::ESPDailyTaskNTP(int, int, const char*&, const char*&, const uint8_t&)". Any ideas what I might have done wrong. I have commented out the #include bit (not sure how to implement this) and added "const char* my_SSID = "XYZXYZ"; const char* my_PASSWORD = "ABCABC"
    Best wishes
    Arthur

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      Try to delete your old version of the library and install the newest version. I added now a credentials.h file. You can also install it in your library. If not, just copy the two lines into your sketch and delete the #include credentials.h
      Then it should work. Otherwise come back and I help you.

    • @asiw
      @asiw 7 ปีที่แล้ว

      Hi Andreas
      It works now. I have set it to 15:00 so you should get a sparkfun reading. The inclusion of the credentials.h file has shown me how to use this method.
      Many thanks for your help it's very much appreciated.

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      You are welcome! I have no fun if my viewers are not able to use my code. It is much more fun if it works. ;-) I will check at 15:00. Which time zone did you use?

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      I checked, but did not get your entry at sparkfun. So, something did not work. Did you check your serial monitor?

    • @asiw
      @asiw 7 ปีที่แล้ว

      Many thanks for checking. It's connected to a power supply and an OLED (s400740077.websitehome.co.uk/shen/2016-08-15%2017.47.57.jpg) so I do not have any serial monitor feedback. I need to write the code to drive the OLED so I can see what it's doing. I will let you know when I have completed it.

  • @Nick-gb3wx
    @Nick-gb3wx 5 ปีที่แล้ว

    very nice tutorial , only stuck on one part , can you please help me with this been busy for days now : exit status 1
    no matching function for call to 'ESPDailyTaskNTP::ESPDailyTaskNTP(int, int, double, const char [12], const char [13], const uint8_t&)'

    • @AndreasSpiess
      @AndreasSpiess  4 ปีที่แล้ว

      I changed the credentials from #define to char. Now it should work. Please install the newest version of the library again.

    • @Nick-gb3wx
      @Nick-gb3wx 4 ปีที่แล้ว

      @@AndreasSpiess thank you very much gonna do that

    • @TektorPlays
      @TektorPlays 4 ปีที่แล้ว

      @@AndreasSpiess i have the same problem and i've changed credentials from #define to char. But i can't get it to work i'm getting error: expected initializer before string constant
      char mySSID "SSID" and no matter what i change if i add # before char or not or anything that i've tried i'm everytime getting errors
      and this
      In file included from C:\Users\tekto\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/WiFiClientSecure.h:41:0,
      from C:\Users\tekto\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/WiFiServerSecure.h:20,
      from C:\Users\tekto\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/ESP8266WiFi.h:41,
      from C:\Users\tekto\Documents\Arduino\OncePerDayNTP\OncePerDayNTP.ino:4:
      C:\Users\tekto\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:150:28: error: expected declaration before end of line
      #pragma GCC diagnostic push

    • @TektorPlays
      @TektorPlays 4 ปีที่แล้ว

      well sorry mby i'm just stupid whriting code is something new for me and i can't wrap my head around everything yet

  • @loganrose2791
    @loganrose2791 5 ปีที่แล้ว

    I can't add the library. Tried multiple ways. :(

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว +1

      Now you should be able to import it with the Arduino IDE

    • @loganrose2791
      @loganrose2791 5 ปีที่แล้ว

      Keep being awesome, Andreas.

  • @andymorin9163
    @andymorin9163 7 ปีที่แล้ว

    How can I adapt this to run multiple times in a day?

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      This is not easy. You have to calculate the time till the next "alarm" and steer the sleeping accordingly.

    • @andymorin9163
      @andymorin9163 7 ปีที่แล้ว

      Andreas Spiess Oh okay, thanks for the video though! Will definitely help me in figuring this out.

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      :-)

  • @davidaliaga2933
    @davidaliaga2933 6 ปีที่แล้ว

    Please can upload the subtitles, i will tried translate to spanish with your tutorial en video #132. Thanks

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว

      Thank you very much for your offer! You find the English script now on Github. As a test, I uploaded the Spanish translation from Google Translate. Please have a look at it and tell me, if you
      - are able to edit the subtitles
      - and whether it was a help for you.
      I test a program which, at the end, should help us for the translations.
      You find also the Spanish sbv on Github (just for this file as a test)

    • @davidaliaga2933
      @davidaliaga2933 6 ปีที่แล้ว

      OK, tonight hope revise the archive with in spanish uploaded, see that it's okay with some details; i hope it´s helps.

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว

      Would it be possible to do the changes also in TH-cam translation functionality? I am just curious.

    • @davidaliaga2933
      @davidaliaga2933 6 ปีที่แล้ว

      I already tried it, and is like a "Google translator in live", work but is translation "standard" of robot, do you me understand?

    • @AndreasSpiess
      @AndreasSpiess  6 ปีที่แล้ว

      Unfortunately, I did not understand correctly.

  • @loganrose2791
    @loganrose2791 5 ปีที่แล้ว

    My only problem is with the Wifi status... Example, the only reason we really sleep a chip is to save on battery. In this case, if the Wifi happens to be down, or cannot connect for some reason, then the chip will not give up trying to connect.... thus draining the battery. We need a way to give it a # of times trying before it gives up and tries again much later.

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      I think this should be possible by limiting the number of tries or the time it tries to connect to the internet.

  • @norberthartmann5075
    @norberthartmann5075 7 ปีที่แล้ว

    supi, die beiden filme zum thema zeit !!!...
    doch leider mag das beispiel OncePerDay example for ESP8266 hier nicht "arbeiten" .. die erste lib + demo ist ok.

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      Was genau ist das Problem? Vielleicht finden wir eine Lösung und ich kann den Code verbessern.

    • @norberthartmann5075
      @norberthartmann5075 7 ปีที่แล้ว

      habe mal die fehlermeldung von OncePerDayNTP kopiert , alle deine libs sind aktuell eingepflegt und das "sntp beispiel funzt auch .. hier reichen meine kenntnisse nicht zum beurteilen des fehlers..
      danke !
      vg
      ---------------------------"
      Arduino: 1.6.8 (Windows 10), Board: "WeMos D1 R2 & mini, 80 MHz, 921600, 4M (3M SPIFFS)"
      WARNUNG: Kategorie '' in der Bibliothek UIPEthernet ist ungültig und wird auf 'Uncategorized' festgelegt
      libraries\SNTPtime-master\SNTP.cpp.o:(.bss._timeZone+0x0): multiple definition of `_timeZone'
      libraries\ESPDailyTaskNTP-master\ESPDailyTaskNTP.cpp.o:(.bss._timeZone+0x0): first defined here
      c:/users/norbert/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: Warning: size of symbol `_timeZone' changed from 8 in libraries\ESPDailyTaskNTP-master\ESPDailyTaskNTP.cpp.o to 4 in libraries\SNTPtime-master\SNTP.cpp.o
      collect2.exe: error: ld returned 1 exit status
      exit status 1
      Fehler beim Kompilieren für das Board WeMos D1 R2 & mini.
      Dieser Bericht wäre detaillierter, wenn die Option
      "Ausführliche Ausgabe während der Kompilierung"
      in Datei -> Voreinstellungen aktiviert wäre.

    • @AndreasSpiess
      @AndreasSpiess  7 ปีที่แล้ว

      Habe gerade nochmals versucht. Bei mir läuft die heruntergeladene library. Wie ist deine Directory Struktur? Sollte so sein:
      libraries->ESPdailyTask->hier die beiden *.cpp und *.h files plus das Directory examples.
      Das Directory SNTPtimeESP sollte dieselbe Struktur haben.
      Läuft das SNTP Beispiel alleine?

    • @norberthartmann5075
      @norberthartmann5075 7 ปีที่แล้ว

      ja tut es . / die lib ordner stimmen in der genannten struktur auch. die IDE ist 1.6.8 ( auch mehrfach gestartet ... hat ja die ide auch schon mal gern .

    • @norberthartmann5075
      @norberthartmann5075 7 ปีที่แล้ว

      ok, bearbeiten geht nicht ...
      das problem liegt in der kombination der lib´s ... habe gerade nochmal die NTPtime.h neu geholt und installiert und nun funzt auch das demo nicht mehr :-( ...

  • @YusufBAYLAV
    @YusufBAYLAV 7 ปีที่แล้ว

    Thanks Andreas, I really appreciate the information you share with people. :) I sent you another message via youtube's message facility. :) Could you please check your inbox?