×

INDI Library v1.9.9 Released (30 Nov 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

Weather Radio: RG11 sensor resets ESP8266 on heavy rain?

  • Posts: 94
  • Thank you received: 3
Hi there,
I recently added a Hydreon RG11 to my weather radio. I hook it up like this.
 
But every time the rain gets heavy (on the scale of 65 drops per 20 secs which is the update interval that I set) the ESP8266 got reset and it loose the wifi connection and cannot reconnect. I have to disconnect the usb to reset it and it connect again only to reset a few count cycle later if the rain still going (sometimes it work for a while but most of the time it just got reset when rain gets heavy. Sometimes the ESP got reset at not so heavy rain (20ist drop per 20 secs). Am I doing something wrong? The rain gauge is set the drop detection mode with multiple click per large drop.
Thanks!
P/S:  Could @Wolfgang please share your RG11 wiring diagram? Thanks!
Last edit: 1 year 3 months ago by Nguyễn Trọng Minh.
1 year 3 months ago #75178
Attachments:

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

  • Posts: 66
  • Thank you received: 3
Could be a number of things, but it's a bit hard to know what without source code to view. Initial thoughts are:
Anything printed to the serial port when it crashes? (you might be able to use the decoder to see where in the code the crash is happening?)
Interrupt driven, perhaps on a lot of interrupts this is colliding with something else that is supposed to happen and causing a crash? (I get this with a light meter I added on to my WX station - during the day the frequency of interrupts increases to a point where the device was crashing / falling over.)
1 year 3 months ago #75225

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

  • Posts: 1014
  • Thank you received: 302
Hi,
your wiring looks correct. I guess you used the same source for wiring as I did: cactus.io/projects/weather/arduino-weather-station-rain-sensor

HTH
Wolfgang
TSA-120 + FSQ-85 + ONTC 10"F4 Newton (+ epsilon-160 on Japan trip) | Avalon Linear + M-zero | ASI 1600mm pro + 6200mm pro | KStars/INDI on Raspberry Pi 4/Intel NUC
The following user(s) said Thank You: Nguyễn Trọng Minh
1 year 2 months ago #75532

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

  • Posts: 94
  • Thank you received: 3
I am using that very same wiring tutorial, just that I bump up the resistor to 100K instead of 10K like in the tutorial since I realized that using a 10k makes the board crashes even more frequent. Weird. Maybe I should power the pins that feed into GPIO externally and see if it happens again. Seems to be a problem with powering. Although I replaced several power adapters with over 2amps of output which I think is plenty.
1 year 2 months ago #75534

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

  • Posts: 66
  • Thank you received: 3
Are you sure it's circuit related?, my thinking (but without seeing the code) is it's interrupt related and you are being swamped with interrupt requests due to the high level of rainfall resulting in the watchdog being triggered on the ESP8266.

Anyway, here's how to try and see what's causing the crash if it is software related: arduino-esp8266.readthedocs.io/en/latest...-my-esp-crashes.html

If you don't get the crash with low / no rain, it's unlikely to be the circuit. Your increase in resister for the pull up will only come in to play if the distance between the sensor and controller is very long and your wire is quite thin and that would result in missed activations not increased / crashes. You can test this by disconnecting the RG11 unit and manually joining the wires together to simulate a pulse from the RG11 relay.
If you disconnect the RG11, does the ESP still crash? What does it output on the serial port?

I have a RG15 and it can be sensitive to the input voltage causing brownouts, but that would be unlikely to lock up your ESP as it's a separate unit but should't be ruled out just yet though 2A should be more than enough for both devices to co-exist.. (RG11 is 55mA max @12V input with everything on from the datasheet)

Do you have a link to the code you are running?
The following user(s) said Thank You: Nguyễn Trọng Minh
1 year 2 months ago #75546

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

  • Posts: 241
  • Thank you received: 49
Seems the sensor is very sensitive
"Depending on the model, the algorithm can register accumulations of just one ten-thousands of an inch–"

But is also configurable
"The resolution may be set using the DIP switch"

What mode are you running the unit at, Mode 0 or Mode 1, I assume Mode 0 (?)
rainsensors.com/wp-content/uploads/sites...-11_instructions.pdf

At what resolution?


To limit switch bounce you can also just stick a 0.1uf or 0.01uf cap on the signal line between signal and ground to see if that does anything to what you are seeing.
Change the pullup back to 10k to start with.
The following user(s) said Thank You: Nguyễn Trọng Minh
1 year 2 months ago #75559

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

  • Posts: 94
  • Thank you received: 3
Thanks for your detailed troubleshoot. The board run for weeks without problem if there are no rain. But if there are rain then it crashes after a while. (The longest rain that it recorded before crashing is 6 hours. But most of the time it just gave up after a couple of hours at best, even minutes if the rain is heavy. Thanks for the watchdog debug information. I didnt know there's a crash log. I'd plug the board into computer and try to ctimulate the sensor to get it crash and see the logs.
oh and here's the code. github.com/indilib/indi-3rdparty/tree/ma...rmwares/weatherradio
Last edit: 1 year 2 months ago by Nguyễn Trọng Minh.
1 year 2 months ago #75561

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

  • Posts: 94
  • Thank you received: 3
I am using mode 1 (drop counter). I am thinking of a noise filter too. Lets see how it works. Thanks!
Last edit: 1 year 2 months ago by Nguyễn Trọng Minh.
1 year 2 months ago #75562

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

  • Posts: 1014
  • Thank you received: 302
I'm also using the drop count method and from time to time I experience a crash and reboot as well. I had WiFi problems as well, but my explanation was always that the WiFi-network was the problem and not due to the crash. If you can find a way how to reproduce the crash I can try to fix in the firmware.
TSA-120 + FSQ-85 + ONTC 10"F4 Newton (+ epsilon-160 on Japan trip) | Avalon Linear + M-zero | ASI 1600mm pro + 6200mm pro | KStars/INDI on Raspberry Pi 4/Intel NUC
The following user(s) said Thank You: Nguyễn Trọng Minh
1 year 2 months ago #75564

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

  • Posts: 94
  • Thank you received: 3
Hehe, it's kinda reassuring to know you had problems too. Thought it was just me. I can replicate the reset by stimulate the rainsensor with fast duration or hook in a fast switching relay (50 ms interval) instead of the rg-11, with the fastswitching relay, the board resets randomly after a few minutes.
1 year 2 months ago #75566

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

  • Posts: 1014
  • Thank you received: 302
Its even worse with mine, I frequently experience false rain drop counts during, mainly during the evening hours. You can see it on my weather page here: weather.openfuture.de. Today it was also during day time. There was little drizzling, but nothing heavier. The separate rain bucket counted 0.5mm rain - almost nothing. Nevertheless, RG-11 reported "heavy rain". I've contacted Hydreon about this false alarm, maybe they know a solution.

Regarding the reboot-problem: this looks like a software problem. I'll take a look...
TSA-120 + FSQ-85 + ONTC 10"F4 Newton (+ epsilon-160 on Japan trip) | Avalon Linear + M-zero | ASI 1600mm pro + 6200mm pro | KStars/INDI on Raspberry Pi 4/Intel NUC
The following user(s) said Thank You: Nguyễn Trọng Minh
1 year 2 months ago #75567

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

  • Posts: 94
  • Thank you received: 3
Mine has never report a single false drop. But everytimes it resets, it looses the wifi connection, only a power recycle restore wifi connection, which is really annoying and potentially dangerous since I am relying on the weather station for ROR automation. Jiberjaber suggested it maybe a software watchdog kicking in due to hi rate switching and it looks plausible to me. Since I plug the fast switching relay pin into a different GPIO (Which I am not mapping the rain sensor into) and the board runs fine (I think it proved that the board is not overload hardware-wise) but as soon as I plug it into the GPIO that I map into rain sensor, the board resets after a minutes. 
Let me try disable the software watchdog.
1 year 2 months ago #75568

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

Time to create page: 1.479 seconds