This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Not seeing +CGEV: ME BATTERY LOW when battery voltage drops after enabling with AT%XPOFWARN

I'm enabling external power off warnings, as specified in section 5.22 of the AT command guide.

When I drop the supply voltage I see a LTE network disconnected message from the lte_handler, but I don't see the +CGEV: ME BATTERY LOW message.

I'm using this little chunk of code to do this, called right after modem initialization is complete:

static void XPOFWARN_Handler(void *context, const char *response)
{
   LOG_ERR("XPOFWARN response: %s", response);
}

void XPOFWARN_install_handler(void)
{
	int err = at_notif_register_handler(NULL, XPOFWARN_Handler);
	if (err != 0) 
   {
		LOG_ERR("Can't register handler err=%d", err);
	}
   if (at_cmd_write("AT%XPOFWARN=1,31", NULL, 0, NULL) != 0) {
		LOG_ERR("Can't start XPOFWARN handler");
	}
}

The handler installs successfully, the AT%XPOFWARN=1,31 command gets an "OK" response, and I see lots of other modem responses being printed by my XPOFWARN_Handler, but not the "+CGEV: ME BATTERY LOW" response that I was expecting when I lowered the battery voltage. I do see the LTE handler indicate that the LTE connection drops, right as I drop the voltage, so the modem is noticing the voltage drop and going offline.

Any idea what's going on here? I'm using compatible modem firmware and a board with a nRF9160-SIxA-B1 module, so that shouldn't be the issue.

Parents
  • Hello Joshua,

    but not the "+CGEV: ME BATTERY LOW" response that I was expecting when I lowered the battery voltage.

    how fast did you lower the battery voltage? Could it be possible that the voltage drops too fast and thus the modem doesn’t manage to send low battery level notification before it has to shut down?

    The handler installs successfully, the AT%XPOFWARN=1,31 command gets an "OK" response, and I see lots of other modem responses being printed by my XPOFWARN_Handler,

    Could you try the %XVBATLVL instead? Does that make any difference?

    Regards,

    Markus

Reply
  • Hello Joshua,

    but not the "+CGEV: ME BATTERY LOW" response that I was expecting when I lowered the battery voltage.

    how fast did you lower the battery voltage? Could it be possible that the voltage drops too fast and thus the modem doesn’t manage to send low battery level notification before it has to shut down?

    The handler installs successfully, the AT%XPOFWARN=1,31 command gets an "OK" response, and I see lots of other modem responses being printed by my XPOFWARN_Handler,

    Could you try the %XVBATLVL instead? Does that make any difference?

    Regards,

    Markus

Children
  • Markus,

    using XVBATLVL does get me "%XVBATLOWLVL: 3382" warnings, as the voltage drops. But I never see the warning that the modem is going offline because of low voltage.

    It's possible I'm reducing the voltage too fast, and the modem goes straight to shutdown, without first issuing a warning, but I would have thought you should get the warning anyway so that you can tell WHY the modem went down.

    I'm going to test this further, but if you have any thoughts on what might be going on I would appreciate them.

    Regards,

    Josh

Related