This setup is something I have been searching out and now that I have found your incredible code will break it down and attempt to learn it so I can modify it. This is a herculean task as I have not learned skills in either C++ or HTML coding. Wish me luck.
I give you fair warning the Google chart bits are 'exceptionally' complicated and any amendment is almost certainly likely to fail.You can modify the HTML colours and fonts, styles, but if you increase the volume of HTML data sent to Google then they complain. Good luck with your learning.
Thank you a lot for all the work you put down into this project, very much appreciated. Have been playing around with a slightly modified version for some time now and your graph limit of about 80 doesn't seem to limit me. Currently my table_size is 500 records and the heap still has 111000 bytes free and there has been no problem uploading to Google charts. The pages loads snappy without any delay. Just wanted to point this out. Thank you again for all your ESP32 videos, have been a good source off information for me.
Anders 4u2 Thanks, have you checked out my latest versions of this I found out what was causes the size issues it was the length of the html/http packet sizes so I now periodically send packets when they grow above a certain size, this now allows unlimited data to be sent to google charts.
Well, I have to say you created what I was looking for and now it is functioning as advertised. The really amazing part is the web browser window shows the dial style temp and humidity all wirelessly. Thank you so much for your support you have been very congenial.
Things to be aware of, the SD card is quite slow so if there is a power cut and on restart it begins to read the stored data so it carries on continuously but when there are a lot of records that process can take a long time and it won’t allow connections until it’s finished I’m thinking about 2-5 mins so you need to be aware of that don’t think it’s crashed it’s just busy. It will return to webserving eventually
Great good to know. It will be located in an enclosure that is part of a solar panel and battery and will not be a hurry up and read setup. But need to extend my wifi to reach the device as it is just outside the range of my 2.4Ghz signal.
You could get an ESP8266 with an external aerial they have a 12cm long diploe a bit like a Wi-Fi antenna and that will extend the range by a factor of two. Antennas are usually an add-on purchase depending on size and gain and need to be vertically polarised so pointing upwards. Often it is also a matter of trying different orientations to maximise signal, the antennas are directional, and similarly with the Router antennas if it has any.
@@G6EJD Another amazing project. (1) Any reasonable way to add an external antenna in place of the built-in esp32 antenna, vs purchase an esp32 with an existing external antenna connector? (2) Any reasonable way to solder additional usable flash memory (not SDI card) to an esp32? Thanks for all your efforts - you have taught me many useful concepts. 73 K6CCA
Not really and I’ve never seen any surface mount sockets for sale. The big problem would be getting a match and the feed point is under the shield, there are ESP32 modules with an external antenna socket. Adding memory would be a bit futile as the maximum addressable space is what’s generally already fitted at 32Mb or 4MBytes. To use the extra memory beyond that you’d need to use the Espressif zIDE and special techniques to access the additional storage, but to be honest 4MB is a huge amount of storage for a micro controller. 73 Dave G6EJD
Hi sir, Great video. I am trying to use a generic ESP8266 and DE18B20 sensor only, my question is how many days temperature data can I record using this project, after how many days the data will be overwritten automatically?
@@G6EJD Thanks for the reply. Isn't the ESP8266 flash memory 4MB? Is it 80kb? Is sd card option enabled in this project code? Can I just connect an sd card and will the program automatically detect it? Or is there an sd card version of this same project you have done?
@@G6EJD Ok sir. Do you have a link to that? And how many readings can I store using ESP32 instead of ESP8266? Also couldn't understand you said ESP8266 storage is 80kB not 4MB?
@@RoyalTech_2024 you are probably getting confused between RAM and programming space, the ESP32 has 512k of RAM, examples here github.com/G6EJD/ESP8266-Autonomous-Graphing-Data-Logger/blob/master/ESP8266_SHT30_WEMOS_SHIELD_SD_Log_Webserver_FINALc.ino
Great work with this David. I needed a temperature logger to test a heater I have. This is perfect. The only thing I needed to do was also format the SPIFFS for an ESP32 as it didn't seem to do automatically for that like it does with an ESP8266. Maybe I missed something but that worked. Then it could write and read from the SPIFFS ok. Also I couldn't figure out how to change the timezone if using an ESP32 but no problem as I can fix that in Excel.
It’s the timezone code setenv("TZ", Timezone, 1); Where timezone is in the form: //const char* Timezone = "MET-1METDST,M3.5.0/01,M10.5.0/02"; // Most of Europe //const char* Timezone = "CET-1CEST,M3.5.0,M10.5.0/3"; // Central Europe //const char* Timezone = "EST-2METDST,M3.5.0/01,M10.5.0/02"; // Most of Europe //const char* Timezone = "EST5EDT,M3.2.0,M11.1.0"; // EST USA //const char* Timezone = "CST6CDT,M3.2.0,M11.1.0"; // CST USA //const char* Timezone = "MST7MDT,M4.1.0,M10.5.0"; // MST USA //const char* Timezone = "NZST-12NZDT,M9.5.0,M4.1.0/3"; // Auckland //const char* Timezone = "EET-2EEST,M3.5.5/0,M10.5.5/0"; // Asia //const char* Timezone = "ACST-9:30ACDT,M10.1.0,M4.1.0/3": // Australia
Have a question. Plan on using this in an enclosure just outside the range of my wireless signal is there a way to set up a wemos to extend the range of my wireless signal?
After getting the sketch to load and connecting to the IP address started viewing the logging graphs and noticed there was no data being shown. This leads to my next question. I have the DHT shield connected and I see you are using the SHT30. Is there a connections difference between these two shields causing my failure to see data being plotted on the graph? The data log file shows all zeros. Also, what would need to be done to store data on the micro card shield?
Decided to try: ESP8266_DHT11_WEMOS_SHIELD_SD_LOG_Webserver_FINALc sketch. The shield called out on the silkscreen, DHT and the pictures I found showing the blue Temperature and humidity shield referred to it as DHT11 so that is the sketch I used but will try the other sketches and see if this fixes the problem. I am a GitHub Novice so don't know the steps to help when problems are found so I will share them here. expected '(' before 'isnan' expected ')' before 'dew_point' After making these corrections the sketch uploaded. Pretty dials and stuff looked good as in not showing zero but the serial port was reporting: Error reading temperature! Error reading humidity! Also, I did not have the micro SD card shield installed and it did report this and will add the card now. Hopefully, the card being absent does not cause the Reading errors I reported above.
DHT11 is the blue one and DHT22 is the White one and yes they both have different pins unless you swap the blue for the white one. It works without the SD shield but won’t save the data.
These are an almost direct replacement: www.aliexpress.com/item/Free-Shipping-1PCS-Digital-temperature-and-humidity-sensor-AM2305/1555843259.html?spm=2114.search0104.3.1.48021cbfVWeAzD&ws_ab_test=searchweb0_0,searchweb201602_4_10152_10151_10065_10344_10068_10130_10324_10342_10547_10325_10343_10340_10548_10341_10696_10192_10190_10084_10083_10618_10307_10301_10303_5711215_10313_10059_10184_10534_100031_10103_10624_10623_10622_5711315_10621_10620_5722415,searchweb201603_25,ppcSwitch_4&algo_expid=7dcb936d-7aa3-4f7f-97cd-15235709b309-0&algo_pvid=7dcb936d-7aa3-4f7f-97cd-15235709b309&transAbTest=ae803_5&priceBeautifyAB=0
Only the lines associated with setting up the sensor and actually read the values, so no more than 4 lines, add the library include in place of the sht31, then define the object replacing the set variant then DHT.begin then dht.readtemperature in place of sht.read...
Another very useful video and its much appreciated! I really like the mini esp32 board you are using and want to get a couple for a project that needs a small footprint. Is the board you are using a TTGO MINI D1 ESP32/ESP-32S from Aliexpress? I could not find a Wemos 32S mini board so figure yours is the TTGO Mini. The 32S is the revision 1.0 board to the best of my understanding?
Found a ESP32 version of the board you were using, the MH-ET LIVE and ordered a couple. Discovered the ESP32S is simply new packaging for the ESP32 revision 1 chip, not an upgrade or bug fix.
There is something I don't understand about Github and it concerning locating sketches. I know the name of the sketch and found it once before but now I will be darned if I can not locate the Fahrenheit sketch you posted. Would you be so kind as to place a link? I tried searching for it by name but was unable locate it.
YEs it is confusing, the trick is to go up one-level and choose 'Repositories' or click on my class-sign G6EJD and then the most recent changes are listed. Here it is: github.com/G6EJD/ESP8266-Autonomous-Graphing-Data-Logger About two down.
Very excellent, will definitely try to reproduce and play with the code, and maybe adapt some features to my own projects, if I can. I built a GPS logger with a SD card module, and I wounder about the reliability of SPIFF vs SD cards, how do you feel about the two methods of logging?
I have had a SPIFFS based logger running for 18-months now and it's worked perfectly. As long as your not continuously writing to the same locations and at a very fast rate (~1,000,000 writes per location) then statistically it should last for a long time. The nature of most data logging is a slow update and write. You can read as many times as you want. You could upload data to Google Maps and get them to save it for you! All you need is lat, lon coordinates.
So, the data is written on the on-board flash storage of the ESP8266? If I update the code and re-upload the code, the existing data file will be deleted, right? And how does it impact on the life-span of the flash storage to keep writing data on it? PS:According to this web page ( www.esp8266.com/viewtopic.php?f=32&t=6109 ) 1 year before the flash fails, if you write data for every second. So, it will be 15 years, if you write data for every 15 seconds, I guess.
No if the file exists it’s not deleted, so survives most actions, if the programme size increases it’s possible for the flash area to be overwritten losing data. Yes flash life is affected but using a sensible logging time of once every 10-mins gives a long life of many years.
It's a very good question. First off, are you sure it's 32MByte and not the standard 32Mbit (32/8=4MByte). The Arduino IDE does not support accessing flash > 4MByte, you'd need to use the esptool from Espressif to access any Flash greater than 4MB. There is very little written or covered on the subject and I suspect using the extra memory is going to be complex at least. Hopefully in time, the IDE will be updated to support larger storage now becoming more prevalent. All the memory is access via an SPI (serial) bus, so it should not be that difficult to extend. Currently you need to change the memory mapping for the ESP8266 to use any storage >4MB, which is essentially tell it there is extra available, but only in the esptool environment can this be done.
hello David, for my understanding it's 32Mbit (4MB)yte. It seems that Arduino 1.85 supports only 4Mbits (1 Mbyte) for SPIFFS. For my understanding you can't use these for Arduino today. Maybe usable for esptool or Atom. But my knowledge about these is horrible. Funny is that these modules are realy cheap. It cost by Aliexpress > 2€. As an result of these you get more memory for less money and modules work without any problem.
In Arduino IDE there is a 1M or 4M option for SPIFFS so you can use all of the Flash storage. I just looked at my data logger (SHT30) that has been running for about 14-months now and it's data store is reported at 4.1MBytes so it has clearly wrapped around, so that's using all the data for sure.
Sir, I am using ESP32 and SHT30 sensor for data logging. Datalog view web page not loading. I got the following error. All other page woks fine. Need you Help 11:47:50.869 -> E (26) SPIFFS: mount failed, -10025 11:47:50.869 -> E (26) SPIFFS: mount failed, -10025 11:47:50.869 -> SPIFFS failed to start...
Luka Knol Hi, I have produced a bme280 version here. github.com/G6EJD/ESP-Sensor-Server-and-Clients the server will display any data received. If need any help let me know
Version with server and client requires two platforms with esp32, one for server and second for sensor. Is it possible to modify project from Tech Note 80 to use with BME280?
After finding the formula to change the output from Celcius to Farheniet I have to ask how complicated it is to carry this out. Have looked at the code but it is a bit overwhelming for me?
I presume your using the SHT30 version. This is how you change all units to Deg-F: 1. On line 117 change Deg-C to Deg-F using tempC x 9 / 5 + 32 temp = sht30.cTemp*10*9/5+32; 2. Search for all instances of Deg-C and replace with Deg-F That's it.
Failed to find the line in question so much so that my eyeballs are sore. I realize you said fo the SHT30 version and assumed the SHT11 was similar but getting the feeling they are not.
The code was written for the SHT-30 so there is no mention of the SHT-11 so I’ll need to produce a version for it but it will take a few hours. Standby.
Everything works fine including charts and dials but no log. Using ESP32 with SHT30 connected on a breadboard - no shield. Are others having this problem?
For the past couple of hours have been enjoying the wifi connection ability via my web browser, in fact, moved the wemos into the garage keeping an eye on the signal strength for a given distance. Then It hit me. How is this device logging into my network if there are no entries in the sketch for my SSID or PASSWORD? And the credentials.h file is not found in the same directory as the ino file?
Once the ESP8266 has been used on a Wi-Fi and because it's using the WiFiManager library then it uses stored credentials on the ESP8266. If you do a ESP.Reset(); then it clears the credentials and that won't work anymore until you go through the Wi-Fi manager connection process or supply them in the file.
If you have plugged the DHT11 in above the ESP8266 you will notice in the readings some heat transfer via both conduction and convection and the only solution is to use say DuPont ca led or get a Wemos D1 mini dual base that solved nearly all heat transfer problems.
ALLO CEDRIC BOLAMBA, at the start of the code is the definition for the dht12 but commented out just remove the comment prefix and add one to the dht22 line
Very interesting and useful knowledge. Thanks a lot for sharing Mr. Goodman, Great work. Is that possible to decrease the variable recording interval to 10miliSeconds?
You could but the processor would spend more time servicing sensor data than serving the web pages and saving the data, it is difficult to calculate the overhead by static code analysis, so you’d need to gradually reduce the sample time to measure the effect on system performance then you’ll get an idea of how fast the sample rate could be, there are few situations that require sampling at that rate, it doesn’t sound sensible to be sampling a real world activity at that rate unless a high speed object or activity
Very interesting and useful knowledge. Great work and thanks a lot for sharing Mr. Goodman. Is that possible to make it on esp8266-12e to share with us? I am looking for a pulse KWH monitoring stuffs too.
Zana Taher, on the basis that it does not need an internet connection then yes. Although at some point you’ll need to use the server to upload data to your PC or request data from the server by your PC both are supported in the code I’ve provided
You should try simulating a client and make sure the data is received, you get confirmation on the serial port that the data was received. Then the log should show up.
thanks for the video, i am sory but i amquite new in this topic. i have esp32 and some sensors and i want to save/store these datas offline, can i save/ store them in a wlan router? and in the end i can see the datas offline in form of charts/ graphs ( with html or javascript to charts the datas). thank you very much
There’s no accessible storage on any wlan router, you can store data on the ESP32 flash or SD card but what you want to do is very complex, other than what I have provided in tn080 and others I’ve done
@@G6EJD Now i am involved in a project to build a ventilator machine for corona patients. The Sensor datas from the machine should be then showed as graphs/ charts. And we also want to see these charts/ datas on the website (when internet works) and also webbrowser (if internet offline) > when the internet works, we can send the datas and then strore/save them in the database/ website.. and with help with html and javascript, the sensor datas can be displayed as charts: when we go to our website address we will see these kind of charts and datas: THe problem i have is: > when offline, then we cannot send and save the datas in the website, so we need something how to save these sensor datas. with help of memory card we can save the sensor datas that collected from ESP32 in this memory card. Now i want to show/ display these data sensors in the webbrowser (e.g. when we open the webbrowser and type 168.192.1.1.1. for example). When i open my webbrowser and type the address, can these sensor datas that stored offline can be shown also as charts? because i cannot show the raw datas from sensor, the datas must be processed / calculated first and displayed as charts. My Skills iin this area also not great, i am a newbie. so thank you very much for your attention
@@G6EJD Data logging webserver, okay, i alr heard that too, some project use datalogging webserver to save their data online. do u have a liink of your video with data logging? it is a bit confusing to me, i didnt quite understand the logic/ the structure how this kind of system works.
To convert to SD card requires very little code change, add the SD library reference and replace spiffs with SD eg spiffs.begin SD.begin. I’m not sure what you mean about SSID password in web page, I need more information
I am trying to log data from analog pins of arduino uno to a sd card with a sampling speed 50kHz..I used the code Analogbinlogger available in the sdfat examples..Also i want to display the stored data on sd card to a webserver in real time..Can u make a video or help me in this topic?
It not really possible with an UNO as you need to take a sample every 20uS and then store it to SD-Card and then get back to take the next reading. Then displaying in real-time from a web server is not possible at that speed, sorry. It's a very ambitious project unless your programming and technical skills are of a very high order.
@@G6EJD no sir,i have already done it,the data logging is perfectly operational..U can just check the example given in sdfat and just change the sampling frequency to 50kHz..At present i am working on sound,therefore the i kept the frequency to 45kHz,but it acts perfectly on 50kHz.
you can plot thousands of points with google charts by initializing an empty dataset then adding your points with charts' JS api, instead of hard-coding the data into the source.
You can yes, but for some reason Google are bulking at the HTML headers, styles, body, footers, etc. It used to work OK with an ESP8266, If I drop all the HTML and just upload the scripts and data it works a little better. No data is hard coded in the programme. All the data for the webserver has to be issued in one page and I suspect I have reached the 16,384 String character limit with datasets more than 72 which of course is formed by lots of text like ['nnn','oo.o','pp.p'] for each point. I think 72 points is more than adequate for a temperature/humidity data logger.
Yes just change the WiFi mode to station ((STA) and set your own IP address if required, there are plenty of examples on how to do this, so just one line to change WiFi.begin(STA)
gahraman keivani, I forgot about google charts, so there is no solution other than using java and the browser to do the drawing, but that’s a lot of work to do to implement.
Sir pls help,After downloading your Data Logging program and successfully loading it onto my ESP32 board,but there was a two problem.One is time & date not update properly and another one Setup value not accepted by the browser.Thanks in advance. 23:18:27.000 -> SPIFFS Started successfully... Connecting to: TP-LINK Use this URL to connect: 192.168.1.105/ 23:18:28.546 -> Webserver started... 23:18:33.047 -> 03723 318 411 08/04/70 17:12:56 23:18:33.235 -> Restored data from SPIFFS 23:18:35.250 -> Logging started at: 08/04/70 17:48:40
Have you checked your DST / env variable, please give more information about the other issue. Does my example code run noting the time would be different?
@@G6EJD void StartTime(){ configTime(0, 0, "pool.ntp.org"); setenv("TZ", "UTC-05:30", 1); UpdateLocalTime(); } Sir problem was not solve,pls help 17:25:16.992 -> SPIFFS Started successfully... 17:25:16.992 -> 17:25:16.992 -> Connecting to: TP-LINK 17:25:17.554 -> ..WiFi connected at: 192.168.0.105 17:25:18.351 -> Thu Apr 09 2020 17:24:54 17:25:18.351 -> WiFi connected.. 17:25:18.351 -> Webserver started... 17:25:18.351 -> Use this URL to connect: 192.168.0.105/ 17:25:18.351 -> Webserver started... 17:25:23.460 -> 4163 325 501 09/04/20 11:27:42 noting date is ok but time is difference
I tried to use datalogging on my esp32 wemos board. after that i have probably bricked my board. this is about one problem i am facing, in case you mighthave encountered same issue - i have been using esp32 with bme680 and logging data into its SPIFFS memory, i left it running overnight and in the morning, the esp32 wemos board is not responding to any programming ide. i get following error - esptool.py v2.1 Connecting........__ Chip is unknown ESP32 (revision (unknown 0xe)) Uploading stub... Running stub... Stub running... Configuring flash size... Warning: Could not auto-detect Flash size (FlashID=0xffffff, SizeID=0xff), defaulting to 4MB Compressed 8192 bytes to 47... A fatal error occurred: Timed out waiting for packet content A fatal error occurred: Timed out waiting for packet content I have raised issue on github here - github.com/espressif/esptool/issues/263 Any suggestions ?
Interesting, mine does not do that, it cycles around. I have had a unit running since Nov'17, it still is, and the FLASH for SPIFFS should be segmented and not write out of bounds, BTW mine is a Rev.1 silicon, but from the release notes I've seen that should make little difference. I wonder if the SPIFFS implementation is untested when the SPIFFS become full, it is possible. Have you tried a ESP.reset() and ESP.clearConfig(); but then if you can't communicate with the device that's odd as I thought that was hardcoded. Thanks for letting us know. BTW I have a an ESP8266 version running and that has twice filled up the SPIFFS and run around again without any issues. I know the libraries are different, so I'm thinking a library issue.
thanks. i dont know the cause yet, but i just somehow managedto remove wroom 32 board from my wemos board and put new board i had. now new one works. why first one got damaged , remains mystery to me.
Today I have been testing the arrangement and forcing it to wrap around and the results are the same as the esp8266 nothing happens. I have not inspected the differences between fs.h and FS.h but I expect the latter for the ESP32 to be almost identical. On one of ESP8266 loggers the file size reports on screen that it is over 6MB but there is only 3MB allocated so there is something wrong with the filing system. I’ll investigate some more.
thanks for letting me know your trial results. may be issue is something else and not SPIFFS related, it could be that some other parameter and my change of sketch both coincided .... before failure. i have now big suspicion that something related to my battery power might have done damage to it. i had used 18650 battery to run it over night.... if you go to my first githup post, i had some communication there, apparently arduino IDE sets some different memory allocation. may be that is the cause of your memory capacity difference.
I don't know how reliable the DHT11 is but this morning after getting the Fahrenheit display working (Thank you G6JD) it suddenly started showing a temperature of 26F and it is actually 41F outside. Anyone had this type failure of DHT11s? To be fair it is mounted in a wooden box and temps inside the box reache 100F.
Well the DHT11 series of sensor whilst they look like they can be mounted outside in contact with the atmosphere, can't in fact there are few if any that can, the problem is with condensing water vapour. Some of the SHT3x series (30, 31 or 35) can be used outside, but only when fitted with a special micron permeable shield see my BME680 video to see what that looks like, or you can buy a DHT11 inside a special sintered / spheroidal bronze permeable housing so that it can come into contact with humidity but only a very fine vapour, when not fitted, water forms on the detection plates and it stops working, sometimes restarts when it's dried up. See here for an example: www.aliexpress.com/item/Soil-temperature-and-humidity-sensor-SHT10-agricultural-greenhouse-sheds-nursery-send-routine-new/32766408137.html?spm=2114.search0104.8.79.518f40f5sstLpr&priceBeautifyAB=0
So to expand on the enclosure in which this sensor is mounted, it is inside a wood box with a cover there are holes drilled at about a 45-degree angle to allow air to flow and to prevent water from entering the enclosure. But moisture can possibly get in and form dew on the parts and this is the possible culprit. If this is the case then it will be time to switch out to a more of an outdoor sensor. Off I go to review the sensor on your link. Thank You.
Why not try the sensor indoors over night or for more time ideally. Yes although the wholes won't let water in, the high humidity levels will condense on the sensor and cause it to react like it has.
Fully agree and at this time I have one sitting on my desktop and the other sitting outside only the one outside has shown temperature errors. I am in full agreement with you I need an outdoor tolerant sensor. Will need to find one for which your code will accommodate the sensor selected. The thought came to mind concerning how these manufacturers are protecting the sensor without blocking its intended purpose. Maybe this could be duplicated with the dht11?
@@G6EJD Thank you for your reply. i already change but the date and time in calcDateTime() fuction still not change. it change only in UpdateLocalTime() and GetTime() fuction.
What time code are you using if in error then this is likely the problem. Try my code in the time zone it should set the clock to right now 09:45 as it will switch the DST on
Have you selected / entered the correct IP address for your router? What is the base address of your router and are you using a similar address, for example if it is 10.0.0.1 then eg use 10.0.0.99
C:\Users\and\Documents\Arduino\esp32-WebServerCodeWithCSS\esp32-WebServerCodeWithCSS.ino:37:25: fatal error: credentials.h: No such file or directory how download this library? - credentials.h
Andrey Kg have you downloaded the credentials file in the github and placed it in the same folder as the sketch as it says in the reader? Modify the details for your wifi
If you have a minute could you help out a rookie: Arduino: 1.8.5 (Windows 8.1), Board: "WeMos D1 R2 & mini, 80 MHz, 115200, 4M (3M SPIFFS)" C:\Shortened path\ESP32_SHT30_SPIFFS_DataLogger_01.ino:37:88: fatal error: WEMOS_SHT3X.h: No such file or directory #include // github.com/closedcube/ClosedCube_SHT31D_Arduino ^ compilation terminated. exit status 1 Error compiling for board WeMos D1 R2 & mini. This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
Ok try google closedcube github and you’ll find the library there download the zip and uncompress then place the folder in your ide libraries folder then it should compile ok
Great that worked like a charm. Now I get this error to which I applied what you just taught me but it did not work for this error. Can you explain why? Arduino: 1.8.5 (Windows 8.1), Board: "WeMos D1 R2 & mini, 80 MHz, 115200, 4M (3M SPIFFS)" C:\Users\myhomedir\Desktop\IOT_STuff\WEmos\ESP32_Data_Logging_Webserver-master\ESP32_SHT30_SPIFFS_DataLogger_01\ESP32_SHT30_SPIFFS_DataLogger_01.ino:39:25: fatal error: credentials.h: No such file or directory #include "credentials.h" ^ compilation terminated. exit status 1 Error compiling for board WeMos D1 R2 & mini. This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
If you look in Github there are two files that need to be in the same folder the .ini and credentials.h and when you start the IDE you can select the credentials tab and update your SSID/password.
Sorry, I give up after getting past the last error I ran into another. Arduino: 1.8.5 (Windows 8.1), Board: "WeMos D1 R2 & mini, 80 MHz, 115200, 4M (3M SPIFFS)" C:\Users udy\Documents\Arduino\libraries\Wire\utility\twi.c:25:20: fatal error: avr/io.h: No such file or directory #include ^ compilation terminated. exit status 1 Error compiling for board WeMos D1 R2 & mini. This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
Fifury161, well I’m used to delivery at a pace that enables learning and knowledge transfer to take place, clearly not fast enough for some, but then that will always be the case, for some too fast, for others too slow!
After downloading your Data Logging program and successfully loading it onto my Wemos mini D1 I pushed the chair in and took a break. This morning decided to run the program and see how it was functioning. Ran into some oddities so thought rather then typing it out would make a video. th-cam.com/video/ShKC3wdB174/w-d-xo.html
It says the video is unavailable- typical problems are your router not allowing the ESP to stay connected that’s a roger setting problem under the heading of leases often a router will not allow a continuous connection and renew the lease and IP address after a set period of time so you my not find it where you last used it.
Sorry tried to make it private so only you could see it and appears that is not what "private" means. Here is the public link. th-cam.com/video/sbCKm6C_Kk8/w-d-xo.html
Ok thanks I can see what the problem is there are two your browser can’t find the address after the inputs it shows 0.0.0.0 it works ok on ie11 I think your not using that so I’ll fix that for you and I can see the range for the dials needs to be converted to deg-f as a moderate temperature is being shown in red so that needs the conversion doing - watch out it may take a few hours or hopefully less.
There is no hurry currently using your program on my outside station and once this is functional, plan on moving it to that location. Going to be great to see the temp in Fahrenheit. Find it odd as much help as you are free with that you don't have a donate button? You are one of the most responsive person I have run into online.
OK I have changed the input method and tested it on IE11, EDGE, Chrome and Firefox all working OK. This is the new version on Github: ESP8266_DHT11_WEMOS_SHIELD_SD_Log_Webserver_Deg-F_v02.ino Any problems let me know. I also fixed the dial range from 5-125 deg-F you can change those I think it's fairly self-evident on line 337: webpage += "var gaugetempOptions={min:5,max:125,yellowFrom:5,yellowTo:32,greenFrom:32,greenTo:90,redFrom:90,redTo:125,minorTicks:10,majorTicks:['5','22','39','56','73','90','107','124']};";so you could go: webpage += "var gaugetempOptions={min:0,max:130,yellowFrom:0,yellowTo:32,greenFrom:32,greenTo:90,redFrom:90,redTo:130,minorTicks:10,majorTicks:['0','16','32','48','64','80','96','112']};";
OK, finally go the sketch to load and typed in 192.168.1.30:8266 This site can’t be reached 192.168.1.30 took too long to respond. Search Google for 192 168 8266 UPDATE: Connecting to: your ssid ...................... Failed to connect to a Wi-Fi network Where do you place the SSID and USER NAME? BTW when I remembered to check the serial port monitor I go this: 15 New Record Added 16 New Record Added 17 New Record Added 18 New Record Added 19 New Record Added 20 New Record Added
SSID and Password are in the crednetials file on the tab in your IDE near the menu. You connect to a server with (i don't know what IP your getting but from your example) 192.168.0.30/ don't add 8266 becuase that changes the address. Use the address it prints out in the serial port diagostics. It's adding records so it's running. You've got the address wrong.
Thank you for being so helpful the sketch is now running and I learned you can store password and ssid in a separate file. My C++ coding is non-existent and just started learning Python3 but can't seem to find IOTs running as commonly as C++. Well out of the box python3.
This is one of the best videos on using the ESP32 I have seen. Very clear and easy to follow.
This setup is something I have been searching out and now that I have found your incredible code will break it down and attempt to learn it so I can modify it. This is a herculean task as I have not learned skills in either C++ or HTML coding. Wish me luck.
I give you fair warning the Google chart bits are 'exceptionally' complicated and any amendment is almost certainly likely to fail.You can modify the HTML colours and fonts, styles, but if you increase the volume of HTML data sent to Google then they complain. Good luck with your learning.
Thank you a lot for all the work you put down into this project, very much appreciated. Have been playing around with a slightly modified version for some time now and your graph limit of about 80 doesn't seem to limit me. Currently my table_size is 500 records and the heap still has 111000 bytes free and there has been no problem uploading to Google charts. The pages loads snappy without any delay. Just wanted to point this out. Thank you again for all your ESP32 videos, have been a good source off information for me.
Anders 4u2 Thanks, have you checked out my latest versions of this I found out what was causes the size issues it was the length of the html/http packet sizes so I now periodically send packets when they grow above a certain size, this now allows unlimited data to be sent to google charts.
SC
Well, I have to say you created what I was looking for and now it is functioning as advertised. The really amazing part is the web browser window shows the dial style temp and humidity all wirelessly. Thank you so much for your support you have been very congenial.
Things to be aware of, the SD card is quite slow so if there is a power cut and on restart it begins to read the stored data so it carries on continuously but when there are a lot of records that process can take a long time and it won’t allow connections until it’s finished I’m thinking about 2-5 mins so you need to be aware of that don’t think it’s crashed it’s just busy. It will return to webserving eventually
Great good to know. It will be located in an enclosure that is part of a solar panel and battery and will not be a hurry up and read setup. But need to extend my wifi to reach the device as it is just outside the range of my 2.4Ghz signal.
You could get an ESP8266 with an external aerial they have a 12cm long diploe a bit like a Wi-Fi antenna and that will extend the range by a factor of two. Antennas are usually an add-on purchase depending on size and gain and need to be vertically polarised so pointing upwards. Often it is also a matter of trying different orientations to maximise signal, the antennas are directional, and similarly with the Router antennas if it has any.
@@G6EJD Another amazing project.
(1) Any reasonable way to add an external antenna in place of the built-in esp32 antenna, vs purchase an esp32 with an existing external antenna connector?
(2) Any reasonable way to solder additional usable flash memory (not SDI card) to an esp32? Thanks for all your efforts - you have taught me many useful concepts. 73 K6CCA
Not really and I’ve never seen any surface mount sockets for sale. The big problem would be getting a match and the feed point is under the shield, there are ESP32 modules with an external antenna socket.
Adding memory would be a bit futile as the maximum addressable space is what’s generally already fitted at 32Mb or 4MBytes. To use the extra memory beyond that you’d need to use the Espressif zIDE and special techniques to access the additional storage, but to be honest 4MB is a huge amount of storage for a micro controller. 73 Dave G6EJD
hello David, great job. I love your videos. These is good stuff for beginners like me. Hope you will continue.
Thank you for such useful explanations. Time is valuable and I appreciate your sharing your expertise.
Another terrific project ... Thank You ... Your Time and Effort is Very Much Appreciated !!
Thank you I appreciate that as a lot of time and effort goes into the code and videos.
Hi sir,
Great video.
I am trying to use a generic ESP8266 and DE18B20 sensor only, my question is how many days temperature data can I record using this project, after how many days the data will be overwritten automatically?
Each reading requires 4-bytes so an 8266 has 80kB of flash so 80000/4= 20000 readings, if using sd-card storage then indefinitely
@@G6EJD Thanks for the reply. Isn't the ESP8266 flash memory 4MB? Is it 80kb?
Is sd card option enabled in this project code? Can I just connect an sd card and will the program automatically detect it? Or is there an sd card version of this same project you have done?
@@RoyalTech_2024 I have produced an sd-card version too
@@G6EJD Ok sir.
Do you have a link to that?
And how many readings can I store using ESP32 instead of ESP8266?
Also couldn't understand you said ESP8266 storage is 80kB not 4MB?
@@RoyalTech_2024 you are probably getting confused between RAM and programming space, the ESP32 has 512k of RAM, examples here github.com/G6EJD/ESP8266-Autonomous-Graphing-Data-Logger/blob/master/ESP8266_SHT30_WEMOS_SHIELD_SD_Log_Webserver_FINALc.ino
Great work with this David. I needed a temperature logger to test a heater I have. This is perfect. The only thing I needed to do was also format the SPIFFS for an ESP32 as it didn't seem to do automatically for that like it does with an ESP8266. Maybe I missed something but that worked. Then it could write and read from the SPIFFS ok. Also I couldn't figure out how to change the timezone if using an ESP32 but no problem as I can fix that in Excel.
I usually include a link in the source code to the timezone database to find the correct code to use, good luck with your project
@@G6EJD thank you for your reply. I will try to understand how this works by looking at the time library and what line I need to add to set this code.
It’s the timezone code
setenv("TZ", Timezone, 1);
Where timezone is in the form:
//const char* Timezone = "MET-1METDST,M3.5.0/01,M10.5.0/02"; // Most of Europe
//const char* Timezone = "CET-1CEST,M3.5.0,M10.5.0/3"; // Central Europe
//const char* Timezone = "EST-2METDST,M3.5.0/01,M10.5.0/02"; // Most of Europe
//const char* Timezone = "EST5EDT,M3.2.0,M11.1.0"; // EST USA
//const char* Timezone = "CST6CDT,M3.2.0,M11.1.0"; // CST USA
//const char* Timezone = "MST7MDT,M4.1.0,M10.5.0"; // MST USA
//const char* Timezone = "NZST-12NZDT,M9.5.0,M4.1.0/3"; // Auckland
//const char* Timezone = "EET-2EEST,M3.5.5/0,M10.5.5/0"; // Asia
//const char* Timezone = "ACST-9:30ACDT,M10.1.0,M4.1.0/3": // Australia
Fabulous work sir. Thank you.
Hi great project, This was I'm looking for my project but I want to use a DHT-22 sensor how do I do that ??
I added a DHT22 version, but it is a very old sensor and extremely inaccurate. See Github link in video description.
@@G6EJD Thanks mate for your reply :)
i love this channel
Hi David, is a great video, ask which pin to connect the DTH11 DATA cable to my ESP8266?
Great video. I am making a power logger for a solar cell set up. I will adapt this.
Have a question. Plan on using this in an enclosure just outside the range of my wireless signal is there a way to set up a wemos to extend the range of my wireless signal?
There is but I haven’t written my own in some respects unless there is no domestic power a cheap WiFi repeater is better.
After getting the sketch to load and connecting to the IP address started viewing the logging graphs and noticed there was no data being shown. This leads to my next question. I have the DHT shield connected and I see you are using the SHT30. Is there a connections difference between these two shields causing my failure to see data being plotted on the graph?
The data log file shows all zeros.
Also, what would need to be done to store data on the micro card shield?
OK, Then you need one of these! github.com/G6EJD/ESP8266-Autonomous-Graphing-Data-Logger
Decided to try: ESP8266_DHT11_WEMOS_SHIELD_SD_LOG_Webserver_FINALc sketch.
The shield called out on the silkscreen, DHT and the pictures I found showing the blue Temperature and humidity shield referred to it as DHT11 so that is the sketch I used but will try the other sketches and see if this fixes the problem.
I am a GitHub Novice so don't know the steps to help when problems are found so I will share them here.
expected '(' before 'isnan'
expected ')' before 'dew_point'
After making these corrections the sketch uploaded.
Pretty dials and stuff looked good as in not showing zero but the serial port was reporting:
Error reading temperature!
Error reading humidity!
Also, I did not have the micro SD card shield installed and it did report this and will add the card now. Hopefully, the card being absent does not cause the Reading errors I reported above.
DHT11 is the blue one and DHT22 is the White one and yes they both have different pins unless you swap the blue for the white one. It works without the SD shield but won’t save the data.
Found many SHT11 sensors on Ali Express and they are a bit more expensive if I pick one up will it plug and play with the existing code/hardware?
These are an almost direct replacement: www.aliexpress.com/item/Free-Shipping-1PCS-Digital-temperature-and-humidity-sensor-AM2305/1555843259.html?spm=2114.search0104.3.1.48021cbfVWeAzD&ws_ab_test=searchweb0_0,searchweb201602_4_10152_10151_10065_10344_10068_10130_10324_10342_10547_10325_10343_10340_10548_10341_10696_10192_10190_10084_10083_10618_10307_10301_10303_5711215_10313_10059_10184_10534_100031_10103_10624_10623_10622_5711315_10621_10620_5722415,searchweb201603_25,ppcSwitch_4&algo_expid=7dcb936d-7aa3-4f7f-97cd-15235709b309-0&algo_pvid=7dcb936d-7aa3-4f7f-97cd-15235709b309&transAbTest=ae803_5&priceBeautifyAB=0
Thank you ordered one should be here in the next month will let you know how it works out.
Hi David, What it is needed to be changed if I want to use DHT11 or DHT22?
Only the lines associated with setting up the sensor and actually read the values, so no more than 4 lines, add the library include in place of the sht31, then define the object replacing the set variant then DHT.begin then dht.readtemperature in place of sht.read...
@@G6EJD Great! Thank you!
Another very useful video and its much appreciated! I really like the mini esp32 board you are using and want to get a couple for a project that needs a small footprint.
Is the board you are using a TTGO MINI D1 ESP32/ESP-32S from Aliexpress? I could not find a Wemos 32S mini board so figure yours is the TTGO Mini. The 32S is the revision 1.0 board to the best of my understanding?
Found a ESP32 version of the board you were using, the MH-ET LIVE and ordered a couple. Discovered the ESP32S is simply new packaging for the ESP32 revision 1 chip, not an upgrade or bug fix.
The boards go under the name of MH-ET-Live ESP32 but the TTGO variants are the same. Most are now Rev.1 silicon.
There is something I don't understand about Github and it concerning locating sketches. I know the name of the sketch and found it once before but now I will be darned if I can not locate the Fahrenheit sketch you posted. Would you be so kind as to place a link? I tried searching for it by name but was unable locate it.
YEs it is confusing, the trick is to go up one-level and choose 'Repositories' or click on my class-sign G6EJD and then the most recent changes are listed. Here it is: github.com/G6EJD/ESP8266-Autonomous-Graphing-Data-Logger
About two down.
Very excellent, will definitely try to reproduce and play with the code, and maybe adapt some features to my own projects, if I can. I built a GPS logger with a SD card module, and I wounder about the reliability of SPIFF vs SD cards, how do you feel about the two methods of logging?
I have had a SPIFFS based logger running for 18-months now and it's worked perfectly. As long as your not continuously writing to the same locations and at a very fast rate (~1,000,000 writes per location) then statistically it should last for a long time. The nature of most data logging is a slow update and write. You can read as many times as you want. You could upload data to Google Maps and get them to save it for you! All you need is lat, lon coordinates.
So, the data is written on the on-board flash storage of the ESP8266? If I update the code and re-upload the code, the existing data file will be deleted, right? And how does it impact on the life-span of the flash storage to keep writing data on it?
PS:According to this web page ( www.esp8266.com/viewtopic.php?f=32&t=6109 ) 1 year before the flash fails, if you write data for every second. So, it will be 15 years, if you write data for every 15 seconds, I guess.
No if the file exists it’s not deleted, so survives most actions, if the programme size increases it’s possible for the flash area to be overwritten losing data. Yes flash life is affected but using a sensible logging time of once every 10-mins gives a long life of many years.
hello David, maybe a stupid question. I have some ESP8266 + extra memory 32M Flash. Can all of these 32M flash be used ?
It's a very good question. First off, are you sure it's 32MByte and not the standard 32Mbit (32/8=4MByte). The Arduino IDE does not support accessing flash > 4MByte, you'd need to use the esptool from Espressif to access any Flash greater than 4MB. There is very little written or covered on the subject and I suspect using the extra memory is going to be complex at least. Hopefully in time, the IDE will be updated to support larger storage now becoming more prevalent. All the memory is access via an SPI (serial) bus, so it should not be that difficult to extend. Currently you need to change the memory mapping for the ESP8266 to use any storage >4MB, which is essentially tell it there is extra available, but only in the esptool environment can this be done.
hello David, for my understanding it's 32Mbit (4MB)yte. It seems that Arduino 1.85 supports only 4Mbits (1 Mbyte) for SPIFFS. For my understanding you can't use these for Arduino today. Maybe usable for esptool or Atom. But my knowledge about these is horrible. Funny is that these modules are realy cheap. It cost by Aliexpress > 2€. As an result of these you get more memory for less money and modules work without any problem.
In Arduino IDE there is a 1M or 4M option for SPIFFS so you can use all of the Flash storage. I just looked at my data logger (SHT30) that has been running for about 14-months now and it's data store is reported at 4.1MBytes so it has clearly wrapped around, so that's using all the data for sure.
Sir, I am using ESP32 and SHT30 sensor for data logging. Datalog view web page not loading. I got the following error. All other page woks fine. Need you Help
11:47:50.869 -> E (26) SPIFFS: mount failed, -10025
11:47:50.869 -> E (26) SPIFFS: mount failed, -10025
11:47:50.869 -> SPIFFS failed to start...
Have you enabled SPIFFS when you set the compiler options?
@@G6EJD thank you, sir, I have enabled SPIFFS and got the result
Hi, I would like to know how do I set a BME280 sensor instead of SHT30. Nice logger.
Luka Knol Hi, I have produced a bme280 version here. github.com/G6EJD/ESP-Sensor-Server-and-Clients the server will display any data received. If need any help let me know
Version with server and client requires two platforms with esp32, one for server and second for sensor.
Is it possible to modify project from Tech Note 80 to use with BME280?
After finding the formula to change the output from Celcius to Farheniet I have to ask how complicated it is to carry this out. Have looked at the code but it is a bit overwhelming for me?
I presume your using the SHT30 version. This is how you change all units to Deg-F:
1. On line 117 change Deg-C to Deg-F using tempC x 9 / 5 + 32
temp = sht30.cTemp*10*9/5+32;
2. Search for all instances of Deg-C and replace with Deg-F
That's it.
Using SHT11 but will see if I can figure it out using your instructions above. Thank you very much.
Rud Dog it’s the same process just find the line where it reads temperature and convert it with x9/5+32 change all deg-c to deg-f
Failed to find the line in question so much so that my eyeballs are sore. I realize you said fo the SHT30 version and assumed the SHT11 was similar but getting the feeling they are not.
The code was written for the SHT-30 so there is no mention of the SHT-11 so I’ll need to produce a version for it but it will take a few hours. Standby.
Everything works fine including charts and dials but no log. Using ESP32 with SHT30 connected on a breadboard - no shield. Are others having this problem?
So the LogView option does not work?
For the past couple of hours have been enjoying the wifi connection ability via my web browser, in fact, moved the wemos into the garage keeping an eye on the signal strength for a given distance. Then It hit me. How is this device logging into my network if there are no entries in the sketch for my SSID or PASSWORD? And the credentials.h file is not found in the same directory as the ino file?
Once the ESP8266 has been used on a Wi-Fi and because it's using the WiFiManager library then it uses stored credentials on the ESP8266. If you do a ESP.Reset(); then it clears the credentials and that won't work anymore until you go through the Wi-Fi manager connection process or supply them in the file.
If you have plugged the DHT11 in above the ESP8266 you will notice in the readings some heat transfer via both conduction and convection and the only solution is to use say DuPont ca led or get a Wemos D1 mini dual base that solved nearly all heat transfer problems.
Could this be made to work with DH11 or LM35?
Yes, in the read sensor section change the code to read the required sensor.
does Low View only works with Internet Explorer and Edge and not with Chrome?
I use Edge and IE I have not used Chrome but I see why not.
what would i need to change in the code if i wanted to use a DHT11and can this work with the normal esp wroom 32 ?
ALLO CEDRIC BOLAMBA, at the start of the code is the definition for the dht12 but commented out just remove the comment prefix and add one to the dht22 line
i have a problem with codering: credentials.h: No such file or directory, what can i do?
Did you download it, place in the same folder as the sketch? Edit the content to match your information
@@G6EJD i have added the credentials.h file, but it say every time same error :(
Very interesting and useful knowledge. Thanks a lot for sharing Mr. Goodman, Great work. Is that possible to decrease the variable recording interval to 10miliSeconds?
You could but the processor would spend more time servicing sensor data than serving the web pages and saving the data, it is difficult to calculate the overhead by static code analysis, so you’d need to gradually reduce the sample time to measure the effect on system performance then you’ll get an idea of how fast the sample rate could be, there are few situations that require sampling at that rate, it doesn’t sound sensible to be sampling a real world activity at that rate unless a high speed object or activity
This is awesome!!
Very interesting and useful knowledge. Great work and thanks a lot for sharing Mr. Goodman. Is that possible to make it on esp8266-12e to share with us? I am looking for a pulse KWH monitoring stuffs too.
soovui It will compile and work with the ESP8266 it has conditional compile statements so will work.
Is this better than Thingspeak.com if my goal is just to store data in a folder in my PC?
Zana Taher, on the basis that it does not need an internet connection then yes. Although at some point you’ll need to use the server to upload data to your PC or request data from the server by your PC both are supported in the code I’ve provided
Great video!
Great project..Thank you. But the Log view page is not loaded either in internet explorer, not in chrome ..would you please help me with that?
You should try simulating a client and make sure the data is received, you get confirmation on the serial port that the data was received. Then the log should show up.
If your using the ESP8266 you will find the latest compiler build 2.5.0 does not work for many network functions, the last good build was 2.4.2
thank you good project
thanks sir
thanks for the video, i am sory but i amquite new in this topic. i have esp32 and some sensors and i want to save/store these datas offline, can i save/ store them in a wlan router? and in the end i can see the datas offline in form of charts/ graphs ( with html or javascript to charts the datas). thank you very much
There’s no accessible storage on any wlan router, you can store data on the ESP32 flash or SD card but what you want to do is very complex, other than what I have provided in tn080 and others I’ve done
@@G6EJD Now i am involved in a project to build a ventilator machine for corona patients. The Sensor datas from the machine should be then showed as graphs/ charts. And we also want to see these charts/ datas on the website (when internet works) and also webbrowser (if internet offline)
> when the internet works, we can send the datas and then strore/save them in the database/ website.. and with help with html and javascript, the sensor datas can be displayed as charts: when we go to our website address we will see these kind of charts and datas:
THe problem i have is:
> when offline, then we cannot send and save the datas in the website, so we need something how to save these sensor datas. with help of memory card we can save the sensor datas that collected from ESP32 in this memory card. Now i want to show/ display these data sensors in the webbrowser (e.g. when we open the webbrowser and type 168.192.1.1.1. for example). When i open my webbrowser and type the address, can these sensor datas that stored offline can be shown also as charts? because i cannot show the raw datas from sensor, the datas must be processed / calculated first and displayed as charts.
My Skills iin this area also not great, i am a newbie. so thank you very much for your attention
I have produced a project that can do most of what you want the data logging webserver no external WiFi required plus SD card or flash storage
@@G6EJD Data logging webserver, okay, i alr heard that too, some project use datalogging webserver to save their data online. do u have a liink of your video with data logging? it is a bit confusing to me, i didnt quite understand the logic/ the structure how this kind of system works.
very nice can we store log data per second ?
You could try, but the ESP processors don’t have the capacity to do that much
Awesome Sir :)
Sir pls help, how store data into the sd card instead of spiffs & put ssid password in web page for logging for same system.thanks🙏
To convert to SD card requires very little code change, add the SD library reference and replace spiffs with SD eg spiffs.begin SD.begin.
I’m not sure what you mean about SSID password in web page, I need more information
Sir , How to contact you?
g6ejd.dynu.com then contact
I am trying to log data from analog pins of arduino uno to a sd card with a sampling speed 50kHz..I used the code Analogbinlogger available in the sdfat examples..Also i want to display the stored data on sd card to a webserver in real time..Can u make a video or help me in this topic?
It not really possible with an UNO as you need to take a sample every 20uS and then store it to SD-Card and then get back to take the next reading. Then displaying in real-time from a web server is not possible at that speed, sorry. It's a very ambitious project unless your programming and technical skills are of a very high order.
@@G6EJD no sir,i have already done it,the data logging is perfectly operational..U can just check the example given in sdfat and just change the sampling frequency to 50kHz..At present i am working on sound,therefore the i kept the frequency to 45kHz,but it acts perfectly on 50kHz.
@@G6EJD my doubt is in the 2nd part..Real time data display on webserver using nodemcu from sd card
Not and run a web server too
you can plot thousands of points with google charts by initializing an empty dataset then adding your points with charts' JS api, instead of hard-coding the data into the source.
You can yes, but for some reason Google are bulking at the HTML headers, styles, body, footers, etc. It used to work OK with an ESP8266, If I drop all the HTML and just upload the scripts and data it works a little better. No data is hard coded in the programme. All the data for the webserver has to be issued in one page and I suspect I have reached the 16,384 String character limit with datasets more than 72 which of course is formed by lots of text like ['nnn','oo.o','pp.p'] for each point. I think 72 points is more than adequate for a temperature/humidity data logger.
hi David thanks for explanations.
i have question is there a way to make the project completely offline ?
Yes just change the WiFi mode to station ((STA) and set your own IP address if required, there are plenty of examples on how to do this, so just one line to change WiFi.begin(STA)
@@G6EJD thanks for answering David.
i did WiFi part but it seems internet connection is needed because of google charts is there a easy way around it?
gahraman keivani, I forgot about google charts, so there is no solution other than using java and the browser to do the drawing, but that’s a lot of work to do to implement.
thanks David for your time .
Sir pls help,After downloading your Data Logging program and successfully loading it onto my ESP32 board,but there was a two problem.One is time & date not update properly and another one Setup value not accepted by the browser.Thanks in advance.
23:18:27.000 -> SPIFFS Started successfully...
Connecting to: TP-LINK
Use this URL to connect: 192.168.1.105/
23:18:28.546 -> Webserver started...
23:18:33.047 -> 03723 318 411 08/04/70 17:12:56
23:18:33.235 -> Restored data from SPIFFS
23:18:35.250 -> Logging started at: 08/04/70 17:48:40
Have you checked your DST / env variable, please give more information about the other issue. Does my example code run noting the time would be different?
@@G6EJD yes, noting time is different.5:30 hrs and another issue is solved
subrata biswas, there is an example of setting Indian DST at 5.5 hrs in the source code
@@G6EJD ok sir, I will try and reply u later. Thanks for your quick response 🙏
@@G6EJD void StartTime(){
configTime(0, 0, "pool.ntp.org");
setenv("TZ", "UTC-05:30", 1);
UpdateLocalTime();
}
Sir problem was not solve,pls help
17:25:16.992 -> SPIFFS Started successfully...
17:25:16.992 ->
17:25:16.992 -> Connecting to: TP-LINK
17:25:17.554 -> ..WiFi connected at: 192.168.0.105
17:25:18.351 -> Thu Apr 09 2020 17:24:54
17:25:18.351 -> WiFi connected..
17:25:18.351 -> Webserver started...
17:25:18.351 -> Use this URL to connect: 192.168.0.105/
17:25:18.351 -> Webserver started...
17:25:23.460 -> 4163 325 501 09/04/20 11:27:42
noting date is ok but time is difference
good presentation
I tried to use datalogging on my esp32 wemos board. after that i have probably bricked my board.
this is about one problem i am facing, in case you mighthave encountered same issue - i have been using esp32 with bme680 and logging data into its SPIFFS memory, i left it running overnight and in the morning, the esp32 wemos board is not responding to any programming ide. i get following error -
esptool.py v2.1 Connecting........__ Chip is unknown ESP32 (revision (unknown 0xe)) Uploading stub... Running stub... Stub running... Configuring flash size... Warning: Could not auto-detect Flash size (FlashID=0xffffff, SizeID=0xff), defaulting to 4MB Compressed 8192 bytes to 47...
A fatal error occurred: Timed out waiting for packet content A fatal error occurred: Timed out waiting for packet content
I have raised issue on github here - github.com/espressif/esptool/issues/263 Any suggestions ?
Interesting, mine does not do that, it cycles around. I have had a unit running since Nov'17, it still is, and the FLASH for SPIFFS should be segmented and not write out of bounds, BTW mine is a Rev.1 silicon, but from the release notes I've seen that should make little difference. I wonder if the SPIFFS implementation is untested when the SPIFFS become full, it is possible. Have you tried a ESP.reset() and ESP.clearConfig(); but then if you can't communicate with the device that's odd as I thought that was hardcoded. Thanks for letting us know. BTW I have a an ESP8266 version running and that has twice filled up the SPIFFS and run around again without any issues. I know the libraries are different, so I'm thinking a library issue.
thanks. i dont know the cause yet, but i just somehow managedto remove wroom 32 board from my wemos board and put new board i had. now new one works. why first one got damaged , remains mystery to me.
Today I have been testing the arrangement and forcing it to wrap around and the results are the same as the esp8266 nothing happens. I have not inspected the differences between fs.h and FS.h but I expect the latter for the ESP32 to be almost identical. On one of ESP8266 loggers the file size reports on screen that it is over 6MB but there is only 3MB allocated so there is something wrong with the filing system. I’ll investigate some more.
thanks for letting me know your trial results. may be issue is something else and not SPIFFS related, it could be that some other parameter and my change of sketch both coincided .... before failure. i have now big suspicion that something related to my battery power might have done damage to it. i had used 18650 battery to run it over night....
if you go to my first githup post, i had some communication there, apparently arduino IDE sets some different memory allocation. may be that is the cause of your memory capacity difference.
github.com/espressif/esptool/issues/263 this post of mine and subsequent communication with people might be of your interest :)
Sir, How to Change the Time of Data Logging The time that the data is stored is -5.30 IST. I am originally from INDIA.
Have you adjusted the timezone setting in credentials?
@@G6EJD No, exactly where to change sir, I have changed the start time
@@ramprasatheee6549 setenv("TZ", "GMT0BST,M3.5.0/01,M10.5.0/02",1); you need the Indian time zone code, check out GitHub for the codes.
I don't know how reliable the DHT11 is but this morning after getting the Fahrenheit display working (Thank you G6JD) it suddenly started showing a temperature of 26F and it is actually 41F outside. Anyone had this type failure of DHT11s? To be fair it is mounted in a wooden box and temps inside the box reache 100F.
Well the DHT11 series of sensor whilst they look like they can be mounted outside in contact with the atmosphere, can't in fact there are few if any that can, the problem is with condensing water vapour. Some of the SHT3x series (30, 31 or 35) can be used outside, but only when fitted with a special micron permeable shield see my BME680 video to see what that looks like, or you can buy a DHT11 inside a special sintered / spheroidal bronze permeable housing so that it can come into contact with humidity but only a very fine vapour, when not fitted, water forms on the detection plates and it stops working, sometimes restarts when it's dried up. See here for an example: www.aliexpress.com/item/Soil-temperature-and-humidity-sensor-SHT10-agricultural-greenhouse-sheds-nursery-send-routine-new/32766408137.html?spm=2114.search0104.8.79.518f40f5sstLpr&priceBeautifyAB=0
Also: www.aliexpress.com/item/New-Electric-Different-Quality-Protection-type-temperature-and-humidity-sensor-temperature-and-humidity-sensor-built-in/32704749370.html?spm=2114.search0104.8.34.518f40f5sstLpr&priceBeautifyAB=0
So to expand on the enclosure in which this sensor is mounted, it is inside a wood box with a cover there are holes drilled at about a 45-degree angle to allow air to flow and to prevent water from entering the enclosure. But moisture can possibly get in and form dew on the parts and this is the possible culprit. If this is the case then it will be time to switch out to a more of an outdoor sensor. Off I go to review the sensor on your link. Thank You.
Why not try the sensor indoors over night or for more time ideally. Yes although the wholes won't let water in, the high humidity levels will condense on the sensor and cause it to react like it has.
Fully agree and at this time I have one sitting on my desktop and the other sitting outside only the one outside has shown temperature errors. I am in full agreement with you I need an outdoor tolerant sensor. Will need to find one for which your code will accommodate the sensor selected. The thought came to mind concerning how these manufacturers are protecting the sensor without blocking its intended purpose. Maybe this could be duplicated with the dht11?
Sir, it is possible to convert Access Point Webserver. If possible how to convert. Thanks.
Yes, just change the WiFi mode to AP it is widely discussed, it’s a single line command.
@@G6EJD After change wifi mode graph & dial are not showing, other functions work properly.
Yes, this is because the system no longer has access to google to draw the graphs! Unfortunately you can’t have everything!
Thanks a lot
how can i change the time stamp according to my location
You need to change the time zone value there is a link to get your region code
@@G6EJD Thank you for your reply. i already change but the date and time in calcDateTime() fuction still not change. it change only in UpdateLocalTime() and GetTime() fuction.
Which processor are you using, if the ESP8266 it can take a long time for time to start like 30-49 seconds. What time server are you using?
@@G6EJD i use esp32. my time zone is utc-7. i already change but the time stamp in log view still the same value.
What time code are you using if in error then this is likely the problem. Try my code in the time zone it should set the clock to right now 09:45 as it will switch the DST on
hi david, my server cant connect to wifi, can you pls help?
Have you selected / entered the correct IP address for your router? What is the base address of your router and are you using a similar address, for example if it is 10.0.0.1 then eg use 10.0.0.99
@@G6EJD Yup..got it, its working fine now. Thankd david.
Google changed API, nothing works anymore, no graphs, only gauges
They do this a lot, I’ll need to figure out what’s different and correct it.
I’ve corrected that now, all three google calls had been changed
C:\Users\and\Documents\Arduino\esp32-WebServerCodeWithCSS\esp32-WebServerCodeWithCSS.ino:37:25: fatal error: credentials.h: No such file or directory
how download this library? - credentials.h
Andrey Kg have you downloaded the credentials file in the github and placed it in the same folder as the sketch as it says in the reader? Modify the details for your wifi
@@G6EJD oops!
github.com/G6EJD/ESP32-OTA-Example/blob/master/credentials.h
i create this file and all ok. thanks, sir!
If you have a minute could you help out a rookie:
Arduino: 1.8.5 (Windows 8.1), Board: "WeMos D1 R2 & mini, 80 MHz, 115200, 4M (3M SPIFFS)"
C:\Shortened path\ESP32_SHT30_SPIFFS_DataLogger_01.ino:37:88: fatal error: WEMOS_SHT3X.h: No such file or directory
#include // github.com/closedcube/ClosedCube_SHT31D_Arduino
^
compilation terminated.
exit status 1
Error compiling for board WeMos D1 R2 & mini.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Ok try google closedcube github and you’ll find the library there download the zip and uncompress then place the folder in your ide libraries folder then it should compile ok
github.com/wemos/WEMOS_SHT3x_Arduino_Library
Great that worked like a charm. Now I get this error to which I applied what you just taught me but it did not work for this error. Can you explain why?
Arduino: 1.8.5 (Windows 8.1), Board: "WeMos D1 R2 & mini, 80 MHz, 115200, 4M (3M SPIFFS)"
C:\Users\myhomedir\Desktop\IOT_STuff\WEmos\ESP32_Data_Logging_Webserver-master\ESP32_SHT30_SPIFFS_DataLogger_01\ESP32_SHT30_SPIFFS_DataLogger_01.ino:39:25: fatal error: credentials.h: No such file or directory
#include "credentials.h"
^
compilation terminated.
exit status 1
Error compiling for board WeMos D1 R2 & mini.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
If you look in Github there are two files that need to be in the same folder the .ini and credentials.h and when you start the IDE you can select the credentials tab and update your SSID/password.
Sorry, I give up after getting past the last error I ran into another.
Arduino: 1.8.5 (Windows 8.1), Board: "WeMos D1 R2 & mini, 80 MHz, 115200, 4M (3M SPIFFS)"
C:\Users
udy\Documents\Arduino\libraries\Wire\utility\twi.c:25:20: fatal error: avr/io.h: No such file or directory
#include
^
compilation terminated.
exit status 1
Error compiling for board WeMos D1 R2 & mini.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
You almost sound normal at x2 speed....
Fifury161, well I’m used to delivery at a pace that enables learning and knowledge transfer to take place, clearly not fast enough for some, but then that will always be the case, for some too fast, for others too slow!
@@G6EJD Indeed - you can't please all of the people all of the time! Thank you for taking the time to reply.
After downloading your Data Logging program and successfully loading it onto my Wemos mini D1 I pushed the chair in and took a break. This morning decided to run the program and see how it was functioning. Ran into some oddities so thought rather then typing it out would make a video.
th-cam.com/video/ShKC3wdB174/w-d-xo.html
It says the video is unavailable- typical problems are your router not allowing the ESP to stay connected that’s a roger setting problem under the heading of leases often a router will not allow a continuous connection and renew the lease and IP address after a set period of time so you my not find it where you last used it.
Sorry tried to make it private so only you could see it and appears that is not what "private" means. Here is the public link.
th-cam.com/video/sbCKm6C_Kk8/w-d-xo.html
Ok thanks I can see what the problem is there are two your browser can’t find the address after the inputs it shows 0.0.0.0 it works ok on ie11 I think your not using that so I’ll fix that for you and I can see the range for the dials needs to be converted to deg-f as a moderate temperature is being shown in red so that needs the conversion doing - watch out it may take a few hours or hopefully less.
There is no hurry currently using your program on my outside station and once this is functional, plan on moving it to that location. Going to be great to see the temp in Fahrenheit. Find it odd as much help as you are free with that you don't have a donate button? You are one of the most responsive person I have run into online.
OK I have changed the input method and tested it on IE11, EDGE, Chrome and Firefox all working OK. This is the new version on Github: ESP8266_DHT11_WEMOS_SHIELD_SD_Log_Webserver_Deg-F_v02.ino
Any problems let me know. I also fixed the dial range from 5-125 deg-F you can change those I think it's fairly self-evident on line 337: webpage += "var gaugetempOptions={min:5,max:125,yellowFrom:5,yellowTo:32,greenFrom:32,greenTo:90,redFrom:90,redTo:125,minorTicks:10,majorTicks:['5','22','39','56','73','90','107','124']};";so you could go:
webpage += "var gaugetempOptions={min:0,max:130,yellowFrom:0,yellowTo:32,greenFrom:32,greenTo:90,redFrom:90,redTo:130,minorTicks:10,majorTicks:['0','16','32','48','64','80','96','112']};";
OK, finally go the sketch to load and typed in 192.168.1.30:8266
This site can’t be reached
192.168.1.30 took too long to respond.
Search Google for 192 168 8266
UPDATE: Connecting to: your ssid
......................
Failed to connect to a Wi-Fi network
Where do you place the SSID and USER NAME?
BTW when I remembered to check the serial port monitor I go this:
15 New Record Added
16 New Record Added
17 New Record Added
18 New Record Added
19 New Record Added
20 New Record Added
SSID and Password are in the crednetials file on the tab in your IDE near the menu. You connect to a server with (i don't know what IP your getting but from your example) 192.168.0.30/
don't add 8266 becuase that changes the address. Use the address it prints out in the serial port diagostics. It's adding records so it's running. You've got the address wrong.
Thank you for being so helpful the sketch is now running and I learned you can store password and ssid in a separate file. My C++ coding is non-existent and just started learning Python3 but can't seem to find IOTs running as commonly as C++. Well out of the box python3.