alexbn71/AgentDVR-Telegram

need help

Closed this issue · 16 comments

Hi,
I'm trying to use your telegram_sendphoto.sh but I think it miss somethink to work.

What are APIUSER and APIPWD? Credentials used to connect to the web interface?
How can I consult logs from CURL command ?
Thanks in advance

Hi,
take a look at this page: https://www.ispyconnect.com/userguide-agent-api.aspx

image

let me know if you need more help

Capture d’écran 2023-09-01 à 13 43 48 Capture d’écran 2023-09-01 à 13 44 03 Ok, the auth problem is solved but the manual alert do nothing... no telegram notification and "grabs" folder empty... However the script seem to work when I start it in the container, exept the jpg file into "grabs" is empty probably because the two parameters ({ID} '{MSG}') are missing. The result is an error from telegram api `error_code":400,"description":"Bad Request: file must be non-empty`. So I guess my action configuration in agent dvr is bad but I don't understant why ...

I need to know your Commands folder path (the container path):

image

I think you have to update this path...
image

in the HOST : /home/xxx/docker/agent-dvr/Commands
in container : /AgentDVR/Commands

in the HOST : /home/xxx/docker/agent-dvr/Commands in container : /AgentDVR/Commands

Ok check the path in the script... and do the necessary changes

I think I alrealy change the path.

Capture d’écran 2023-09-01 à 18 01 10

I think I alrealy change the path.

Capture d’écran 2023-09-01 à 18 01 10

Test the URL in your browser... ie in my case: http://mininas-2:8090/grab.jpg?oid=13&size=1280x720&maintainAR=true

remember to replace "${AGENTDVRURL}" and ${ID} variables and check the port, in my case 8090

the browser should show a frame of your cam

After being prompted for my credentials it work.

Hum... after making lots of tests (changing folders rights, restarting my docker, rebuilt the action from begining) I finaly receve pictures (of the begining of the recording) on telegram without text... I don't know what unblocked the situation... I continue to investigate about the missing text and the useless picture.

Why "useless picture"?

Useless because the event who trigger the script is always missing from the picture... I think because I configure somewhere (don't know where)a pre alert recording.

I noticed that on "Manual Alert" the MSG variable is set to "Manual Alert" (and telegram receive a picture with text) but on motion detect AgentDVR does not set MSG

on my old telegram notifications the image was received with "Alert" text (on motion detect). It seems that something changed recently

I noticed that there is a new variable implemented by AgentDVR {BASE64IMAGE}. For this reason I have changed the script... now it does't needs API access and the image sent is exactly the one captured by AgentDVR event. You could try this new version

NB: Remember to update the Task Parameters to {ID} '{MSG}' {BASE64IMAGE}

The script seem to work with the manual alert, the resolution is low but suffisiant to figure what's going on. I'll try tomorow to see if it capture the alert event. Thank's a lot for the improvement.

With {BASE64IMAGE} solution is AgentDVR that set the resolution. The old solution that uses AgentDVR API was setting the resolution to 1280x720

Everything seem to work fine now, thank you for helping.