counting++;
rui_lora_get_status(false,&app_lora_status); //The query gets the current status
switch(app_lora_status.autosend_status)
{
case RUI_AUTO_ENABLE_SLEEP:rui_lora_set_send_interval(RUI_AUTO_ENABLE_SLEEP,app_lora_status.lorasend_interval); //start autosend_timer after send success
rui_delay_ms(5);
break;
case RUI_AUTO_ENABLE_NORMAL:rui_lora_set_send_interval(RUI_AUTO_ENABLE_NORMAL,app_lora_status.lorasend_interval); //start autosend_timer after send success
break;
default:break;
}
The source of interrupt is come from the comparator circuit of the sensor.
At the beginning, the interrupt is fired by the sensor, however after a while,
the interrupt is not fired. The sensor output is OK, because I can see the LED
that connected the sensor output is blinking.
Is there any setup that have to be done to make the interrupt pin working, continuously ?
Do you have any suggestion to run RAK811 module as follow
get ADC measurement every 100 ms, send update data every 30 minutes,
in low-power environment.
I have tried to make a program in RUI. I am using timer to wake-up the ADC measurement, and going to sleep after measurement. The program is running for a while, and will be no-operation after about 60 seconds.
I have a sensor for water meter application. The current consumption is about 2.5mA. I want to decrease the current consumption of the sensor using gated-power to the sensor. Gated-power can be provided by the GPIO pin of the RAK811, and get the ADC measurement from the ADC pin.
I can add other low power MCU to do the task, but I think it is not a good solution.
here is my code
The serial port printing interface is "RUI_LOG_PRINT”。 If you don’t want them, comment them out. However, printing inside the system cannot be turned off.
After the module sleeps, it can wake up through the edge signal of RX pin and RTC.
If you need to perform the operation regularly, you need to start a timer wake-up module to perform the operation.
The wake-up frequency of 100ms is a challenge to the power consumption of the module.
Ok, so the message of “Go to Sleep”, “Wake up” are the printing inside the system.
So can not be turned off. I suppose that the RAK811 can not continue the operation is
due to the printing.
I’m still not clear about the 100ms - is that how often you poll the device for a reading?
Personally, I’d look at some of Microchip’s latest offerings, many of which, like the MSP430, allow peripherals like counters to run whilst the rest of the chip is shut down, but on a much smaller pin count. You can then use I2C to transfer over a reading at much greater intervals, allowing the RAK811 to sleep longer - and even incorporate a wake-up interrupt if there a reading overflow may come up!