Reboot the devices within the app


#1

Hello,

I’m wondering if there is an easy way to reboot the device from the app (nodejs).

Thanks.


#2

Hey @samoud, I think the best way to do it is using resin supervisor api (It’s the agent that runs on the device alongside you application providing most of the resin functionality). Heres an overview of the api & documentation.

From the app on your device you could run:

$ curl -X POST --header "Content-Type:application/json" \
    "$RESIN_SUPERVISOR_ADDRESS/v1/reboot?apikey=$RESIN_SUPERVISOR_API_KEY"

Let me know if that works for you :slight_smile:
Craig


#3

Yeah it’s working !! Thanks @craig !

And if I want to reboot the device but from an external webserver like resin.io dashboard does ?


#4

Hey @samoud, You can do this easily using one of our SDKs. Here is the documentation for the node SDK.