Temp sensor logger help

Hi,
I am trying to make a small temp sensor based on the ESP8266 that does following :

  • reads the temp and humidity every 10sec
  • saves data to SD card
  • goes to deep sleep
  • wakes up after 10 sec
  • checks a file whether 5 min runs has been made (30 runs)
  • turn on the wifi
  • read the file with data from SD card
  • send the data to dweet.io
  • then starts all over again (clearing the data file)

I am not sure how to make above, if someone could guide me.

I have attached my code which can do following :

  • read temp and humidity
  • send data to dweet.io
  • write data to a file
  • go to deep sleep and wake after 10 sec.

So i need help with the rest of the part especially how i make the best way to read the file on wake up and make sure that i am ready to send all 5 min data.

donnib

temp_sensor.ino (2.54 KB)

Since you are so deeply concerned about power, do you really need to read the humidity that frequently? If not, you might also reconsider the frequency of the temperature readings.

Also, if there is any importance in what you are doing, clearing the data file might not be such a good idea as implies touching faith in facilities that are beyond your control, while the SD card is in your control.