Hi all
I’m trying to get a camera to take pictures whilst my door is open - the camera points right at it.
My camera can be triggered with a request to username:[email protected]:8080/0/action/snapshot (It’s a webcam, plugged into my router running Motion)
I can navigate to that address (with the right credentials!) from a browser, and I see a .jpg file pop up into my router’s shared storage. All good. However trying to write that into a while loop doesn’t work so well.
(note - nicely, WebCoRE has swapped the URL containing my password with webcore.co - not sure why, but in reality I’ve got that 196.168.0.1 address in there)
I want it to start taking 2-second interval pictures all the time the door is open. What I see in the logs is
9/11/2017, 3:19:12 PM +652ms
+1ms ╔Received event [Front Door].contact = closed with a delay of 593ms
+102ms ║RunTime Analysis CS > 16ms > PS > 28ms > PE > 60ms > CE
+112ms ║Runtime (35274 bytes) successfully initialized in 28ms (v0.2.0e7.20170906) (109ms)
+113ms ║╔Execution stage started
+130ms ║║Comparison (enum) closed is (string) open = false (2ms)
+132ms ║║Cancelling condition #5’s schedules…
+133ms ║║Condition #5 evaluated false (10ms)
+134ms ║║Cancelling condition #1’s schedules…
+135ms ║║Condition group #1 evaluated false (state changed) (12ms)
+138ms ║╚Execution stage complete. (26ms)
+148ms ╚Event processed successfully (148ms)
9/11/2017, 3:18:57 PM +691ms
+2ms ╔Received event [Front Door].contact = open with a delay of 748ms
+158ms ║RunTime Analysis CS > 26ms > PS > 41ms > PE > 91ms > CE
+166ms ║Runtime (35276 bytes) successfully initialized in 41ms (v0.2.0e7.20170906) (163ms)
+167ms ║╔Execution stage started
+186ms ║║Comparison (enum) open is (string) open = true (3ms)
+188ms ║║Cancelling condition #5’s schedules…
+189ms ║║Condition #5 evaluated true (11ms)
+191ms ║║Cancelling condition #1’s schedules…
+192ms ║║Condition group #1 evaluated true (state changed) (14ms)
+195ms ║║Cancelling statement #2’s schedules…
+206ms ║║Sending internal web request to: [MY USERNAME&PASSWORD]@192.168.0.1:8080/0/action/snapshot
+209ms ║║Executed virtual command httpRequest (4ms)
+210ms ║║Requesting a wake up for Mon, Sep 11 2017 @ 3:19:17 PM BST (in 20.0s)
+218ms ║╚Execution stage complete. (51ms)
+220ms ║Setting up scheduled job for Mon, Sep 11 2017 @ 3:19:17 PM BST (in 19.992s)
+241ms ╚Event processed successfully (241ms)
No snapshots are taken, and it only seems to run once even though I had the door open for 20 seconds or so.