Dataplicity Developer Hub

Dataplicity Documentation

Here you'll find announcements for new features and comprehensive guides to help you integrate Dataplicity into your Raspberry Pi projects.

Get Started    

Hello world

In this example we'll show a simple Custom Action that creates a file when a button on the interface is pressed. The objective of this example is to be able to quickly set up a Custom action and see it working.

Create a custom script file

Create the following file, also creating any directories as needed. /home/dataplicity/actions/hello_world/

Edit the file with your favourite editor so that it contains the script below:


touch ~/custom_actions_are_working

echo "[[[ReturnOK]]]"

Save the file and then make sure it has permissions as shown:

chmod 755 /home/dataplicity/actions/hello_world/

Create custom action config file

Create the following file: /home/dataplicity/dataplicity.actions.conf.

Add contents as below:

[section:Hello world]

[action:Click to see CA working]

Save the file and exit.

Now when you click on your custom action it will create ~/custom_actions_are_working file in your home directory. This way we know custom actions are working.

Updated about a year ago

What's Next

From here you can move onto a more involved example

Controlling GPIO from Mobile

Hello world

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.