1

I am trying to see the best way to restart the Raspberry PI from Cumulocity, out of the box using PI agent.

This is a use case where the CPU temperature of PI goes up, Cumulocity will trigger a restart. So far the work I have done does the following

  1. Send measurements from PI via MQTT (python paho client). I can see them show up in Cumulocity
  2. Using Shell options in cumulocity UI, I send a manual a manual restart message
  3. Subscribe the restart message in python client and then issue a restart to PI

To summarize I would like to how to read the measurements received in Cumulocity and if it reaches above a certain value, trigger an automatic restart of the PI device. That is skip steps b and c above and make it automatic.

Thanks for your help, JM

1 Answer 1

3

If you see the measurement in the data point explorer, select "Create Smart Rule" and either "On measurement threshold create alarm" or "On measurement explicit threshold create alarm". Configure the threshold and the alarm type.

When you see the alarm, click on it and again select "Create Smart Rule", using "On alarm execute operation". The template has already restart in it, so you can just click OK.

You can do the same directly by clicking on "Smart Rules", but then you have to enter the measurement names and alarm types manually.

Sign up to request clarification or add additional context in comments.

1 Comment

I think that you have to handle this rule from your agent and after that you can execute script(bash script) - stackoverflow.com/questions/13707519/… to restart your Rasberry

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.