https://github.com/henkelmax/copystation
Turns your Raspberry PI or PC into a copy station.
https://github.com/henkelmax/copystation
linux node-js nodejs raspberry-pi raspberrypi raspbian usb windows
Last synced: 3 months ago
JSON representation
Turns your Raspberry PI or PC into a copy station.
- Host: GitHub
- URL: https://github.com/henkelmax/copystation
- Owner: henkelmax
- Created: 2020-08-15T18:52:40.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-12T04:49:32.000Z (about 5 years ago)
- Last Synced: 2025-01-06T04:13:26.928Z (over 1 year ago)
- Topics: linux, node-js, nodejs, raspberry-pi, raspberrypi, raspbian, usb, windows
- Language: JavaScript
- Homepage:
- Size: 178 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# USB Copy Station  
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](https://www.raspberrypi.org/documentation/usage/gpio/) pins.
## Prerequisites
### For Windows
Download and install [Node.js](https://nodejs.org/).
Download and install [Yarn](https://classic.yarnpkg.com/en/docs/install/).
Install the Windows-Build-Tools:
``` cmd
npm install --global --production windows-build-tools
```
In the project directory run:
``` cmd
yarn install
```
### For Linux
Install Node.js and Yarn:
```sh
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:
``` sh
sudo apt-get install -y ntfs-3g
```
In the project directory run:
``` cmd
yarn install
```
## Usage
``` sh
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
``` sh
node index.js --path "./data" --folder-name "data"
node index.js -p "./data" -f "data"
```
### Running with [nodemon](https://www.npmjs.com/package/nodemon)
``` sh
yarn dev --path "./data" --folder-name "data"
```
## Autostart with systemd
Create a file `/etc/systemd/system/usb-copy.service`
``` 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
```
``` sh
sudo systemctl daemon-reload
sudo systemctl enable usb-copy
sudo systemctl start usb-copy
```