diff --git a/.gitignore b/.gitignore index 7437e1a..9072866 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ server.crt server.key .vscode +dbuild* +!*/dbuild/DEBIAN/* \ No newline at end of file diff --git a/dbuild.deb b/dbuild.deb deleted file mode 100644 index 3b8badf..0000000 Binary files a/dbuild.deb and /dev/null differ diff --git a/dbuild/etc/systemd/system/watcher.service b/dbuild/etc/systemd/system/watcher.service deleted file mode 100644 index b36abc9..0000000 --- a/dbuild/etc/systemd/system/watcher.service +++ /dev/null @@ -1,14 +0,0 @@ -# Install to /etc/systemd/system/watcher.service -[Unit] -Description=Run watcher -After=network-online.target -Wants=network-online.target systemd-networkd-wait-online.service - -[Service] -Type=exec -ExecStart=/usr/local/bin/watcher --watcher_config /etc/watcher_config.yaml --watcher_name /etc/watcher_name.txt -Restart=on-failure -RestartSec=5s - -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/dbuild/etc/systemd/system/watcher.systemd b/dbuild/etc/systemd/system/watcher.systemd deleted file mode 100644 index 5a2015a..0000000 --- a/dbuild/etc/systemd/system/watcher.systemd +++ /dev/null @@ -1,14 +0,0 @@ -# Install to /etc/systemd/system/watcher.service -[Unit] -Description=Run watcher -After=network-online.target -Wants=network-online.target systemd-networkd-wait-online.service - -[Service] -Type=exec -ExecStart=/usr/local/bin --watcher_config /etc/watcher.yaml -Restart=on-failure -RestartSec=5s - -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/dbuild/etc/watcher_config.yaml b/dbuild/etc/watcher_config.yaml deleted file mode 100644 index 4eadb6a..0000000 --- a/dbuild/etc/watcher_config.yaml +++ /dev/null @@ -1,20 +0,0 @@ -home: Sunnyvale -name: Office -h264: - binary: "/usr/bin/libcamera-vid" - arguments: - - "-n" - - "-t" - - "0" - - "--codec" - - "h264" - - "--mode" - - "1640:1232" - - "--inline" - - "-o" - - "-" -sensor: - binary: "/usr/bin/python3" - arguments: - - "/usr/local/bin/temperature.py" -sensor_rate_ms: 10000 \ No newline at end of file diff --git a/dbuild/usr/local/bin/temperature.py b/dbuild/usr/local/bin/temperature.py deleted file mode 100644 index 27fa4ba..0000000 --- a/dbuild/usr/local/bin/temperature.py +++ /dev/null @@ -1,17 +0,0 @@ -import bme280 -import smbus2 -from time import sleep - -port = 1 -address = 0x77 # Adafruit BME280 address. Other BME280s may be different -bus = smbus2.SMBus(port) - -bme280.load_calibration_params(bus,address) - -while True: - bme280_data = bme280.sample(bus,address) - humidity = bme280_data.humidity - pressure = bme280_data.pressure - ambient_temperature = bme280_data.temperature - print(humidity, pressure, ambient_temperature) - sleep(1) diff --git a/dbuild/usr/local/bin/watcher b/dbuild/usr/local/bin/watcher deleted file mode 100755 index 0481d24..0000000 Binary files a/dbuild/usr/local/bin/watcher and /dev/null differ diff --git a/internal/filewrite/filewrite.go b/internal/filewrite/filewrite.go index 1545f5f..ef429c6 100644 --- a/internal/filewrite/filewrite.go +++ b/internal/filewrite/filewrite.go @@ -36,6 +36,10 @@ func New(video *h264video.Video, cfg *config.Config) (*FileWrite, error) { // Run launches the commands and begins creating data. It will block until Done is called. func (v *FileWrite) Run() { + if v.cfg.LocalCopy == "" { + // Feature is disabled; close right away + return + } // Confirm that the target directory is a directory stat, err := os.Stat(v.cfg.LocalCopy) log := log.With().Str("directory", v.cfg.LocalCopy).Logger() diff --git a/internal/video/video.go b/internal/video/video.go index 1cf05a4..223d330 100644 --- a/internal/video/video.go +++ b/internal/video/video.go @@ -139,6 +139,13 @@ func (v *Video) Join() (<-chan []byte, string, func()) { v.mu.Lock() defer v.mu.Unlock() + // Close the channel + close(v.ivfListeners[myID]) + // Consume any pending frames + for _ := range v.ivfListeners[myID] { + // do nothing + } + delete(v.ivfListeners, myID) } } diff --git a/signaler b/signaler deleted file mode 100755 index d09399a..0000000 Binary files a/signaler and /dev/null differ diff --git a/watcher b/watcher deleted file mode 100755 index ba61757..0000000 Binary files a/watcher and /dev/null differ