Auto reboot PTZIP762X20IR

jmburton2001

Getting the hang of it
Joined
Aug 16, 2015
Messages
98
Reaction score
40
I have a PTZIP762X20IR that loses focus every few days/weeks and the only way to fix it is to manually reboot it. Not even the "focus" controls will fix it. After a reboot it's perfect again.

I've looked through all the configuration settings for an "auto-reboot" option but there doesn't seem to be one. Is there a way to send a reboot command to the camera through Windows task scheduler?
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
736
Reaction score
230
Location
Croatia,Zagreb
Well its easier to write a mini app as a windows service than to mess with task scheduler, after all you would need script for task scheduler anyway

.net app with backgroundservice every 24h ISAPI reboot request

Downside: pc must be running at that time. Either with task scheduler or any script executing
 

jmburton2001

Getting the hang of it
Joined
Aug 16, 2015
Messages
98
Reaction score
40
I guess the question should have been... Is there a command I can send to the camera to force a reboot? If I knew the command and protocol I could probably muddle through creating some way to inject it.

Computer runs 24/7/365.
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
736
Reaction score
230
Location
Croatia,Zagreb
Digest authorization PUT request at http://ipaddress:httpport/ISAPI/System/reboot


C#:
public class RebootCameraService : BackgroundService
{
    private readonly Timer _timer;
    private readonly string _cameraUrl = "http://ip:port/ISAPI/System/reboot"; / Replace 'ip' and 'port' with actual values

    public RebootCameraService()
    {
        / Initialize timer
        _timer = new Timer(DoWork, null, Timeout.Infinite, Timeout.Infinite);
    }

    protected override Task ExecuteAsync(CancellationToken stoppingToken)
    {
        / Start the timer immediately and then repeat every 24 hours
        _timer.Change(TimeSpan.Zero, TimeSpan.FromDays(1));

        return Task.CompletedTask;
    }

    private async void DoWork(object state)
    {
        var request = new HttpRequestMessage(HttpMethod.Put, _cameraUrl);

        / Set credentials for Digest Authentication
        var credentials = new NetworkCredential("username", "password"); / Replace with actual credentials
        var cache = new CredentialCache();
        cache.Add(new Uri(_cameraUrl), "Digest", credentials);

        var handler = new HttpClientHandler { Credentials = cache };
        using (var client = new HttpClient(handler))
        {
            try
            {
                var response = await client.SendAsync(request);
                / Log response or handle it accordingly
            }
            catch (Exception ex)
            {
                / Handle exceptions
            }
        }
    }

    public override async Task StopAsync(CancellationToken stoppingToken)
    {
        _timer?.Change(Timeout.Infinite, 0);
        await base.StopAsync(stoppingToken);
    }
}
 
Last edited:
Top