<commit_before># homebridge-camera-rpi
raspberry pi camera plugin for homebridge

Note: An SD card image is available [here](https://github.com/moritzmhmk/buildroot-camera-rpi/releases).

## Prerequisite

* camera module activated (`raspi-config`)
* module `bcm2835-v4l2` loaded (`sudo modprobe bcm2835-v4l2`)
* ffmpeg installed (`sudo apt install ffmpeg`)

## Installation (as homebridge plugin)

```bash
npm install -g homebridge-camera-rpi
```

edit ``config.json`` and add platform ``rpi-camera``

```json
{
  ...
  "platforms": [
    ...
    {
      "platform": "rpi-camera",
      "cameras": [{"name": "Pi Camera"}]
    }
  ]
}
```

## Installation (standalone)

optionally install in `opt`:

```bash
cd /opt
sudo mkdir homebridge-camera-rpi
sudo chown pi homebridge-camera-rpi
```

install:

```bash
git clone https://github.com/moritzmhmk/homebridge-camera-rpi
cd homebridge-camera-rpi
npm install
```

test:

```bash
node standalone.js
```
<commit_msg>fixes #6<commit_after># homebridge-camera-rpi
raspberry pi camera plugin for homebridge

Note: An SD card image is available [here](https://github.com/moritzmhmk/buildroot-camera-rpi/releases).

## Prerequisite

* camera module activated (`raspi-config`)
* module `bcm2835-v4l2` loaded (`sudo modprobe bcm2835-v4l2`)
* ffmpeg installed (`sudo apt install ffmpeg`)

## Installation (as homebridge plugin)

```bash
npm install -g homebridge-camera-rpi
```

edit ``config.json`` and add platform ``rpi-camera``

```json
{
  ...
  "platforms": [
    ...
    {
      "platform": "rpi-camera",
      "cameras": [{"name": "Pi Camera"}]
    }
  ]
}
```

restart `homebridge`

add extra camera accessory in the home app (the setup code is the same as for homebridge)

## Installation (standalone)

optionally install in `opt`:

```bash
cd /opt
sudo mkdir homebridge-camera-rpi
sudo chown pi homebridge-camera-rpi
```

install:

```bash
git clone https://github.com/moritzmhmk/homebridge-camera-rpi
cd homebridge-camera-rpi
npm install
```

test:

```bash
node standalone.js
```

{'fraction_non_alphanumeric': 0.14926108374384237, 'fraction_numerical': 0.012315270935960592, 'mean_word_length': 4.0648379052369075, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6659427', 'n_tokens_mistral': 775, 'n_tokens_neox': 705, 'n_words': 190}