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.
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
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
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 |
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"
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