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 the following file, also creating any directories as needed.
Edit the file with your favourite editor so that it contains the script below:
#!/bin/bash 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/hello_world_script.sh
Create the following file:
Add contents as below:
[section:Hello world] [action:Click to see CA working] do:/home/dataplicity/actions/hello_world/hello_world_script.sh
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
From here you can move onto a more involved example
|Controlling GPIO from Mobile|