flashair-uploader/README.md

87 lines
2.0 KiB
Markdown
Raw Normal View History

2020-07-16 13:30:51 +00:00
# flashair uploader
## Installation requirements
* systemd (otherwise the timer have to be changed (crond is not able to operate at 7 second intervals)
* python3, python3-pip
`sudo apt install python3-pip`
* libcurl4-openssl-dev libssl-dev
`sudo apt install libcurl4-openssl-dev libssl-dev`
2020-07-16 13:30:51 +00:00
## Setup
Get the code with
`git clone https://code.ungleich.ch/rouxdo/flashair-uploader.git`
2020-07-16 13:30:51 +00:00
Move the `flashairup` directory to the desired place (e.g. `/home/<USER>/`), referred now as WORKDIR
Install the required python packages:
```
#In the WORKDIR
pip install -r requirements.txt
```
### Systemd setup
Change the WORKDIR the `flashairup.systemd` file and
move the altered file with the `flashairup.timer` file to `/etc/systemd/system/`.
The files can be found in the `scripts` directory.
### Configuration and Directory hierarchy
2020-07-16 13:30:51 +00:00
Create the following directory structure inside the WORKDIR:
```
├── flashairup
│   ├── data
│   │   ├── cam1
│   │   │   ├── last.txt
│   │   │   └── pictures
│   │   └── ...
│   ├── flashairup.conf
│   └── ...
└── ...
```
where `cam1` is only an example for the name of a cam.
The `last.txt` is needed for keeping track of the index of the last synchronised pictures.
The `flashairup.conf` should at least contain the `DEFAULT` section:
```
[DEFAULT]
ftp_srv = FTP-SERVER
ftp_path = PATH
ftp_user = USER
ftp_pwd = PASSWORD
db = new
# Set the logger level (DEBUG, INFO, WARNING, ERROR)
log_level = DEBUG
```
Add a cam section to the config file:
```
[cam1] # cam name
ip = CAM-IP
location = LOCATION-OF-THE-PICTURES-ON-CAM
```
Example config:
```
[DEFAULT]
ftp_srv = my.ftp.server.org
ftp_path = media/pictures
ftp_user = ftpuser
ftp_pwd = strongpassword1
db = new
# Set the logger level (DEBUG, INFO, WARNING, ERROR)
log_level = DEBUG
[cam1]
ip = 10.0.0.10
location = DCIM/101NIKON
```