kerberos-io / web

(DEPRECATED) An open source GUI to configure the machinery and to view events that were detected by the machinery.
https://www.kerberos.io
225 stars 69 forks source link

Web interface doesn't detect machinery #87

Open JanSimek opened 6 years ago

JanSimek commented 6 years ago

I followed the Generic installation path and installed latest Kerberos.io from git. When I go to Web -> Systém panel, it says that machinery is not running but according to systemctl status kerberosio, it is running (I assume kerberosio = machinery). Also, ip camera view on the dashboard is stuck at "Almost there, hold on"

- captures.USBCamera.delay = 500
- captures.USBCamera.deviceNumber = 0
- captures.USBCamera.frameHeight = 480
- captures.USBCamera.frameWidth = 640
- captures.VideoCapture.angle = 0
- captures.VideoCapture.delay = 500
- captures.VideoCapture.frameHeight = 480
- captures.VideoCapture.frameWidth = 640
- captures.VideoCapture.path = 0
- cloud = S3
- clouds.S3.bucket = 
- clouds.S3.folder = 
- clouds.S3.privateKey = 
- clouds.S3.publicKey = 
- condition = Enabled
- conditions.Enabled.active = true
- conditions.Enabled.delay = 5000
- conditions.Time.delay = 10000
- conditions.Time.times = 0:01,23:59-0:01,23:59-0:01,23:59-0:01,23:59-0:01,23:59-0:01,23:59-0:01,23:59
- configuration = /etc/opt/kerberosio/config/config.xml
- expositor = Hull
- expositors.Hull.region = 779,588|781,28|588,48|377,31|208,63|32,45|33,625|191,591|347,600|456,572|556,601|659,629
- expositors.Rectangle.region.x1 = 0
- expositors.Rectangle.region.x2 = 800
- expositors.Rectangle.region.y1 = 0
- expositors.Rectangle.region.y2 = 600
- heuristic = Sequence
- heuristics.Counter.appearance = 3
- heuristics.Counter.markers = 100,100|100,200|200,100|200,200
- heuristics.Counter.maxDistance = 140
- heuristics.Counter.minArea = 200
- heuristics.Counter.minimumChanges = 20
- heuristics.Counter.noMotionDelayTime = 100
- heuristics.Counter.onlyTrueWhenCounted = true
- heuristics.Sequence.minimumChanges = 20
- heuristics.Sequence.minimumDuration = 2
- heuristics.Sequence.noMotionDelayTime = 1000
- io = Video
- ios.Disk.directory = /etc/opt/kerberosio/capture/
- ios.Disk.fileFormat = timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token.jpg
- ios.Disk.markWithTimestamp = false
- ios.Disk.privacy = false
- ios.Disk.timestampColor = white
- ios.GPIO.periodTime = 100000
- ios.GPIO.periods = 1
- ios.GPIO.pin = 17
- ios.Script.path = /etc/opt/kerberosio/scripts/run.sh
- ios.TCPSocket.message = motion-detected
- ios.TCPSocket.port = 1337
- ios.TCPSocket.server = 127.0.0.1
- ios.Video.codec = h264
- ios.Video.directory = /etc/opt/kerberosio/capture/
- ios.Video.enableHardwareEncoding = true
- ios.Video.extension = mp4
- ios.Video.fileFormat = timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token
- ios.Video.fps = 3
- ios.Video.hardwareDirectory = /etc/opt/kerberosio/h264/
- ios.Video.markWithTimestamp = false
- ios.Video.maxDuration = 30
- ios.Video.privacy = false
- ios.Video.recordAfter = 5
- ios.Video.timestampColor = white
- ios.Webhook.url = http://localhost/api/v1/webhook
- logging = false
- name = frontdoor
- stream = Mjpg
- streams.Mjpg.enabled = true
- streams.Mjpg.fps = 15
- streams.Mjpg.password = 
- streams.Mjpg.quality = 75
- streams.Mjpg.streamPort = 8889
- streams.Mjpg.username = 
- timezone = Europe-Prague
28/07/2017 09:12:01.194 INFO  [trivial] Logging is set to info
28/07/2017 09:12:01.195 INFO  [trivial] Stopping streaming
28/07/2017 09:12:01.195 INFO  [trivial] Stream: Succesfully closed streaming
28/07/2017 09:12:01.196 INFO  [trivial] Stopping capture device
28/07/2017 09:12:01.270 INFO  [trivial] Starting capture device: IPCamera
28/07/2017 09:12:07.547 INFO  [trivial] Stream: Configured stream on port 8889 with quality: 75
28/07/2017 09:12:07.548 INFO  [trivial] Stopping cloud service
28/07/2017 09:12:07.552 INFO  [trivial] Starting cloud service: S3
28/07/2017 09:12:07.631 INFO  [trivial] Starting conditions: Enabled
28/07/2017 09:12:07.632 INFO  [trivial] Starting algorithm: DifferentialCollins
28/07/2017 09:12:07.632 INFO  [trivial] Starting expositor: Hull
28/07/2017 09:12:07.700 INFO  [trivial] Starting heuristic: Sequence
28/07/2017 09:12:07.701 INFO  [trivial] Starting io devices: Video
28/07/2017 09:13:27.139 INFO  [trivial] Reading configuration file: /etc/opt/kerberosio/config/config.xml
28/07/2017 09:13:27.143 INFO  [trivial] Final configuration:
- algorithm = DifferentialCollins
- algorithms.BackgroundSubtraction.dilate = 7
- algorithms.BackgroundSubtraction.erode = 5
- algorithms.BackgroundSubtraction.history = 15
- algorithms.BackgroundSubtraction.nmixtures = 5
- algorithms.BackgroundSubtraction.ratio = 1
- algorithms.BackgroundSubtraction.shadows = false
- algorithms.BackgroundSubtraction.threshold = 10
- algorithms.DifferentialCollins.erode = 5
- algorithms.DifferentialCollins.threshold = 15
- capture = IPCamera
- captures.IPCamera.angle = 0
- captures.IPCamera.delay = 500
- captures.IPCamera.frameHeight = 480
- captures.IPCamera.frameWidth = 640
- captures.IPCamera.url = rtsp://admin:12345678A@192.168.1.64
- captures.RaspiCamera.angle = 0
- captures.RaspiCamera.brightness = 50
- captures.RaspiCamera.contrast = 0
- captures.RaspiCamera.delay = 500
- captures.RaspiCamera.frameHeight = 480
- captures.RaspiCamera.frameWidth = 640
- captures.RaspiCamera.framerate = 20
- captures.RaspiCamera.saturation = 0
- captures.RaspiCamera.sharpness = 0
- captures.USBCamera.angle = 0
- captures.USBCamera.delay = 500
- captures.USBCamera.deviceNumber = 0
- captures.USBCamera.frameHeight = 480
- captures.USBCamera.frameWidth = 640
- captures.VideoCapture.angle = 0
- captures.VideoCapture.delay = 500
- captures.VideoCapture.frameHeight = 480
- captures.VideoCapture.frameWidth = 640
- captures.VideoCapture.path = 0
- cloud = S3
- clouds.S3.bucket = 
- clouds.S3.folder = 
- clouds.S3.privateKey = 
- clouds.S3.publicKey = 
- condition = Enabled
- conditions.Enabled.active = true
- conditions.Enabled.delay = 5000
- conditions.Time.delay = 10000
- conditions.Time.times = 0:01,23:59-0:01,23:59-0:01,23:59-0:01,23:59-0:01,23:59-0:01,23:59-0:01,23:59
- configuration = /etc/opt/kerberosio/config/config.xml
- expositor = Hull
- expositors.Hull.region = 875,567|847,501|757,381|612,383|493,386|333,383|297,498|341,613|399,684|565,682|734,701|860,686
- expositors.Rectangle.region.x1 = 0
- expositors.Rectangle.region.x2 = 800
- expositors.Rectangle.region.y1 = 0
- expositors.Rectangle.region.y2 = 600
- heuristic = Sequence
- heuristics.Counter.appearance = 3
- heuristics.Counter.markers = 100,100|100,200|200,100|200,200
- heuristics.Counter.maxDistance = 140
- heuristics.Counter.minArea = 200
- heuristics.Counter.minimumChanges = 20
- heuristics.Counter.noMotionDelayTime = 100
- heuristics.Counter.onlyTrueWhenCounted = true
- heuristics.Sequence.minimumChanges = 20
- heuristics.Sequence.minimumDuration = 2
- heuristics.Sequence.noMotionDelayTime = 1000
- io = Video
- ios.Disk.directory = /etc/opt/kerberosio/capture/
- ios.Disk.fileFormat = timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token.jpg
- ios.Disk.markWithTimestamp = false
- ios.Disk.privacy = false
- ios.Disk.timestampColor = none
- ios.GPIO.periodTime = 100000
- ios.GPIO.periods = 1
- ios.GPIO.pin = 17
- ios.Script.path = /etc/opt/kerberosio/scripts/run.sh
- ios.TCPSocket.message = motion-detected
- ios.TCPSocket.port = 1337
- ios.TCPSocket.server = 127.0.0.1
- ios.Video.codec = h264
- ios.Video.directory = /etc/opt/kerberosio/capture/
- ios.Video.enableHardwareEncoding = true
- ios.Video.extension = mp4
- ios.Video.fileFormat = timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token
- ios.Video.fps = 3
- ios.Video.hardwareDirectory = /etc/opt/kerberosio/h264/
- ios.Video.markWithTimestamp = false
- ios.Video.maxDuration = 30
- ios.Video.privacy = false
- ios.Video.recordAfter = 5
- ios.Video.timestampColor = none
- ios.Webhook.url = http://localhost/api/v1/webhook
- logging = false
- name = frontdoor
- stream = Mjpg
- streams.Mjpg.enabled = true
- streams.Mjpg.fps = 15
- streams.Mjpg.password = 
- streams.Mjpg.quality = 75
- streams.Mjpg.streamPort = 8889
- streams.Mjpg.username = 
- timezone = Europe-Prague
28/07/2017 09:13:27.143 INFO  [trivial] Logging is set to info
28/07/2017 09:13:27.143 INFO  [trivial] Stopping streaming
28/07/2017 09:13:27.144 INFO  [trivial] Stream: Succesfully closed streaming
28/07/2017 09:13:27.144 INFO  [trivial] Stopping capture device
28/07/2017 09:13:27.152 INFO  [trivial] Starting capture device: IPCamera
28/07/2017 09:13:33.426 INFO  [trivial] Stream: Configured stream on port 8889 with quality: 75
28/07/2017 09:13:33.427 INFO  [trivial] Stopping cloud service
28/07/2017 09:13:33.430 INFO  [trivial] Starting cloud service: S3
28/07/2017 09:13:33.489 INFO  [trivial] Starting conditions: Enabled
28/07/2017 09:13:33.489 INFO  [trivial] Starting algorithm: DifferentialCollins
28/07/2017 09:13:33.489 INFO  [trivial] Starting expositor: Hull
28/07/2017 09:13:33.536 INFO  [trivial] Starting heuristic: Sequence
28/07/2017 09:13:33.536 INFO  [trivial] Starting io devices: Video
cedricve commented 6 years ago

Though your configuration looks ok, which browser are you using to open the stream. It might be that the machinery 'online' check fails. Which OS are you using?

JanSimek commented 6 years ago

Kerberos runs on Arch linux. I tried with Edge on Windows 10 and Google Chrome on Android and it does work on Android, so it must be an issue with the browser. Thanks.

cedricve commented 6 years ago

@JanSimek well that's what I'm trying to explain. The check happens in the web, and apparently that's not working on your arch linux install. https://github.com/kerberos-io/web/blob/master/app/Http/Repositories/System/OSSystem.php#L183-L198

JanSimek commented 6 years ago

@cedricve just wondering, wouldn't it be better to use systemctl is-active kerberosio. That should work the same on Raspberry Pi (Raspbian), shouldn't it?

cedricve commented 6 years ago

@JanSimek thanks for the share, hmm yeah I think so. Let me check.

cedricve commented 6 years ago

I'll add a fix so it gives better cross-platform support. Thanks for noticing @JanSimek, will be in next release.

samvdb commented 6 years ago

@cedricve, I also want to note that this method of detecting the machinery is not compatible with any kind of docker orchestration tools like rancher. For this to work i believe the machinery service needs to have its own api running on top to be accessible from, or maybe merge it into 1 docker container :)

shacal commented 6 years ago

I run this in rancher, so no issue in docker orchestration.

version: '2'
volumes:
  kerberosio-service-conf-files:
    external: true
    driver: rancher-nfs
  kerberosio-machinery-conf-files:
    external: true
    driver: rancher-nfs
  kerberosio-machinery-capture-files:
    external: true
    driver: rancher-nfs
  kerberosio-machinery-capture-h264-files:
    external: true
    driver: rancher-nfs
  kerberosio-machinery-log-files:
    external: true
    driver: rancher-nfs
services:
  service:
    image: kerberos/web:v2.4.0
    stdin_open: true
    volumes:
    - kerberosio-service-conf-files:/var/www/web/config
    tty: true
    volumes_from:
    - machinery
    ports:
    - 8180:80/tcp
    labels:
      io.rancher.container.pull_image: always
      io.rancher.scheduler.affinity:host_label: host.name=microesxi
      io.rancher.sidekicks: machinery
  machinery:
    image: kerberos/machinery:v2.4.0
    stdin_open: true
    volumes:
    - kerberosio-machinery-conf-files:/etc/opt/kerberosio/config
    - kerberosio-machinery-log-files:/etc/opt/kerberosio/logs
    - kerberosio-machinery-capture-files:/etc/opt/kerberosio/capture
    - kerberosio-machinery-capture-h264-files:/etc/opt/kerberosio/h264
    tty: true
    labels:
      io.rancher.container.pull_image: always
cedricve commented 6 years ago

Amazing, thanks for sharing @shacal! we should include this in the documentation. Would you be interesting to share a tutorial with us?

mcgyver83 commented 5 years ago

Hi, I'm having the same issue using docker with raspberry pi2

I created the container with sudo docker run --name kerberos_salotto -p 80:9020 -p 8889:9021 -d kerberos/kerberos

And I see in the log 08/02/2019 16:07:05.300 INFO [trivial] Reading configuration file: /etc/opt/kerberosio/config/config.xml 08/02/2019 16:07:05.301 ERROR [trivial] TinyXML : could not open the xml file, maybe the file doesn't exist?

I checked in the container volume and no config.xml file is present

antoweb commented 3 years ago

In docker environment i receive error TinyXML : could not open the xml file, maybe the file doesn't exist? But the file exist and have 777 permission