# Node-red-contrib-vcgencmd : reset throttling statistics

**URL:** <https://discourse.nodered.org/t/node-red-contrib-vcgencmd-reset-throttling-statistics/15229>\
**Category:** General\
**Created:** [7 September 2019 09:49 UTC](https://discourse.nodered.org/t/node-red-contrib-vcgencmd-reset-throttling-statistics/15229 "2019-09-07T09:49:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [7 September 2019 09:49 UTC](https://discourse.nodered.org/t/node-red-contrib-vcgencmd-reset-throttling-statistics/15229/1 "2019-09-07T09:49:22Z")

</div>

Hi folks,

I received I **very good** question from one of the forum members, but I don't know the answer myself so I post it here. For privacy reasons - and since he is still '_trying to learn_' - I won't mention his name here 🤣

Summarized it is about my [node-red-contrib-vcgencmd](https://github.com/bartbutenaers/node-red-contrib-vcgencmd), which allows a.o. to determine whether the Raspberry:

- Is being throttled **currently** (e.g. due to thermal overheating or under voltage by bad power supply)
- Has been throttled **since the last reboot**

But it would be nice if we could know whether the Raspberry _has been throttled since a specified moment in time_, instead of since the last reboot.

Seems to me that there are not much options:

- **Reset messages** would be the best solution, since you can decide yourself when the statistics should be reset. But by reading this [discussion](https://www.raspberrypi.org/forums/viewtopic.php?t=241736) I conclude that you CANNOT reset it?
- Suppose you just look at the '_current_' throttling state **every N seconds** , then you don't know if throttling happened in between (i.e. in the last N seconds).
- Running the vcgencmd **every second** seems overkill to me...

If anybody has a creative proposal, please let me know and I implement it in my node...

Thanks !  
Bart

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 September 2019 10:17 UTC](https://discourse.nodered.org/t/node-red-contrib-vcgencmd-reset-throttling-statistics/15229/2 "2019-09-07T10:17:00Z")

</div>

This is a flow I have bashed together.

There is work needed because of the mentioned problem with the "flag" (memory) outputs.

Extra nodes needed:  
`traffic`  
`gate` (yeah, traffic was used as well. I should get rid of traffic)  
`queue`  
`fan` handy to keep flows neater  
`ring-buffer` used to show list on dashboard  
`string` to format stuff

The `fan` node can be ignored and just wire past it.  
The `gate` and `traffic` nodes are needed only for enabling the flow, and controlling what is shown.

Top left of the flow with the `LINK` node. (The top one)  
This basically is the input / _clock_ (if you will) to _activate_ the flow.

There is three parts to the flow.  
Top, middle and bottom.  
The middle has three parts too.  
Left, middle, right.

Walk through:  
Top:  
This receives the _clock_ input and generates the command/node.  
It then filters the message and queues up what is received. (Optional)

Middle:

Left part - starts building the message to be displayed. Sets up button to wipe the list on the  
dashboard. Also displays messages on Dashboard.  
Another list is queued in a `queue` node for edit screen viewing.

Middle - allows timed control of how long the outputs are logged to a file.

Right - Saves outputs to a file.

Bottom:  
This shows graphically the state of things.  
At the bottom you will see the new part to be applied to all of the latter 4 outputs because of the above mentioned problem.

To _simulate_ an error, allow the flow to establish itself then stop it. (top left of the top part)  
In the bottom part there is an `inject` node marked TEST.  
Press it and look at the dashboard.  
You will see a simulated alarm.  
Between the two sets of buttons, you can see a button which is now enabled.  
Clicking it, it will _wipe_ the notification.  
Re-enable the flow and after a cycle, all should return to normal.

[machine\_health.json](https://discourse.nodered.org/uploads/short-url/wOMZYQcoT3AsVtfhJWjBRJiOsin.json) (66.3 KB)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 September 2019 10:27 UTC](https://discourse.nodered.org/t/node-red-contrib-vcgencmd-reset-throttling-statistics/15229/3 "2019-09-07T10:27:34Z")

</div>

Pictures to save typing too many words.

Pic 1:  
All good.

 ![Screenshot%20from%202019-09-07%2020-23-34](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e3c3368256b40dce8ceed7de66cdb7ff2c97f129.png)

Pic 2:  
TEST button pressed.  
Really the "undervoltage" text would remain.  
Note the enabled button in the middle.

 ![Screenshot%20from%202019-09-07%2020-23-45](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/2430741371a642ba1576bcf2cb0282c0c846d1a1.png)

Pic 3:  
The ACK button pressed

 ![Screenshot%20from%202019-09-07%2020-23-50](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/926be9662ba4b62ed6fed6abaed2b158e7f46bd5.png)

Then it will loop back to Pic 1 when you re-enable the flow.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 September 2019 12:06 UTC](https://discourse.nodered.org/t/node-red-contrib-vcgencmd-reset-throttling-statistics/15229/4 "2019-09-07T12:06:58Z")

</div>

Here is a bit of a re-write of the bottom section of the flow.

Works a bit better.

It needs the text to be better modified so it shows it as a FLAG (appended to the existing text)

```auto
[{"id":"3f918764.b079f","type":"switch","z":"aa48e352.9ad2f8","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"underVoltage","vt":"str"},{"t":"eq","v":"frequencyCapped","vt":"str"},{"t":"eq","v":"throttled","vt":"str"},{"t":"eq","v":"softTempLimit","vt":"str"},{"t":"eq","v":"underVoltageOccurred","vt":"str"},{"t":"eq","v":"frequencyCappedOccurred","vt":"str"},{"t":"eq","v":"throttledOccurred","vt":"str"},{"t":"eq","v":"softTempLimitOccurred","vt":"str"}],"checkall":"true","repair":false,"outputs":8,"x":490,"y":1570,"wires":[["23ac9937.3bdd86","eb0aed25.73403","37c38967.b379be","7d6b4836.5681d"],["767a874c.b4c7d8","eb0aed25.73403","dcd35d04.1586e8"],["dc24fa1.dfb3788","eb0aed25.73403","c04db9e3.232918"],["a74f3aa7.3c96","eb0aed25.73403","d04963bf.37dc98"],[],[],[],[]]},{"id":"23ac9937.3bdd86","type":"function","z":"aa48e352.9ad2f8","name":"","func":"//node.warn(msg.topic);\nif (msg.payload === false)\n{\n //\n msg = {payload: '<font color=\\\"lime\\\" ><i class=\"fa fa-thumbs-o-up fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"green\",shape:\"dot\",text:\"Good\"});\n //\n} else\n{\n //\n msg = {payload: '<font color =\\\"red\\\"><i class=\"fa fa-thumbs-o-down fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"red\",shape:\"dot\",text:\"Bad\"});\n //\n}\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":1430,"wires":[["5149696c.90c8"]]},{"id":"eb0aed25.73403","type":"link out","z":"aa48e352.9ad2f8","name":"","links":["14cd8aa1.52e2b5"],"x":665,"y":1350,"wires":[]},{"id":"37c38967.b379be","type":"debug","z":"aa48e352.9ad2f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":520,"y":1460,"wires":[]},{"id":"767a874c.b4c7d8","type":"function","z":"aa48e352.9ad2f8","name":"","func":"//node.warn(msg.topic);\nif (msg.payload === false)\n{\n //\n msg = {payload: '<font color=\\\"lime\\\" ><i class=\"fa fa-thumbs-o-up fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"green\",shape:\"dot\",text:\"Good\"});\n //\n} else\n{\n //\n msg = {payload: '<font color =\\\"red\\\"><i class=\"fa fa-thumbs-o-down fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"red\",shape:\"dot\",text:\"Bad\"});\n //\n}\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":1470,"wires":[["ed5bd15a.3499f"]]},{"id":"dc24fa1.dfb3788","type":"function","z":"aa48e352.9ad2f8","name":"","func":"//node.warn(msg.topic);\nif (msg.payload === false)\n{\n //\n msg = {payload: '<font color=\\\"lime\\\" ><i class=\"fa fa-thumbs-o-up fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"green\",shape:\"dot\",text:\"Good\"});\n //\n} else\n{\n //\n msg = {payload: '<font color =\\\"red\\\"><i class=\"fa fa-thumbs-o-down fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"red\",shape:\"dot\",text:\"Bad\"});\n //\n}\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":1510,"wires":[["903b7b61.3ca84"]]},{"id":"a74f3aa7.3c96","type":"function","z":"aa48e352.9ad2f8","name":"","func":"//node.warn(msg.topic);\nif (msg.payload === false)\n{\n //\n msg = {payload: '<font color=\\\"lime\\\" ><i class=\"fa fa-thumbs-o-up fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"green\",shape:\"dot\",text:\"Good\"});\n //\n} else\n{\n //\n msg = {payload: '<font color =\\\"red\\\"><i class=\"fa fa-thumbs-o-down fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"red\",shape:\"dot\",text:\"Bad\"});\n //\n}\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":1550,"wires":[["d25bdb3a.99951"]]},{"id":"df809b4b.bd2f3","type":"change","z":"aa48e352.9ad2f8","name":"set","rules":[{"t":"set","p":"state","pt":"msg","to":"payload","tot":"msg"},{"t":"move","p":"parts.key","pt":"msg","to":"topic","tot":"msg"},{"t":"delete","p":"delay","pt":"msg"},{"t":"delete","p":"_event","pt":"msg"},{"t":"delete","p":"parts","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":1570,"wires":[["3f918764.b079f","b5f80b31.f1e5d8"]]},{"id":"7d6b4836.5681d","type":"fan","z":"aa48e352.9ad2f8","x":700,"y":1630,"wires":[["4a84ed89.e70fc4","a88f905f.6f95b"]]},{"id":"dcd35d04.1586e8","type":"fan","z":"aa48e352.9ad2f8","x":700,"y":1750,"wires":[["2217f23e.87521e","5d7faaf4.83590c"]]},{"id":"c04db9e3.232918","type":"fan","z":"aa48e352.9ad2f8","x":700,"y":1870,"wires":[["518bc33e.880e8c","57491809.1d9688"]]},{"id":"d04963bf.37dc98","type":"fan","z":"aa48e352.9ad2f8","x":700,"y":1990,"wires":[["e95243d.cdf544","41c38dfa.141354"]]},{"id":"5149696c.90c8","type":"ui_text","z":"aa48e352.9ad2f8","group":"e53f59db.f595f","order":1,"width":0,"height":0,"name":"Under voltage","label":"{{msg.topic}}","format":"{{msg.payload}}","layout":"row-spread","x":870,"y":1430,"wires":[]},{"id":"17fb240e.1f7f64","type":"inject","z":"aa48e352.9ad2f8","name":"Test","topic":"Testing","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":520,"y":1350,"wires":[["eb0aed25.73403","23ac9937.3bdd86","a88f905f.6f95b"]]},{"id":"ed5bd15a.3499f","type":"ui_text","z":"aa48e352.9ad2f8","group":"e53f59db.f595f","order":2,"width":0,"height":0,"name":"Frequency capped","label":"{{msg.topic}}","format":"{{msg.payload}}","layout":"row-spread","x":880,"y":1470,"wires":[]},{"id":"903b7b61.3ca84","type":"ui_text","z":"aa48e352.9ad2f8","group":"e53f59db.f595f","order":3,"width":0,"height":0,"name":"Throttled","label":"{{msg.topic}}","format":"{{msg.payload}}","layout":"row-spread","x":850,"y":1510,"wires":[]},{"id":"d25bdb3a.99951","type":"ui_text","z":"aa48e352.9ad2f8","group":"e53f59db.f595f","order":4,"width":0,"height":0,"name":"Soft Temp Limit","label":"{{msg.topic}}","format":"{{msg.payload}}","layout":"row-spread","x":870,"y":1550,"wires":[]},{"id":"f5c7e401.2a3a08","type":"split","z":"aa48e352.9ad2f8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":350,"y":1530,"wires":[["df809b4b.bd2f3"]]},{"id":"b5f80b31.f1e5d8","type":"debug","z":"aa48e352.9ad2f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":490,"y":1660,"wires":[]},{"id":"4a84ed89.e70fc4","type":"function","z":"aa48e352.9ad2f8","name":"One only.","func":"if (msg.topic == \"GATE\")\n{\n context.set(\"ALLOW\",1);\n node.status({fill: \"green\",text:\"ONE\"});\n return;\n}\nif (context.get(\"ALLOW\") == 1)\n{\n //\n context.set(\"ALLOW\",0);\n node.status({});\n return msg;\n}","outputs":1,"noerr":0,"x":860,"y":1670,"wires":[["7bc34e05.eb314"]]},{"id":"a88f905f.6f95b","type":"switch","z":"aa48e352.9ad2f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":850,"y":1630,"wires":[["7bc34e05.eb314"]]},{"id":"2217f23e.87521e","type":"function","z":"aa48e352.9ad2f8","name":"One only.","func":"if (msg.topic == \"GATE\")\n{\n context.set(\"ALLOW\",1);\n node.status({fill: \"green\",text:\"ONE\"});\n return;\n}\nif (context.get(\"ALLOW\") == 1)\n{\n //\n context.set(\"ALLOW\",0);\n node.status({});\n return msg;\n}","outputs":1,"noerr":0,"x":860,"y":1790,"wires":[["60fa61ee.c6e828"]]},{"id":"5d7faaf4.83590c","type":"switch","z":"aa48e352.9ad2f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":850,"y":1750,"wires":[["60fa61ee.c6e828"]]},{"id":"518bc33e.880e8c","type":"function","z":"aa48e352.9ad2f8","name":"One only.","func":"if (msg.topic == \"GATE\")\n{\n context.set(\"ALLOW\",1);\n node.status({fill: \"green\",text:\"ONE\"});\n return;\n}\nif (context.get(\"ALLOW\") == 1)\n{\n //\n context.set(\"ALLOW\",0);\n node.status({});\n return msg;\n}","outputs":1,"noerr":0,"x":860,"y":1910,"wires":[["4da13161.7dad8"]]},{"id":"57491809.1d9688","type":"switch","z":"aa48e352.9ad2f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":850,"y":1870,"wires":[["4da13161.7dad8"]]},{"id":"e95243d.cdf544","type":"function","z":"aa48e352.9ad2f8","name":"One only.","func":"if (msg.topic == \"GATE\")\n{\n context.set(\"ALLOW\",1);\n node.status({fill: \"green\",text:\"ONE\"});\n return;\n}\nif (context.get(\"ALLOW\") == 1)\n{\n //\n context.set(\"ALLOW\",0);\n node.status({});\n return msg;\n}","outputs":1,"noerr":0,"x":860,"y":2030,"wires":[["54905501.00645c"]]},{"id":"41c38dfa.141354","type":"switch","z":"aa48e352.9ad2f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":850,"y":1990,"wires":[["54905501.00645c"]]},{"id":"87488c6f.7c29b8","type":"link in","z":"aa48e352.9ad2f8","name":"","links":["33d21cd6.fd5f24"],"x":255,"y":1530,"wires":[["d674b951.e35488","f5c7e401.2a3a08"]]},{"id":"7bc34e05.eb314","type":"function","z":"aa48e352.9ad2f8","name":"","func":"//node.warn(msg.topic);\nif (msg.payload == false)\n{\n //\n msg = {payload: '<font color=\\\"lime\\\" ><i class=\"fa fa-thumbs-o-up fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"green\",shape:\"dot\",text:\"Good\"});\n //\n} else\n{\n //\n msg = {payload: '<font color =\\\"red\\\"><i class=\"fa fa-thumbs-o-down fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"red\",shape:\"dot\",text:\"Bad\"});\n //\n}\nreturn msg;","outputs":1,"noerr":0,"x":850,"y":1710,"wires":[["f429c430.9e74c8"]]},{"id":"12411f23.b76b29","type":"change","z":"aa48e352.9ad2f8","name":"set","rules":[{"t":"set","p":"payload","pt":"msg","to":"ALLOW","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"GATE","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":1670,"wires":[["4a84ed89.e70fc4"]]},{"id":"fd244975.6c072","type":"change","z":"aa48e352.9ad2f8","name":"set","rules":[{"t":"set","p":"payload","pt":"msg","to":"ALLOW","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"GATE","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":1790,"wires":[["2217f23e.87521e"]]},{"id":"60fa61ee.c6e828","type":"function","z":"aa48e352.9ad2f8","name":"","func":"//node.warn(msg.topic);\nif (msg.payload == false)\n{\n //\n msg = {payload: '<font color=\\\"lime\\\" ><i class=\"fa fa-thumbs-o-up fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"green\",shape:\"dot\",text:\"Good\"});\n //\n} else\n{\n //\n msg = {payload: '<font color =\\\"red\\\"><i class=\"fa fa-thumbs-o-down fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"red\",shape:\"dot\",text:\"Bad\"});\n //\n}\nreturn msg;","outputs":1,"noerr":0,"x":850,"y":1830,"wires":[["d722ce53.9ddf"]]},{"id":"a2996140.40b8b8","type":"change","z":"aa48e352.9ad2f8","name":"set","rules":[{"t":"set","p":"payload","pt":"msg","to":"ALLOW","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"GATE","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":1910,"wires":[["518bc33e.880e8c"]]},{"id":"4da13161.7dad8","type":"function","z":"aa48e352.9ad2f8","name":"","func":"//node.warn(msg.topic);\nif (msg.payload == false)\n{\n //\n msg = {payload: '<font color=\\\"lime\\\" ><i class=\"fa fa-thumbs-o-up fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"green\",shape:\"dot\",text:\"Good\"});\n //\n} else\n{\n //\n msg = {payload: '<font color =\\\"red\\\"><i class=\"fa fa-thumbs-o-down fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"red\",shape:\"dot\",text:\"Bad\"});\n //\n}\nreturn msg;","outputs":1,"noerr":0,"x":850,"y":1950,"wires":[["581efcdc.8a4c5c"]]},{"id":"541088bb.3be5b8","type":"change","z":"aa48e352.9ad2f8","name":"set","rules":[{"t":"set","p":"payload","pt":"msg","to":"ALLOW","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"GATE","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":2030,"wires":[["e95243d.cdf544"]]},{"id":"54905501.00645c","type":"function","z":"aa48e352.9ad2f8","name":"","func":"//node.warn(msg.topic);\nif (msg.payload == false)\n{\n //\n msg = {payload: '<font color=\\\"lime\\\" ><i class=\"fa fa-thumbs-o-up fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"green\",shape:\"dot\",text:\"Good\"});\n //\n} else\n{\n //\n msg = {payload: '<font color =\\\"red\\\"><i class=\"fa fa-thumbs-o-down fa-2x\" style=\"font-size:8px;\"></i></font>',topic: msg.topic};\n node.status({fill:\"red\",shape:\"dot\",text:\"Bad\"});\n //\n}\nreturn msg;","outputs":1,"noerr":0,"x":850,"y":2070,"wires":[["852dc302.35c65"]]},{"id":"d674b951.e35488","type":"debug","z":"aa48e352.9ad2f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":350,"y":1490,"wires":[]},{"id":"f429c430.9e74c8","type":"ui_text","z":"aa48e352.9ad2f8","group":"e53f59db.f595f","order":7,"width":0,"height":0,"name":"Under Voltage Flag","label":"{{msg.topic}}","format":"{{msg.payload}}","layout":"row-spread","x":1050,"y":1710,"wires":[]},{"id":"25863144.93a08e","type":"link in","z":"aa48e352.9ad2f8","name":"","links":["a2497e8.7aaa88"],"x":515,"y":1830,"wires":[["3a7cacd6.e2e6ac","7bc34e05.eb314","12411f23.b76b29","60fa61ee.c6e828","fd244975.6c072","4da13161.7dad8","a2996140.40b8b8","54905501.00645c","541088bb.3be5b8"]]},{"id":"d722ce53.9ddf","type":"ui_text","z":"aa48e352.9ad2f8","group":"e53f59db.f595f","order":8,"width":0,"height":0,"name":"Frequency Cap Flag","label":"{{msg.topic}}","format":"{{msg.payload}}","layout":"row-spread","x":1060,"y":1830,"wires":[]},{"id":"581efcdc.8a4c5c","type":"ui_text","z":"aa48e352.9ad2f8","group":"e53f59db.f595f","order":9,"width":0,"height":0,"name":"Throttled Flag","label":"{{msg.topic}}","format":"{{msg.payload}}","layout":"row-spread","x":1040,"y":1950,"wires":[]},{"id":"852dc302.35c65","type":"ui_text","z":"aa48e352.9ad2f8","group":"e53f59db.f595f","order":10,"width":0,"height":0,"name":"Soft Temp Flag","label":"{{msg.topic}}","format":"{{msg.payload}}","layout":"row-spread","x":1040,"y":2070,"wires":[]},{"id":"3a7cacd6.e2e6ac","type":"debug","z":"aa48e352.9ad2f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":700,"y":2120,"wires":[]},{"id":"e53f59db.f595f","type":"ui_group","z":"","name":"Status","tab":"50f4e688.7d4b7","order":2,"disp":true,"width":"5","collapse":false},{"id":"50f4e688.7d4b7","type":"ui_tab","z":"","name":"Machine health","icon":"fa-heartbeat","order":4,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [7 September 2019 20:23 UTC](https://discourse.nodered.org/t/node-red-contrib-vcgencmd-reset-throttling-statistics/15229/5 "2019-09-07T20:23:50Z")

</div>

> [@BartButenaers](#):
>
> But by reading this [discussion](https://www.raspberrypi.org/forums/viewtopic.php?t=241736) I conclude that you CANNOT reset it?

Found [here](https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=147781&start=75#p1005529) somebody that claims it should be possible, by adding a bitmask parameter to the command:

```auto
vcgencmd get_throttled 0x7

```

I understand this from his explanation:

- There are two persistent values stored in the Raspberry:
  - Value A: Keep track whether the Raspberry has been throttled since reboot.
  - Value B: Keep track whether the Raspberry has been since the bitmask has been used.

- You can get hold of both of these values:
  - Get value A by calling the command without bitmask.
  - Get value B by calling the command with bitmask.

If it works like this, then I think I should implement it in my node like this:

- Add a checkbox in my config screen "_reset throttling status at every measurement_".
- Apply the bitmask when the checkbox is selected.
- Add a warning in my readme file that only a single node-red-contrib-vcgencmd node is allowed to have this option. Indeed there is only 1 value B available in your Raspberry so the nodes would start resetting each others value B ...

Is there anybody that could check whether this theory is valid?  
Not sure how I could 'easily' throttle my Raspberry temporarily to experiment with this.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 September 2019 20:41 UTC](https://discourse.nodered.org/t/node-red-contrib-vcgencmd-reset-throttling-statistics/15229/6 "2019-09-07T20:41:18Z")

</div>

The only "problem" is how to test it works as claimed.

My latest flow gets around that problem.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [7 September 2019 21:16 UTC](https://discourse.nodered.org/t/node-red-contrib-vcgencmd-reset-throttling-statistics/15229/7 "2019-09-07T21:16:05Z")

</div>

> [@BartButenaers](#):
>
> Is there anybody that could check whether this theory is valid?

Mine is currently throttled due to having a temporary HDD attached - lowering the supply voltage.  
How can I help?

![throttled](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f2baeda523df529df3f6a3c6b64cec5ef2dd1356.jpeg)

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [7 September 2019 21:33 UTC](https://discourse.nodered.org/t/node-red-contrib-vcgencmd-reset-throttling-statistics/15229/8 "2019-09-07T21:33:36Z")

</div>

> [@Trying\_to\_learn](#):
>
> The only "problem" is how to test it works as claimed.

Indeed.  
Could use the _cpuburn_ program (as described [here](https://syonyk.blogspot.com/2018/03/raspberry-pi-3-thermal-throttling-analysis-moster-heatsink.html)), but it sounds a bit to desctructive to me 😉

> [@Paul-Reed](#):
>
> How can I help?

Hey Paul,

After reading yet another [discussion](https://www.raspberrypi.org/forums/viewtopic.php?t=241736#p1474660), I think we are heading in the right direction. Seems the two values are called '_ **sticky bits** _':

- value A is called the '_ **permanent** _' sticky bit (= since the last reboot)
- value B is called the '_ **recent** _' sticky bit (= since the last reset)

From that discussion it also seems that you can (based on the value of the extra argument):

- Read AND reset the 'recent' sticky bits.
- Only read the 'recent' sticky bits.

We first need to figure out which extra argument we need to add to trigger those two commands.  
**[EDIT 8/9/2019]** I have submitted my question in that same [discussion](https://www.raspberrypi.org/forums/viewtopic.php?t=241736#p1474660). Hopefully I get an answer soon ...

Afterwards we could try to test it like this:

1. Throttle your system
2. Read the 'recent' sticky bits: this should show that throttling has happened.
3. Reset the 'recent' sticky bits
4. Read the 'recent' sticky bit again: _this shouldn't show anymore that throttling has happened_!!!!
5. Throttle your system again
6. Read the 'recent' sticky bits: this should show again that throttling has happened.

Does this test make sense?

Would be nice if we could use this to implement '_ **reset messages** _' in our node. Then you could determine by yourself during which interval you want to determine whether throttling has occured.

My time is up for today. See you tomorrow guys!

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [8 September 2019 01:00 UTC](https://discourse.nodered.org/t/node-red-contrib-vcgencmd-reset-throttling-statistics/15229/9 "2019-09-08T01:00:59Z")

</div>

I've been doing more work on this _flow_.

I'm a sucker for geeky looking things and so have added another button and changed the layout.

As was the `RBE/ALL` button would either let one different messages through, or ALL.

The `WIPE` button would wipe the visible list.

If you want to see an _uptodate_ list, it is not nice having to toggle the `RBE/ALL` to All then back to RBE when the screen updated.

I added a `LET ONE MESSAGE THROUGH` button. And! It is animated when pressed!  
That is because it can take some time for the flow to get a trigger pulse to run the command.

So it looks like this:

 ![Screenshot%20from%202019-09-08%2010-55-41](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a7337c50c59fe9afd8ed34da59720c046f74aa1c.png)

 ![Screenshot%20from%202019-09-08%2010-55-48](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/46923e85cbae44d6294f55ab30c7d78606e418fd.png)

(Yeah, I know. I gotta get a life.)
