Card.voltage for power out

I am looking at implementing a power outage detection using card.voltage. I understand that if the following command is sent
{
“req”: “card.voltage”,
“usb”: true,
“alert”: true,
“sync”: true
}
an event would write to _health.qo when the power goes out. I cannot seem to find what the message would look like for the power out, or when the power comes back on. Is this documented somehwere?

Finally, if there is a message for when the power comes back on, would this message be generated when the notecard first boots up on initial power on, as I am assuming one the above command is sent, it would remain in memory.

randy

Hey @rksteeves,

an event would write to _health.qo when the power goes out. I cannot seem to find what the message would look like for the power out, or when the power comes back on. Is this documented somehwere?

I just tried this out on one of my Notecards and you can see the messages in the screenshot below —see {usb-disabled} and {usb-enabled}.

Finally, if there is a message for when the power comes back on, would this message be generated when the notecard first boots up on initial power on, as I am assuming one the above command is sent, it would remain in memory.

The Notecard will only be able to send the messages if it has power. I’d recommend adding a LiPo battery so the Notecard has backup power to send the appropriate Notes when you lose and regain power. This article has a pretty good writeup if you haven’t seen it yet: Cellular-Enabled Power Outage Detector w/ SMS Notifications - Hackster.io.

TJ

1 Like

Thanks, I read the article you reference, the difference is that there is now a reference to the card.voltage in the article, which seems to be a nice solution, but I was not sure what the resulting health.qo would look like.

When the notecard comes back online after a power outage the _health.qo message is

{"text":"boot (brown-out & hard reset [4015681])"}