×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Weather Radio: RG11 sensor resets ESP8266 on heavy rain?

  • Posts: 1185
  • Thank you received: 370
Are you familiar with GIT? I could create a new branch on my indi-3rdparty fork so that you could download the latest firmware version and install it on your ESP8266.
The following user(s) said Thank You: Nguyễn Trọng Minh
2 years 6 months ago #75574

Please Log in or Create an account to join the conversation.

  • Posts: 136
  • Thank you received: 9
Wow that was fast. I am familiar with how github work. Please fork it and send me the link, I know how to proceed. Thanks!
2 years 6 months ago #75575

Please Log in or Create an account to join the conversation.

  • Posts: 1185
  • Thank you received: 370
I found a place in the rain sensor code that wasn't protected properly as interrupt. It would be great if you give it a try. It's branch weatherradio-v_1.16 at my indi-3rdparty clone github.com/sterne-jaeger/indi-3rdparty
The following user(s) said Thank You: Nguyễn Trọng Minh
2 years 6 months ago #75578

Please Log in or Create an account to join the conversation.

  • Posts: 136
  • Thank you received: 9
Alright, it seems the code WORKED! I let it ran for straight 10 minutes with the fast switching relay (5 click per secs) and it does not crash like it used too (it took 10-20secs before your fix for the board to gave up). Let me try letting it run for a few hours and see what happens. Thank you so much!
Also, I can see that the "count" var in the rainsensor.h is an unsigned Interger (which will display the max value to 65k ish). And the count does not reset, it just keep adding up since the board boots up. What would happens if the counts get to 65k (which is quite frankly, not that much since a heavy rain here in Vietnam can have somewhere between 10-20k clicks, so 65k is like 4-5 big rain which is a week worth of rain on raining season here).
 
The following user(s) said Thank You: Wolfgang Reissenberger, jiberjaber
2 years 6 months ago #75580

Please Log in or Create an account to join the conversation.

  • Posts: 136
  • Thank you received: 9
Okay I think you fixed it. Thanks a heap! This got me scratched my head for weeks now.
2 years 6 months ago #75581

Please Log in or Create an account to join the conversation.

  • Posts: 1185
  • Thank you received: 370
OK, the new version 1.16 has found its way into the master and is available now in the latest sources at github.com/indilib/indi-3rdparty
2 years 6 months ago #75596

Please Log in or Create an account to join the conversation.

  • Posts: 1185
  • Thank you received: 370
Btw: the count variable is only used for bucket mode. For drop detection the frequency is calculated by intervalCount, which is typically reset to 0 once a minute. And for the bucket mode, I would question that anyone sees the overflow.
The following user(s) said Thank You: Nguyễn Trọng Minh
2 years 6 months ago #75597

Please Log in or Create an account to join the conversation.

  • Posts: 136
  • Thank you received: 9
Umh. I am using drop detection mode and the count does not resets. It just keep adds up.the drop rate is reset every cycle though
Last edit: 2 years 6 months ago by Nguyễn Trọng Minh.
2 years 6 months ago #75598

Please Log in or Create an account to join the conversation.

  • Posts: 1185
  • Thank you received: 370
For simplicity reasons the count variable is delivered for both types of rain sensors, bucket count and drop count. For the latter, only the eventFrequency is of relevance, count can be ignored.
The following user(s) said Thank You: Nguyễn Trọng Minh
2 years 6 months ago #75599

Please Log in or Create an account to join the conversation.

  • Posts: 136
  • Thank you received: 9
Thanks. That means even if the counter overflows the board wont crash right?
about the false positive that you said before, check to see if you are having something that cast rotating shadows over your rg11? mine have some false clicks when I put it under the annonemeter so the blades cast rotating shadows over the sensor. When I move it to clearer sky, the false alarm stops.
but mine was just some random click, not a series of click like yours. Is your cable from your rg11 to the esp long? If the cable is long, it should be in twisted pair otherwise it could be interference.
2 years 6 months ago #75604

Please Log in or Create an account to join the conversation.

  • Posts: 1185
  • Thank you received: 370
Right, the overflow will not create a crash, the counter is simply ignored for drop counting. There is one function evaluates the interval counter and calculates both rainVolume and eventFrequency. It does not distinguish between drop and bucket count. The differentiation comes through the serialization function, that creates a JSON document:
void serializeRainSensor(JsonObject &doc, rainsensor_data &data, String name) {
  JsonObject json = doc.createNestedObject(name);
  json["init"] = data.status;
  json["mode"] = data.mode == 0 ? "tipping bucket" : "drop detect";
  if (data.status) {
    json["count"] = data.count;     // only relevant in tipping bucket mode
   if (data.mode == 0) {
      json["rain volume"] = data.rainVolume;
   } else {
      json["drop freq"] = data.eventFrequency;
   }
 }
}
The count value is only for debugging purposes so that you can check whether an event has been recognized - nothing more.
The following user(s) said Thank You: Nguyễn Trọng Minh
2 years 6 months ago #75605

Please Log in or Create an account to join the conversation.

  • Posts: 1185
  • Thank you received: 370
And good point about the false positives, it could be that the evening sun casts some rapid shadow movements since it shines through the tree.
2 years 6 months ago #75606

Please Log in or Create an account to join the conversation.

Time to create page: 0.593 seconds