RPi Cam Web Interface: Turn on and off motion detection using IFTTT Do Buttons

Would you like the ability to turn on and off motion detection on your Rpi Cam Web Interface from your phone with just the press of an IFTTT DO button (rather than logging into the camera’s website)?

An extra bonus on the iPhone is the ability to add DO button to the home screen widget, so it’s really easy to control your camera. Plus it’s not limited to motion detection – anything the pipe commands can do (http://elinux.org/RPi-Cam-Web-Interface#Pipe), the DO button can do too!

  1. Install Dropbox-Uploader
  2. cd ~
    git clone https://github.com/andreafabrizi/Dropbox-Uploader.git
    cd Dropbox-Uploader/
    chmod +x dropbox_uploader.sh
  3. Follow the Dropbox-Uploader instructions:
  4. - Open the following URL in your Browser, and log in using your account: <a class="postlink" href="https://www.dropbox.com/developers/apps">https://www.dropbox.com/developers/apps</a>
    - Click on "Create App", then select "Dropbox API app"
    - Now go on with the configuration, choosing the app permissions and access restrictions to your DropBox folder
    - Enter the "App Name" that you prefer (e.g. MyPiUploader)
    - Now, click on the "Create App" button.
    - When your new App is successfully created, please click on the Generate button
    under the 'Generated access token' section, then copy and paste the new access token here:
    # Access token:
  5. Install Raspi-Runner
    cd ~
    git clone https://github.com/enkydu/Raspi_Runner
    cd Raspi_Runner/
    chmod +x raspi_runner.sh
    What is name of Dropbox folder, for Raspi Runner commands? (i.e. Raspi_Commands): scripts
    what is the full path to your Dropbox Uploader? (i.e. /home/pi/Dropbox_Uploader): /home/pi/Dropbox-Uploader

    Note – ensure the path has Dropbox-Uploader instead of the default Dropbox_Uploader

  7. Create a text file with the following content and copy to scripts folder in your dropbox storage area:
  8. echo 'md 1' > /var/www/html/FIFO
  9. Test by running the command below (it should turn on motion detection – ‘md 0’ will turn off motion)
  10. /home/pi/Raspi_Runner/raspi_runner.sh
  11. Set a schedule in cron:
  12. crontab -e
  13. Paste the following line and save
  14. */2 * * * * /home/pi/Raspi_Runner/raspi_runner.sh > /dev/null 2>&1
  15. Create Do Button (assumes you’ve created an IFTTT account and linked DropBox to it)
    1. Press the Mortar and Pestle button bottom right or find the My Recipes page.
    2. Press the + button
    3. Select Channels
    4. Press Dropbox
    5. Press Create a New Recipe
    6. Press Create a text file
    7. Give your Recipe a
      1. Title, e.g.
      2. Outside On (Motion)
      3. Name, e.g.
      4. File-On 
      5. Content, e.g.
      6. echo 'md 1' > /var/www/html/FIFO
      7. Dropbox folder path, e.g.
      8. scripts
    8. Click Add

    What’s nice about this method is that you can turn off motion detection in the middle of a recording, whereas the website button to turn motion off is greyed out until no more motion is detected.

    Based on this guide here: https://github.com/enkydu/Raspi_Runner