Add debug message for push server fails

This commit is contained in:
QuantumEntangledAndy committed 2023-09-26 21:14:30 +07:00
1 parent 4a010b5095
commit 0fc0455111
3 files changed
+59 -5

No files matched your search

+2 -3
View File
@@ -50,9 +50,8 @@ jobs:
Add-Content -Path $env:GITHUB_ENV -Value "GSTREAMER_1_0_ROOT_MSVC_X86_64=$env:GSTREAMER_1_0_ROOT_MSVC_X86_64"
Add-Content -Path $env:GITHUB_PATH -Value "$env:GSTREAMER_1_0_ROOT_MSVC_X86_64\bin"
Add-Content -Path $env:GITHUB_PATH -Value "%GSTREAMER_1_0_ROOT_MSVC_X86_64%\bin"
dir "C:\Program Files\"
dir "C:\Program Files\OpenSSL-Win64"
Add-Content -Path $env:GITHUB_ENV -Value "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64"
$env:OPENSSL_DIR=$env:SYSTEMDRIVE + '\Program Files\OpenSSL-Win64\'
Add-Content -Path $env:GITHUB_ENV -Value "OPENSSL_DIR=$env:OPENSSL_DIR"
- if: runner.os == 'macOS'
name: Install Gstreamer on macOS
run: |
+49 -1
View File
@@ -62,9 +62,16 @@ sudo apt install \
gstreamer1.0-x \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad
gstreamer1.0-plugins-bad \
libssl
```
- **Windows**: You may also need to
[install openssl](https://wiki.openssl.org/index.php/Binaries)
- **Macos**: You may also need to
[install openssl](https://wiki.openssl.org/index.php/Binaries) or `brew install openssl@1.1`
- **Ubuntu/Debian**: Install the `libssl` package
Make a config file see below.
## Config/Usage
@@ -375,6 +382,47 @@ Then start the rtsp server as usual:
./neolink rtsp --config=neolink.toml
```
### Idle Disconnects
To really save battery we need to disconnect the camera when it is idle.
To acheieve this you can add `idle_disconnect = true` to the `[[cameras]]`
section
```toml
bind = "0.0.0.0"
[[cameras]]
name = "Camera01"
username = "admin"
password = "password"
uid = "ABCDEF0123456789"
idle_disconnect = true
[cameras.pause]
on_client = true # Should pause when no rtsp client
timeout = 2.1 # How long to wait after motion stops before pausing
```
When `idle_disconnect = true` neolink will disconnect from the camera 30s
after it stops being used.
Neolink considers it as being used if there is an active stream running, or
if there is motion being detected or an mqtt command being run
You can make neolink stop active streams when there are no rtsp clients using
```toml
[cameras.pause]
on_client = true # Should pause when no rtsp client
```
Once in the disconnected state. Neolink will stay disconnected until there is a
new requested activation such as a client connecting or an mqtt command
Neolink will also wake up on push notifications from the camera. These are usually
sent by the camera on motion or PIR alarms. To disable this you can set
`push_notifications = false` in the `[[cameras]]` config
### Docker
[Docker](https://hub.docker.com/r/quantumentangledandy/neolink) builds are also
+8 -1
View File
@@ -279,7 +279,14 @@ impl NeoCam {
let r = tokio::select! {
// This thread handles the push notfications
v = async {
while push_notifier.run(&mut pn_request_rx).await.is_err() {}
while {
if let Err(e) = push_notifier.run(&mut pn_request_rx).await {
log::debug!("Push notification failed restarting: {:?}", e);
true
} else {
false
}
}{}
AnyResult::Ok(())
} => v,
// Push notification permits