updated the README

This commit is contained in:
Dominique Roux 2020-07-23 14:49:39 +02:00
parent df623f5d75
commit 40ccaf627c

View file

@ -19,16 +19,22 @@ Move the `flashairup` directory to the desired place (e.g. `/home/<USER>/`), ref
Install the required python packages:
```
#In the WORKDIR
cd 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/`.
Change in the WORKDIR the `flashairup.systemd` file and
move the file to `/etc/systemd/system/`.
Move the `flashairup.timer` file to the same location.
The files can be found in the `scripts` directory.
After move the files to the correct directories, enable the timer with the following statement:
```
sudo systemctl enable --now flashairup.timer
```
### Configuration and Directory hierarchy
@ -47,6 +53,7 @@ Create the following directory structure inside the WORKDIR:
```
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.
If the card gets formatted, the counter in this file needs to be reset as well.
The `flashairup.conf` should at least contain the `DEFAULT` section:
```
@ -76,6 +83,7 @@ Example config:
ftp_path = media/pictures
ftp_user = ftpuser
ftp_pwd = strongpassword1
# Decide if the pictures are going to be uploaded in the new db or in the old db
db = new
# Set the logger level (DEBUG, INFO, WARNING, ERROR)
log_level = DEBUG
@ -84,3 +92,32 @@ Example config:
ip = 10.0.0.10
location = DCIM/101NIKON
```
## Troubleshooting
### FlashAir SD-Card is not connecting to the WLAN
First, there may be a configuration error, check the [FlashAir Configuration](#flashair-configuration) for a correct configuration
Second, the Access Point might run on a channel which is not reachable by the FlashAir card.
Ensure that the configured channel is between 1 and 10.
## Knowledge Base
The configuration on the Flashair cards was taken from [here](https://mattshub.com/blog/2017/04/11/flashair-sd-card)
### Short concept of the python program
Since the Flashair cards create a small webserver on which the pictures are served, one is able to get them via curl.
The python program therefore uses curl to download the pictures.
With another curl command it is possible to get a list of files on the cam.
The program gets this list and compare the number of the last image with the number on the corresponding `last.txt`.
If the number is higher on the Flashair card, the picture gets processed.
By processing, it is meant that the curl command for downloading a file is issued, then the file gets uploaded via FTP
to the remote server and finally the counter in `last.txt` gets updated.
This is important, because if there were some mistakes in the processing, the counter will stay the same and therefore,
the picture is downloaded again in the next run.
The job of each python function and object is documented inside the code