Skip to content

Turns your Raspberry PI or PC into a copy station.

Notifications You must be signed in to change notification settings

henkelmax/copystation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

USB Copy Station GitHub issues GitHub release (latest by date)

Turns your Raspberry PI into a copy station.

This also works for Windows and Linux, but the status LEDs will only work with the Raspberry PIs GPIO pins.

Prerequisites

For Windows

Download and install Node.js.

Download and install Yarn.

Install the Windows-Build-Tools:

npm install --global --production windows-build-tools

In the project directory run:

yarn install

For Linux

Install Node.js and Yarn:

sudo apt-get update -y

sudo apt-get install -y curl software-properties-common

curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -

sudo apt-get install -y nodejs npm

sudo npm install --global yarn

For NTFS support run:

sudo apt-get install -y ntfs-3g

In the project directory run:

yarn install

Usage

node index.js [-h] [-p PATH] [-f FOLDER_NAME]
Argument Description Default
-h, --help Show help and exit. -
-p PATH, --path PATH The path to the files that are getting copied ./data/
-f FOLDER_NAME, --folder-name FOLDER_NAME The name of the folder that the files are copied to data
-s PIN, --success-led-pin PIN The pin ID of the success LED 17
-P PIN, --progress-led-pin PIN The pin ID of the progress LED 27
-e PIN, --error-led-pin PIN The pin ID of the error LED 18

Examples

node index.js --path "./data" --folder-name "data"

node index.js -p "./data" -f "data"

Running with nodemon

yarn dev --path "./data" --folder-name "data"

Autostart with systemd

Create a file /etc/systemd/system/usb-copy.service

[Unit]
Description=USB Copy
After=network.target

[Service]
User=root
Environment=
WorkingDirectory=/usb-copy/
ExecStart=/usr/bin/node index.js --path "./data" --folder-name "data"

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable usb-copy
sudo systemctl start usb-copy