Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DS Cam payload for GetSnapshot #3

Open
hquick81 opened this issue Oct 18, 2017 · 2 comments
Open

DS Cam payload for GetSnapshot #3

hquick81 opened this issue Oct 18, 2017 · 2 comments

Comments

@hquick81
Copy link

Hi,

first of all thx for the work on those DS nodes.

I want to use the DS cam node. I can use some functions but as far as i see it seems that no function is really implemented completely.

For example an HTTP call to

webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&version=8&method=GetSnapshot&_sid=BR7kAgsJL1dX21590MHN921500&cameraId=1

will get the current snapshot of camera 1. But currently when i use the DS Cam module with the GetSnapshot topic regardless of which payload i tried to use, the cameraId parameter is always missing in the HTTP call from node red to the Synology station.

What payload do i have to use for the GetSnapshot topic, that the HTTP call to the Synology station will be enhanced by the cameraId=1 parameter ? Or do I have to add sth. to the source code itself before i can do that ?

The functions with their parameters are described in the following document as well:

https://global.download.synology.com/download/Document/DeveloperGuide/Surveillance_Station_Web_API_v2.0.pdf

Thx and greetings

Holger

@draco2003
Copy link

If i put a json trigger before the DS Cam node with the following settings (your camera id may differ):
{
"cameraId": 10,
"preview": true,
"camStm": 1
}

This successfully requests the snapshot image, but crashes node red (haven't seen an error message anywhere other than server disconnected) since i don't think it knows what to do with the binary reponse from the server.

from tcpdump on the node-red box that makes the request, shows the headers of the synology box sending back the image:

Server: nginx
Date: Sat, 06 Jan 2018 05:46:56 GMT
Content-Type: image/jpeg
Content-Length: 81379
Connection: close
Cache-Control: max-age=2592000
Content-Disposition: inline; filename="snapshot.jpg"

I haven't tried modifying the code of this module yet, but maybe if we can do a base64 encode of the image around here: https://github.com/MattVador/node-red-contrib-syno/blob/master/ds/cam/ds-cam.js#L44
Then we'd be able to embed the string as a datauri in a dashboard template or email, etc..

Any help taking this to the next step would be great.

@MattVador
Copy link
Owner

This package is a node-red wrapper on syno npm package.
I have make a pull request (#40) to correct the behavior when response is anything other than text/plain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants