I want to restart my raspberry pi 3 model B remotely. I am running Android Things OS on RPi. Can anyone tell how can I do this?
Asked
Active
Viewed 61 times
0
-
[Powering off Android Things](https://stackoverflow.com/q/41503899/3290339). Basically, the command is `adb shell reboot`. – Onik Jan 14 '20 at 12:03
-
Yes. But how can I use this remotely using Android things? – sugandha sharma Jan 14 '20 at 12:11
1 Answers
0
You will need to create your own remote service provider to send commands through the device such as Firebase Cloud Messaging. Then, you can use the DeviceManager API on Android Things with the reboot method.
DeviceManager deviceManager = DeviceManager.getInstance();
deviceManager.reboot();
Make sure you set the permission in your manifest too.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androidthings.updatemanagersample">
<uses-permission android:name="com.google.android.things.permission.REBOOT" />
<application android:label="@string/app_name">
</application>
</manifest>

Nick Felker
- 11,536
- 1
- 21
- 35
-
Will this work remotely? If yes then how will I identify that which one RPI has to be restarted. I mean how will I recognise? – sugandha sharma Jan 15 '20 at 08:42
-
This is what your app will need to run. You will have to figure out device registration and management for yourself. – Nick Felker Jan 15 '20 at 15:38