Skip to content

This repository contains scripts to set up and manage an Arlo USB storage system on any Raspberry Pi. Original Project by www.github.com/tg9413/arlopi

License

Notifications You must be signed in to change notification settings

VincePuc99/ArloUSB-AnyRPi

Repository files navigation

Arlo USB-RPi Setup

Shell Script Python Visual Studio Code Debian Raspberry Pi

This project provides scripts to set up and manage an Arlo USB storage system on a Raspberry Pi.
The scripts handle tasks such as enabling mass storage (30GB), synchronizing clips, cleaning up old clips and optionally create a service for synchronizing clips with a Telegram Bot.

All clips are stored in /mnt/ArloExposed. You need to access this folder to expose them on your preferred service (GDrive - Samba - Telegram - etc).

⚠️ WARNING ⚠️

Two folders will be created in /mnt - /arlo and /ArloExposed.
To avoid data corruption, DO NOT TOUCH the /arlo one. It's a mount point for sync_clips.sh.

If using Sync with Telegram Bot double check your [api_token] & [chat_id].
The program will not check them for you!

Any other OS's / Distros are untested mainly due to /boot/config.txt position.

Tested on:

What you need

  • A root user account

  • A minimum of 64GB SD card

  • For RPi Zero/Zero2W:

    • Connect the USB cable to the middle port from the RPi (Without the PWR label) to the USB of the station, Arlo base station itself is enough to power the Raspbery Pi.
  • For others RPi's:

    • Connect the USB cable to any USB port of the RPi, you will need an external power source.

Installation

Cloning the Repository

To clone this repository, use the following command:

git clone https://github.com/VincePuc99/ArloUSB-AnyRPi.git

Permissions

cd ArloUSB-AnyRPi
sudo chmod +x *

Optional - Sync with Telegram Bot (python3)

This Python script telegram-sync.py monitors /mnt/ArloExposed/arlo/000000 for new video files and sends them to your Telegram bot. It uses the bot's API token and the chat ID to send the videos.

For using it just add TelYes during the first setup.

If you choose TelNo, the telegram-sync.py file will be automatically deleted.

Prerequisites for Telegram Sync

Usage

sudo ./Arlo-Usb-Start.sh <max_power> <TelYes|TelNo> [api_token] [chat_id]

Where <max_power> is:

  • 500 for Raspberry Pi 4
  • 200 for Raspberry Pi Zero 2
  • 100 for Raspberry Pi Zero

Example for Raspberry Pi 4 with Telegram Sync Enabled:

sudo ./Arlo-Usb-Start.sh 500 TelYes 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11 -zzzzzzzzzz

Example for Raspberry Pi 4 without Telegram Sync:

sudo ./Arlo-Usb-Start.sh 500 TelNo

After running Arlo-Usb-Start.sh, the Raspberry Pi will reboot.
Upon reboot, check the connection to the base in Arlo Secure App.

Documentation

  • Arlo-Usb-Start.sh - This script installs necessary dependencies and runs the other scripts in the correct order. It ensures that the system is properly set up for USB mass storage and clip management. | Main script to start the setup process.

  • cleanup_clips.sh - Cleans up old clips from the storage directory. By default, it removes clips older than 14 days.

  • enable_mass_storage.s - Enables USB mass storage with the specified maximum power.

  • sync_clips.sh - Synchronizes clips from the USB storage to a shared directory. Ensures that the mount point is properly managed to avoid data corruption.

  • arlo_usb_start.log - Will be created on first run inside ArloUSB-AnyRP Main folder. Check it for any issue.

  • telegram-sync.py - (Optional) File service for synchronizing clips from the USB storage to a Telegram Bot.

Dependencies

The scripts require the following packages:

  • git
  • bash
  • findutils
  • util-linux
  • rsync
  • grep
  • coreutils
  • procps
  • kmod
  • python3 (Only For Telegram Sync)

The Arlo-Usb-Start.sh script will automatically check these dependencies if they are not already installed.
However, if the dependencies are not installed, the program will exit resulting in an error in LogFile.

License

This project is licensed under the MIT License.

About

This repository contains scripts to set up and manage an Arlo USB storage system on any Raspberry Pi. Original Project by www.github.com/tg9413/arlopi

Topics

Resources

License

Stars

Watchers

Forks