Skip to content

Commit

Permalink
Fix typo and grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
eiryu committed Jun 7, 2022
1 parent 0198998 commit eb8563a
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions RASPBIAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ e2fsck -f /dev/sda2
resize2fs -M /dev/sda2
#> The filesystem on /dev/sda2 is now 504923 (4k) blocks long.
# Remember the block size (4k) and count (504923)
# Now shrink the parition to 504923 * 4k = 2019692k
# Now shrink the partition to 504923 * 4k = 2019692k
# https://askubuntu.com/questions/780284/shrinking-ext4-partition-on-command-line
fdisk /dev/sda
# 1. Delete partition 2
Expand All @@ -119,7 +119,7 @@ d
# - same START sector
# - new END sector +2019692K (note '+' and uppercase 'K')
n
# 3. Check parition table
# 3. Check partition table
p
# 3. Commit changes
w
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Once the command finishes, your camera can be added to HomeKit.
## Multistream

Normally in HomeKit a camera stream can only be viewed by one device at a time.
If a second device wants to to view the stream, the Apple Home app shows
If a second device wants to view the stream, the Apple Home app shows

> **Camera Not Available**
> Wait until someone else in this home stops viewing this camera and try again.
Expand Down Expand Up @@ -189,7 +189,7 @@ The web interface shows the recent snapshot and lets you install updates.

## Raspberry Pi Zero W

I do get kernel panics when running hkcam with a ELP 1080P USB camera.
I do get kernel panics when running hkcam with an ELP 1080P USB camera.
Updating `/boot/config.txt` with the following changes resolve those kernel panics.

```
Expand All @@ -203,19 +203,19 @@ arm_freq_min=700
<img alt="Desk mount" src="_img/enclosure-desk.jpg?raw=true" width="320" />
<img alt="Wall mount" src="_img/enclosure-wall.jpg?raw=true" width="320" />

I've also designed an enclsoure for the Raspberry Pi Zero W and standard camera module.
I've also designed an enclosure for the Raspberry Pi Zero W and standard camera module.
You can use a stand to put the camera on a desk, or combine it with brackets of the [Articulating Raspberry Pi Camera Mount](https://www.prusaprinters.org/prints/3407-articulating-raspberry-pi-camera-mount-for-prusa-m) to mount it on a wall.
The 3D-printed parts are available as STL files [here](https://github.com/brutella/hkcam/tree/master/enclosure).

This enclosure is not waterproof and should not be used outside. Instead you should use an [ELP 1080P camera](https://de.aliexpress.com/item/4000562253329.html) and connect it via USB to a Raspberry Pi.
This enclosure is not waterproof and should not be used outside. Instead, you should use an [ELP 1080P camera](https://de.aliexpress.com/item/4000562253329.html) and connect it via USB to a Raspberry Pi.

<!-- #### Pre-configured Raspbian Image
You can use a pre-configured Raspbian Stretch Lite image, where everything is already configured.
You only need to
1. download the pre-configured Raspbian image and copy onto an sd card; [download](https://github.com/brutella/hkcam/releases/download/v0.0.9/raspbian-stretch-lite-2019-04-08-hkcam-v0.0.9-armv6.img.zip)
1. download the pre-configured Raspbian image and copy onto a sd card; [download](https://github.com/brutella/hkcam/releases/download/v0.0.9/raspbian-stretch-lite-2019-04-08-hkcam-v0.0.9-armv6.img.zip)
- **Note**: This image only works on a Raspberry Pi Zero
Expand All @@ -239,7 +239,7 @@ You only need to
> sudo dd bs=1m if=~/Downloads/raspbian-stretch-lite-2019-04-08-hkcam-v0.0.9-armv6.img of=/dev/rdisk3 conv=sync
> ```
3. add your WiFi credentials so that the Raspberry Pi can connect to your WiFi
3. add your Wi-Fi credentials so that the Raspberry Pi can connect to your Wi-Fi
- create a new text file at `/Volumes/boot/wpa_supplicant.conf` with the following content
```sh
Expand All @@ -251,7 +251,7 @@ ssid="<ssid>"
psk="<password>"
}
```
- replace `<ssid>` with the name of your WiFi, and `<password>` with the WiFi password.
- replace `<ssid>` with the name of your Wi-Fi, and `<password>` with the Wi-Fi password.
4. insert the sd card into your Raspberry Pi and power it up.
(After a reboot it may take up to several minutes until the camera is accessible via HomeKit – see [issue #136](https://github.com/brutella/hap/issues/136).)
Expand Down Expand Up @@ -313,7 +313,7 @@ After the playbook finishes, the RPi is ready to be used as a HomeKit camera.
**Additional Steps**
- I recommend to change the password of the `pi` user, once you have configured your Raspberry Pi.
- If you want to have multiple cameras on your network, you have to make sure that the hostnames are unqiue. By default the hostname of the Raspberry Pi is `raspberrypi.local`.
- If you want to have multiple cameras on your network, you have to make sure that the hostnames are unique. By default, the hostname of the Raspberry Pi is `raspberrypi.local`.
- SSH is enabled in the hkcam image. You may want to disable it.
**Debugging**
Expand All @@ -331,7 +331,7 @@ You can use a stand to put the camera on a desk, or combine it with brackets of
The 3D-printed parts are available as STL files [here](https://github.com/brutella/hkcam/tree/master/enclosure).
# Advanced Configuration
The application can be further configured using flags in the startup script. These can lead to a misconfigured system and shoud be used at your own caution.
The application can be further configured using flags in the startup script. These can lead to a misconfigured system and should be used at your own caution.
These settings can be changed in the startup script ```/etc/sv/hkcam/run```.
Expand All @@ -345,11 +345,11 @@ exec hkcam --data_dir=/var/lib/hkcam/data --verbose=true
| Flag | Default value | Description |
|--------- | -------------- | ----------------- |
| min_video_bitrate | ```0``` | minimum video bit rate in kbps|
| multi_stream | ```false``` | "Allow mutliple clients to view the stream simultaneously|
| multi_stream | ```false``` | "Allow multiple clients to view the stream simultaneously|
| data_dir | ```"Camera"``` | Path to data directory|
| verbose | ```true```| Verbose logging|
| pin | ```"00102003"``` | PIN for HomeKit pairing |
| port | ```""``` | Port on which transport is reachable, random portif empty |
| port | ```""``` | Port on which transport is reachable, random port if empty |
## Network
`hkcam` uses bonjour for service discovery. The port used for this ```5353```.
Expand Down
2 changes: 1 addition & 1 deletion SNAPSHOTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can then access them via HomeKit.
## Why?

Taking snapshots is an essential feature of any security camera.
For example you want to take a snapshot once motion is detected in room.
For example, you want to take a snapshot once motion is detected in room.
But there are currently no IP cameras which support that via HomeKit.

`hkcam` implements *Persistent Snapshots* with custom HomeKit characteristics.
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/runit/README
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ Options
exec 2>&1
exec telegraf --config /etc/telegraf/telegraf.conf

- finish_script (shell script) – The script which is excuted when the run script finishes.
- finish_script (shell script) – The script which is executed when the run script finishes.
- log_dir (string) – Path to the log directory, e.g. `/var/log/{service_name}`
2 changes: 1 addition & 1 deletion api/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// WriteJSON responds to request r by encoding and sending v as json.
// If v is an instance of of an ErrResponse, the response status code is 400 (Bad Request).
// If v is an instance of an ErrResponse, the response status code is 400 (Bad Request).
func WriteJSON(w http.ResponseWriter, r *http.Request, v interface{}) error {
switch v.(type) {
case *ErrResponse, ErrResponse:
Expand Down
2 changes: 1 addition & 1 deletion camera_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
const TypeCameraControl = "19BDAD9E-6102-48D5-B413-3F11253706AE"

// RefDate represents the reference date used to generate asset ids.
// Short ids are prefered and therefore we use 1st April 2019 as the reference date.
// Short ids are preferred and therefore we use 1st April 2019 as the reference date.
var RefDate = time.Date(2019, 4, 1, 0, 0, 0, 0, time.UTC)

type CameraControl struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/hkcam/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func main() {
}

var minVideoBitrate *int = flag.Int("min_video_bitrate", 0, "minimum video bit rate in kbps")
var multiStream *bool = flag.Bool("multi_stream", false, "Allow mutliple clients to view the stream simultaneously")
var multiStream *bool = flag.Bool("multi_stream", false, "Allow multiple clients to view the stream simultaneously")
var dataDir *string = flag.String("data_dir", "db", "Path to data directory")
var verbose *bool = flag.Bool("verbose", false, "Verbose logging")
var pin *string = flag.String("pin", "00102003", "PIN for HomeKit pairing")
Expand Down
6 changes: 3 additions & 3 deletions ffmpeg/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Debugging

ffmpeg can be used to debug SRTP streaming by using ffmpeg and ffplay.
ffmpeg can be used to debug RTSP streaming by using ffmpeg and ffplay.
Install ffmpeg and ffplay via `brew install ffmpeg --with-ffplay`.

## RTSP Streaming
Expand Down Expand Up @@ -39,11 +39,11 @@ ffplay -i <path-to-sdp-file> -protocol_whitelist file,udp,rtp

## Bitrate

FFMPEG cannot set the bitrate on Rasbperry Pi, we have to do it manually with `v4l2-ctl --set-ctrl video_bitrate=300000`.
ffmpeg cannot set the bitrate on Raspberry Pi, we have to do it manually with `v4l2-ctl --set-ctrl video_bitrate=300000`.

## Streaming issues

ffmpeg only sends one H264 keyframe at the beginning of a RTP stream on the RPi because of https://video.stackexchange.com/a/21245
If we open the stream after it has been started using ffplay, we missed the keyframe and never get one – results in error: decode_slice_header error.

Therefore we have to start ffplay before starting streaming.
Therefore, we have to start ffplay before starting streaming.
4 changes: 2 additions & 2 deletions ffmpeg/ffmpeg.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (f *ffmpeg) Stop(id StreamID) {
if f.loop != nil {
for _, s := range f.streams {
if s.isActive() {
log.Debug.Printf("Active sesssions %v\n", f.streams)
log.Debug.Printf("Active sessions %v\n", f.streams)
return
}
}
Expand Down Expand Up @@ -187,7 +187,7 @@ func (f *ffmpeg) Snapshot(width, height uint) (*Snapshot, error) {
if f.loop != nil {
for _, s := range f.streams {
if s.isActive() {
log.Debug.Printf("Active sesssions %v\n", f.streams)
log.Debug.Printf("Active sessions %v\n", f.streams)
return shot, err
}
}
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/loopback.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// This is needed to provide simultaneous access to a v4l2 device.
// On a Raspberry Pi you can create a video loopback device at /dev/video1 via [v4l2loopback](https://github.com/umlaeute/v4l2loopback).
// The data from /dev/video0 is then copied to /dev/video1 via `ffmpeg -f v4l2 -i /dev/video0 -codec:v copy -f v4l2 /dev/video1`.
// The loopback device can then be access simultanously from multiple ffmpeg processes.
// The loopback device can then be access simultaneously from multiple ffmpeg processes.
type loopback struct {
inputDevice string
inputFilename string
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func audioSamplingRate(param rtp.AudioParameters) string {
case rtp.AudioCodecSampleRate24Khz:
return "24k"
default:
log.Info.Println("audioSamplingRate() undefined samplrate", param.CodecParams.Samplerate)
log.Info.Println("audioSamplingRate() undefined samplerate", param.CodecParams.Samplerate)
break
}

Expand Down
12 changes: 6 additions & 6 deletions html/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import (
"net/http"
)

type UdpdatePage struct {
type UpdatePage struct {
Page
}

// CheckForUpdate downloads the latest release and stores it as an db.Update in the database.
// CheckForUpdate downloads the latest release and stores it as a db.Update in the database.
// The user is then redirected to the previous page.
// If no update was found, a message is shown to the user that no updates are available.
func (h *Html) CheckForUpdate(w http.ResponseWriter, r *http.Request) {
p := UdpdatePage{}
p := UpdatePage{}
p.UpdateWithRequest(r, h)

selfupdate.EnableLog()
Expand All @@ -37,7 +37,7 @@ func (h *Html) CheckForUpdate(w http.ResponseWriter, r *http.Request) {

// InstallLatestVersion installs the latest release no matter of the current build version
func (h *Html) InstallLatestVersion(w http.ResponseWriter, r *http.Request) {
p := UdpdatePage{}
p := UpdatePage{}
p.UpdateWithRequest(r, h)

url := p.Referrer
Expand All @@ -61,9 +61,9 @@ func (h *Html) InstallLatestVersion(w http.ResponseWriter, r *http.Request) {
}

// InstallUpdate installs the latest release, if an update is already store din the database.
// If no update is stored in the database or an install process currently running, this method does nothing.
// If no update is stored in the database or an installation process currently running, this method does nothing.
func (h *Html) InstallUpdate(w http.ResponseWriter, r *http.Request) {
p := UdpdatePage{}
p := UpdatePage{}
p.UpdateWithRequest(r, h)
if u := p.Update; u != nil {
switch u.State {
Expand Down
4 changes: 2 additions & 2 deletions setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func setupStreamManagement(m *service.CameraRTPStreamManagement, ff ffmpeg.FFMPE
case rtp.SessionControlCommandTypeStart:
ff.Start(id, cfg.Video, cfg.Audio)
if !multiStream {
// If only one video stream is suppported, set the status to busy.
// If only one video stream is supported, set the status to busy.
// This way HomeKit knows that nobody is allowed to connect anymore.
// If multiple streams are supported, the status is always availabe.
// If multiple streams are supported, the status is always available.
setTLV8Payload(m.StreamingStatus.Bytes, rtp.StreamingStatus{rtp.StreamingStatusBusy})
}
case rtp.SessionControlCommandTypeSuspend:
Expand Down
2 changes: 1 addition & 1 deletion take_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const TypeTakeSnapshot = "E8AEE54F-6E4B-46D8-85B2-FECE188FDB08"

// TakeSnapshot is used to take a snapshot.
// After writing `true` to this characteristic,
// a snapshot is taked and persisted on disk.
// a snapshot is taken and persisted on disk.
type TakeSnapshot struct {
*characteristic.Bool
}
Expand Down

0 comments on commit eb8563a

Please sign in to comment.