Halting/Restarting a device programmatically

In your package service you can now also halt the Pi, not only reboot it. Halting is of course dangerous as it requires a power cycle before the device is operational again.

Right now this feature needs the bleeding version of the hosted OS. You can install that by running

$ syncercmd system switch_bleeding

on your device. Never run such a device in production though as the bleeding channel is the one that is in constant development and might break. It’s fine for testing new features on your local development Pi.

The hosted.py SDK file has been updated as well and there is now a new call to halt the device:

from hosted import device
device.halt_until_powercycled()