IP Camera Images / Onvif

Hi there,

I am using @BartButenaers Onvif nodes to read my security cameras... Well trying to anyway... I have run out of brains to get a couple of basic things working... Any help would be appreciated!!

I can see the cameras from my node red, I can process alarm conditions, get parameters etc so I know I am on the right track.

Using the "Image Preview" node, I can trigger a read of a camera and view a snapshot in the dashboard when an event occurs.. All good..

Here is where my grey matter runs out of steam.. I would like to view that image on a dashboard and send it via telegram to a monitoring station simultaneously...

My telegram notifications and bots are set up correctly and able to send text notifications and are working fine...

I am just lacking the know how as to getting the image to the dash/telegram...

TIA
Ed

PS Bart.... FANTASTIC nodes you have developed there... Thank you!!

Brainwave!!

Found a way to send the buffered data as a telegram pic....

next: Display on dashboard...

2 Likes

It would be nice if you shared your solution so others could benefit from it.

Which one? And are you happy with an .img or are you looking for how to do streaming rtsp to the dashboard?

BTW we are missing Bart, haven't seen him here for a long time now

1 Like

Haven't got a full solution yet... Struggling a bit...

Just need to display the triggered image as a jpg etc... Nothing fancy...

Check this out: Displaying images on dashboard 2.0

Right... A measurable modicum of success...

This is what I have done/found out based on @BartButenaers Onvif utilities:

1 Use onvif-events node to start and stop monitoring of a single/multiple camera(s)
2 Use onvif-events node to monitor changes on the active camera(s) and use the output of this node to trigger a response.
3 I am using this trigger to read a snapshot from the camera using the onvif-media node.
4 this is then fed into:
5Screenshot_20251024_104030

6 Multiple cameras point to this little string, giving me snaps of motion detection as they come up...

I am not interested at this stage to have live video streams, as the camera subsystem is hooked to an NVR to cater for that side...

This is a reasonably low horsepower and bandwidth utility to just highlight places of interest on my security system at a glance...

Right....Sooooo.....

After about 2 days of additional looking and refining.... Collapse.... @#$%@#$

At random, triggering one or more of the events modes, setting them to "listen" causes a fault and node-red restarts...

I have not modified anything to do with the configuration of the nodes or the like, it has been purely a tidy up and layout with the laying out of the dashboards etc...

I'm stumped...

What I have done to try and track the cause:
Disabled all but one if the events nodes and redeployed - It causes a restart of NR..

Disabled that node and enabled another events node... Same result...

Updated all palette nodes to the latest versions... Same result...

Updated Node-Red to the latest version (Was4.00) .... Same result

Upgraded SDcard on the pi, mirror backup from 16 to 32gb card, expanded file system, ....same result

Accidentally destroyed original sdcard(16gb) with what I suspect was an ESD during handling...Mutter mutter mutter....

I have now officially run out of grey matter to diagnose further, having dropped into full idiot mode and not remembering how to interrogate/find a log to actually see what the source of the problem actually is...

Any help would be appreciated...

TIA
Ed

Edit:
1 - Is there any (easy) way from within the Node-Red flow environment to view the runtime log or to view log warnings (Info)?

2 - If I have a node ID, how do I locate that node on my flows?
ie: [smooth:d4c91b6e.760f4] Not a number: NaN

Please post the logs of this occurring. It will include a stack stage that will tell us why

Note: "Lack of Knowledge Alert" - Is this the syslog file under /var/log/?

TIA
Ed

The log node-red outputs to console.

How did you install node-red? If via the official script, then running node-red-log will reveal logs.

Also, Search the forum (asked and answered many many times)

ctrl-f or the spy glass on the footer below editor, then enter the node id

Thanks for the help so far Steve... I am not doing so well at the moment and tend to be losing the plot quite often.. Please be patient with me...(Just found out again about the backticks...)

This is what I spotted using node-red-log:

26 Oct 11:30:31 - [error] [onvif-media:Media] Cannot read properties of null (reading 'action')
[red] Uncaught Exception:
26 Oct 11:30:31 - [error] TypeError: Cannot read properties of null (reading 'action')
    at exports.handleResult (/home/pi/.node-red/node_modules/node-red-contrib-onvif-nodes/utils.js:70:20)
    at Cam.<anonymous> (/home/pi/.node-red/node_modules/node-red-contrib-onvif-nodes/onvif_media.js:236:39)
    at Cam.<anonymous> (/home/pi/.node-red/node_modules/onvif/lib/media.js:1127:15)
    at parseSOAPString (/home/pi/.node-red/node_modules/onvif/lib/utils.js:108:3)
    at IncomingMessage.<anonymous> (/home/pi/.node-red/node_modules/onvif/lib/cam.js:246:4)
    at IncomingMessage.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Consumed 2min 47.504s CPU time.
nodered.service: Scheduled restart job, restart counter is at 7.
Stopped Node-RED graphical event wiring tool.
nodered.service: Consumed 2min 47.504s CPU time.
Started Node-RED graphical event wiring tool.

Tnx again...
Ed

@Steve-Mcl

Thank you Soooo Much!!

The reload of Bart's Onvif Nodes helped and now things aren't crashing!!

Any idea as to how this could have happened or as to its cause?

And (hopefully) finally, I would like to share this flow so that others can benefit from it, if I highlight all the nodes and export, would the control nodes (with the confidential data such as user/passwords) be exported as well, or just the highlighted nodes as such?

is also going to make life easier... I've only been using NR about 3, 4, maybe 5 years now....And never noticed it....Duhhhhh

yep...been there, done that, forgot how to do it....Thanks again!

Contrary to what it might seem... I actually do search the forum... Get Lost, Lose the Plot, Search again, wash, rinse repeat...Get up, lose my glasses, find my coffee cup, have coffee....Then wonder what I was doing in the first place...(Couldn't have been anything at the pc, I don't have my glasses on....Lol...)

TIA
Ed

It all depends on how the node was created. But it is simple enough to check your export JSON before posting (and sanitise if necessary)

Sorry, No.

No worries. It was more to state "the 'how to get logs' is definitely in the forum" (i.e. keep looking, you'll find it)

Ok.....After a LOT of testing... A LOT of refining.... And a LOT of chasing errors.....

I am getting a crash/restart of Node-Red after a random amount of time.... As far as I can track, it is ONVIF related as seen in the syslog... The crash occurs anything between a few minutes and a few hours of runtime... Possibly due to a camera going offline and the ONVIF routines/libs not being able to handle it...

Here is an excerpt from my syslog file...

Oct 28 17:00:37 InvPi2 Node-RED[6528]: [red] Uncaught Exception:
Oct 28 17:00:37 InvPi2 Node-RED[6528]: 28 Oct 17:00:37 - [error] TypeError: callback.call is not a function
Oct 28 17:00:37 InvPi2 Node-RED[6528]:     at Cam.<anonymous> (/home/pi/.node-red/node_modules/onvif/lib/events.js:309:14)
Oct 28 17:00:37 InvPi2 Node-RED[6528]:     at ClientRequest.<anonymous> (/home/pi/.node-red/node_modules/onvif/lib/cam.js:328:4)
Oct 28 17:00:37 InvPi2 Node-RED[6528]:     at ClientRequest.emit (node:events:517:28)
Oct 28 17:00:37 InvPi2 Node-RED[6528]:     at Socket.socketOnEnd (node:_http_client:525:9)
Oct 28 17:00:37 InvPi2 Node-RED[6528]:     at Socket.emit (node:events:529:35)
Oct 28 17:00:37 InvPi2 Node-RED[6528]:     at endReadableNT (node:internal/streams/readable:1400:12)
Oct 28 17:00:37 InvPi2 Node-RED[6528]:     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Oct 28 17:00:38 InvPi2 systemd[1]: nodered.service: Main process exited, code=exited, status=1/FAILURE
Oct 28 17:00:38 InvPi2 systemd[1]: nodered.service: Failed with result 'exit-code'.
Oct 28 17:00:38 InvPi2 systemd[1]: nodered.service: Consumed 5h 59min 27.942s CPU time.
Oct 28 17:00:58 InvPi2 systemd[1]: nodered.service: Scheduled restart job, restart counter is at 7.
Oct 28 17:00:58 InvPi2 systemd[1]: Stopped Node-RED graphical event wiring tool.
Oct 28 17:00:58 InvPi2 systemd[1]: nodered.service: Consumed 5h 59min 27.942s CPU time.
Oct 28 17:00:58 InvPi2 systemd[1]: Started Node-RED graphical event wiring tool.

I have now disabled the flow handling the direct access to the IP cameras to see if there is any further crashing...

Regds
ed