Cubcell hangs after few days

Hi,

i use cubcell De-board for a lora raingauge. My software is based on ext_interrupt example. After a few hours to days the software hangs and I do not receive lora packets anymore. I have to reset the board with reset switch to get it working again. The board is powered with battery and solar cell (also tested without solar cell). I have rgb led activated for tests and it does not flash so it is not a gateway issue. After reset the board work again, so I don not think it is a battery problem.
My current software can be found at https://github.com/schenlap/Lora_raingauge
How can I debug to find the root cause?

Possible, make a test (compile) with Version 0.0.5.

Also you can use the watchdog-timer, but i can’t say how to use it. Heltec must publish an example-code for watchdog-implementation.

E_T

case DEVICE_STATE_SLEEP:
{
if (accelWoke) {
increment_rain_meter();
accelWoke = false;
}
LoRaWAN.sleep();

Not the main-problem, but t think, when you get fast interrupts then the software swallows some values, because the sending takes some time.

There was a discussiob about a flow meter here

http://community.heltec.cn/t/count-pulses-for-flow-meter/1720/17

Using a little mcu like attiny as i2c slave doing the counts is a solution.
It takes only little power and wont miss a pulse.

If there is heavy rain your node would send so fast that would not be in the fair use policy of ttn.

1 Like

It may be that the system has run to an unknown location. I can think of adding a watchdog, but the integrated watchdog function of the ASR650X chip is very bad:

Anyway, I will add 2 second watchdog in the next few day, and we will come out with a watch module later.

1 Like

Thank you! I would also like to include watchdog function even if “unfriendly”.

Is there already a watchdog demo available?
Currently I am not sending on every pulse but have a timer do send data.

this commit added a watchdog example:

Thank you for the example. I will test it in the next days

Hi memo5,
I’m testing your code to see if its stable on my board (HTCC-AB01 915MHz).

I was wondering, it seems you are using a scheduled downlink once per day to reset the rain counter?
What parameters are you using for the downlink in ttn console?