Card.voltage trends questions

I have a battery powered custom board with notecard WBNA (with latest LTS firmware). I’m trying to read the voltage trends using card.voltage. As you can see from this output:

14:15:09.288 -> [INFO] {"req":"card.voltage","mode":"default","hours":24,"set":true,"calibration":0,"crc":"0000:6668BE47"}

14:15:09.485 -> [INFO] {"minutes":12696,"mode":"normal","value":3.5606215888818525}

I’m not getting the voltage trend data and the notecard has been powered and running for 211.6 hours, way more than the 24 hour calculation interval specified in card.voltage.

I have some questions about card.voltage and voltage trends:

  1. Are voltage trends calculated when the hub.set mode is minimum? Does the mode have to be continuous or periodic for voltage trends to be calculated. I couldn’t find any mention in the documentation.
  2. The documentation seems to indicate that card.voltage mode=USB does not do voltage trend calculations. Is that correct? Are there other card.voltage modes that don’t do voltage trend calculations?
  3. What events reset or restart the voltage trends calculation?

Thanks,
Karl

Hi @Karl_iWell ,

Upon investigation, it appears that the on parameter, which is used to enable historic voltage trends, was not present on the card.voltage API docs. I’ve since amended the developer docs, and it will make its way onto the live website shortly. Please try the following request:

{"req":"card.voltage","mode":"default","hours":24,"set":true,"calibration":0,“on”:true}

You can see I added “on”:true to the end of your query string. If you wish to disable the historical data trend, you can use "off”:true .

To answer your questions:

  1. The voltage trends are calculated independently of the hub sync mode, so using hub.set with minimum should not affect the voltage trend.
  2. That is correct. When Notecard detects USB power, the voltage trend array is not updated, and thus no trend data is collected for this period. I believe it is only USB that behaves like this.
  3. To completely clean the voltage trend array, you’d need to perform acard.restore on your Notecard, with the delete parameter set to true. This will also completely erase all the configuration on your Notecard.

Please let me know if this resolves your issue.

Thanks,

Alex

4 Likes

Thanks Alex. That’s fixed it, I appreciate the help.

Karl

3 Likes