Module Integration Guides
Linux

Receiving Actions

3min

This guide shows you how to receive Actions (Commands) from the Cloud and execute them.

Let us have a look at how to create a "reboot" action that restarts the device.

To do this we need to first register this action with uplink using its configuration file config.toml. If you have followed the guide this file will be present in /usr/local/share/bytebeam folder.

Edit this file to add the line actions=[{name="reboot"}] under [tcpapps.1] section.

config.toml


Restart the uplink using the following commands

Shell




Create a new action type called "Reboot" by following the Creating new Action Types guide:

Document image


The reboot action should now be visible on the device management page.

Document image


Do not trigger the action yet. We need to first integrate the action into our application. Below you can find a sample application code for receiving actions.



demo.py
demo.js
demo.rs
demo.go


Once your app has been modified and is running, you can go to Bytebeam Cloud and click on the Reboot action button to trigger the action. Next, you will see the following message

Document image


Click on Yes. Next, on the action panel, you can monitor the status of your last triggered action

Document image


After completion of an action, the Action Status changes to Completed, and you should see your device reboot

Document image