Hi!
I have a problem regarding my simple weather station. In my code, I have a loop that saves data from sensors into a string. Each line in the string is one run through the loop consisting of: date and time from RTC DS1307, humidity and temperature from DHT22 and temperature and pressure from BMP085. In the present version the loop runs 8 times, then the whole 8-line string is tranferred to the screen through the Serial port.
What troubles me is what I get in the results:
30.06.2014 19:31:51 56.0, 24.1, 23.52, 99386
30.06.2014 19:31:54 56.0, 24.1, 23.51, 99383
30.06.2014 19:31:56 56.0, 24.1, 23.51, 99386
30.06.2014 19:31:59 56.0, 24.1, 23.51, 99384
30.06.2014 19:32:01 56.0, 24.1, 23.51, 99389
30.06.2014 19:32:04 56.0, 24.1, .,
30.06.2014 19:32:06 ., ., .,
30.06.2014 19:32:09 ., ., .,
As you see, after the 5th line, the data from the sensors get cut off (the dots and commas are "handwritten" in the code). At first, I thought that I exceeded some string length limit that I didn't know of, but quickly I realized that it's impossible, since the clock data and dots are there.
As I said - each of these lines is generated by another run of the same loop, so I don't really see what can differenciate one from another. The problem can't lie in the sampling period, either, as there's a delay of 2,5 s between each line - and I tried it with 10 s either, it makes no matter.
Sometimes the problem starts half a line earlier/later.
Does any of you know what's the matter?
Thanks in advance for your help!
Bonus question:
Sometimes the clock has some issues too, and it returns things like:
30.06.2014 19:33:39 55.9, 24.1, 23.73, 99387
165.165.2165 165:165:85 55.9, 24.1, 23.73, 99394
30.06.2014 19:33:45 55.9, 24.1, 23.73, 99389
...just for a line, then everything gets back to normal. If you know why, let me know. Thanks again!