summaryrefslogtreecommitdiff
path: root/README.md
blob: a31bc8c3d6c34c204ab0dca555c8a8d8798d2cd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133


# birdscan

A software to take beautiful pictures of birds with a Raspberry Pi Camera.

The complete system consists of two machines:

1. The _Raspberry Pi_ with a Raspberry Pi Camera
2. A _file server_ which stores the pictures

The Raspberry Pi runs a web server as the main user interface. With this
interface the user can take pictures manually. Afterwards the pictures are
transferred via SSH to the file server.

**Current State**: Please do not try to use this software if you are not
willing to invest time on your own for development. Some things are currently
in a not acceptable state for production use:

- Software depends on Python 3.9
- Changes on the camera interface from the Raspberry Pi Foundation found there
  way into Arch Linux ARM and break this software. The new camera interface is
  not used in this software.
- The documentation is far from optimal
- There is no current release which targets production


## Expected Environment / Target Platform

This software is written for Arch Linux. Nevertheless it should run on any
systemd-based Linux distribution (e.g. Raspberry Pi OS).


## Installation

These installation steps are necessary to get the software working:

1. Install the birdscan software on the Raspberry Pi
2. Allow the `birdscan` user to access the target folder on the file server via
   SSH
3. Configure the birdscan software on the Raspberry Pi
4. Install a script for file transfer
5. Start and enable services

All these steps are covered in the following sections.

### Install the birdscan Software

Installation is currently just supported for Arch Linux.

#### Arch Linux

Install and configure birdscan in these few steps on an Arch Linux system:

```
# create directory for Arch Build System
mkdir -p ~/ABS  # create a directory for the arch build system
cd ~/ABS

# install picamera dependency from AUR (Arch User Repository)
git clone https://aur.archlinux.org/python-picamera.git  # download picamera
                                                         # from AUR
cd picamera
makepkg -si  # build and install picamera dependency

# clone, compile and install birdscan
cd ../
git clone https://src.xengineering.eu/xengineering/birdscan.git
cd birdscan
make -C archlinux all      # builds the Arch package in the archlinux subfolder
make -C archlinux install  # installs the Arch package
```

### SSH and File Server Setup

`TODO`: This section needs more details ...

Some notes:
```
ssh-keygen -y -f ~/.ssh/id_rsa  # generates and prints public key of this
                                # private one
sudo mkdir /srv/birdscan
sudo chown -R birdscan:birdscan /srv/birdscan
sudo chmod -R 700 /srv/birdscan
sudo setfacl -m u:myuser:rwx /srv/birdscan
# add host key of fileserver:
sudo ssh-keyscan -t rsa <fileserver_ip_or_host> >> /etc/ssh/ssh_known_hosts
```

### birdscan Configuration

Just edit the configuration file like this:

```
sudo nano /etc/birdscan/config.json
```

Note: If the software is already running and you edited the configuration file,
you will have to restarte the software like this:

```
sudo systemctl restart birdscan
```

### Install a Script for File Transfer

`FIXME`: Document or automate this step

There is some stuff in the `./tmp` folder ...

### Start and enable Services

Just start and enable the birdscan software with this command:

```
sudo systemctl enable --now birdscan
```


## Usage

Just open your web browser at `http://<raspberry_pi_ip>:<specified_port>`
(e.g. `http://192.168.1.78:8080`).


## Debugging

If something does not work, you are welcome to read the detailed log messages
like this:

```
journalctl -fu birdscan  # -f enables a live log view
```