Some trouble with STRING variable and DHT22 hanging [Solved]

I completely agree with @ScruffR’s logic here… we don’t all know everything about everything, and can’t be expected to. I don’t know everything there is to know about C, C++, Javascript, HTML, GIT, Github… and I can with 100% certainty proclaim I never will. I do know how to figure it out for myself though, and that is a valuable skill to learn. Please don’t shun those who try to teach. If more wise and experienced individuals were helpful and humble, the world would be a better place.

3 Likes

Hi Peekay123,

I was on a break for a few days, but then tested piettetech’s library. This solved the memory leak nicely. I tested my Core for 3 days and over 150’000 temperature samples without any failures.

@Marcus1, I have a lot of experience with the DHT22 lib (I ported it!) and it could be the cause if the sensor hangs, which is something I have found happens often with the library. I would highly recommend piettetech’s updated version of this library here2.

Second, I am not sure why you have all the single quotes in the sprintf statement. These are not needed and I am not sure if they will cause problems. smile

Your comment on single-quote use: I needed these to send proper JSON data into my AngularJS/IONIC apps. I tried different JSON formats, and finally figured out this JavaScript:

$scope.data = eval('(' + data.result + ')');

Works nicely with any HTML that has included {{data.Celsius}} or other fields.

Thanks !

3 Likes

Glad to hear that things are working out for you now :+1:

Any further questions - you know who to turn to :smile:

So, if you don’t mind, I’ll mark this as solved and change the topic to reflect the real cause of your problem, since it was no memory leak after all :wink:

2 Likes

@Dave, I guess you are the guy who takes care of the Discourse servers here - I’m absolutely sure, I had renamed this thread and marked it as solved, and now it’s back to what it was before.

I think I reworded it into something like “[SOLVED] Some trouble with STRING variable and blocking DHT22 lib”

Hmm, that’s weird, it’s possible someone edited it, I’ll switch it back.

Thanks,
David