Open pops106 opened 2 years ago
You can set a preset (save it in the config file) with this syntax:
cgi-bin/preset.sh?action=set_preset&num=1&name=Path
You can go to a preset with this syntax
cgi-bin/preset.sh?action=go_preset&num=1
Check the wiki.
Thanks for the info but when I try with curl command , everything seems to work but the camera does not change his position to the preset requested. Here is the log :
command used : curl -v --user "mylogin:mypassword" http://192.168.X.XXX/cgi-bin/preset.sh?action=go_preset&num=0
` [1] 3335303
GET /cgi-bin/preset.sh?action=go_preset HTTP/1.1 Host: 192.168.X.XXX Authorization: Basic XXXXXXXXXX User-Agent: curl/7.85.0 Accept: /
`
Did you try it with a browser? Does it work without auth?
When I try with a browser I need to authenticate with basic auth login/password and then I get an "error" page too with :
{ "error": "false" }
But camera is well moving to the position I have asked.
I have not tried without authentication, I'm going to try to disable it and try again, is it possible to remove login password? Don't see anything in wiki that telling it's possible
{ "error": "false" }
Sorry for the misunderstanding but this output means "no errors".
You can remove the authentication in the webgui:
http://IP-CAM/?page=configurations
("Sorry for the misunderstanding but this output means "no errors"." => got it ! ) In fact the field are not filled but when I try to connect with browser I get a popup to insert login password. I have tried to put a new login/password then to empty fill and save configuration and reboot camera but nothing has changed , when I enter curl command in console a get error and camera does not move. Maybe there's something wrong with credentials :/, leave fields empty does not seem to remove authentification
Try to clear the cache of the browser.
If it doesn't work, enter with a ssh client and check the config file
sonoff-hack/etc/system.conf
My bad, I have changed the login password for MQTT instead of configuration page :-( Now i have reset login/password to blank and I can connect with my browser on admin web page without credential but when I launch the curl command I get again the error : ` curl -v http://192.168.x.xxx/cgi-bin/preset.sh?action=go_preset&num=1 [1] 3695339
GET /cgi-bin/preset.sh?action=go_preset HTTP/1.1 Host: 192.168.x.xxx User-Agent: curl/7.85.0 Accept: /
This is weird cause there's no issue when I launch curl for moving axis with ptz url like : curl -v http://192.168.x.xxx/cgi-bin/ptz.sh?dir=down
GET /cgi-bin/ptz.sh?dir=down HTTP/1.1 Host: 192.168.x.xxx User-Agent: curl/7.85.0 Accept: /
Here is the /etc/system.conf
HTTPD=yes TELNETD=no SSHD=yes FTPD=no BUSYBOX_FTPD=no DISABLE_CLOUD=yes MQTT=yes SNAPSHOT=yes ONVIF=yes ONVIF_WSDD=yes ONVIF_PROFILE=both ONVIF_NETIF=ra0 NTPD=yes NTP_SERVER=pool.ntp.org RTSP_PORT=554 ONVIF_PORT=1000 HTTPD_PORT=80 USERNAME= PASSWORD= FREE_SPACE=0 FTP_UPLOAD=no FTP_HOST= FTP_DIR= FTP_DIR_TREE=no FTP_USERNAME= FTP_PASSWORD= FTP_FILE_DELETE_AFTER_UPLOAD=yes SSH_PASSWORD= TIMEZONE= SWAP_FILE=no PTZ_PRESET_BOOT=0 CRONTAB= SNAPSHOT_VIDEO=yes SYSLOGD=yes
Thanks for your help
Try double quote around the url.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello ! I have just tried with double quote and it's working fine!
` curl -v "http://192.168.x.xxx/cgi-bin/ptz.sh?dir=right"
GET /cgi-bin/ptz.sh?dir=right HTTP/1.1 Host: 192.168.x.xxx User-Agent: curl/8.2.1 Accept: /
Thanks a lot for your help !
Is there a way I can set a PTZ location preset via a curl command.
For example if one of my other cameras detects motion, front door for example I can set an automation to send a curl command to the sonoff to set it to a certain preset to watch the path down the side of the house.