GuilhermeC18/node-onvif

400 Bad Request

schw4rzlicht opened this issue · 0 comments

Hey there,

I am currently trying to control PTZ on a Reolink C1 Pro. I am able to control it using ptzMove() but neither services.ptz.gotoPreset() nor services.ptz.absoluteMove() works for me. Both throw Error: 400 Bad Request.

Please have a look at the following sample code:

let camInstance = new Cam.OnvifDevice({
    xaddr: 'http://192.168.0.1:8000/',
    user: 'admin',
    pass: 'administrator'
});

camInstance.init().then(() => {
    let currentProfile = camInstance.getCurrentProfile();
    camInstance.services.ptz.gotoPreset({
        ProfileToken: currentProfile.token,
        PresetToken: 'test',
        Speed: { x: 1, y: 1, z: 1 }
    }).then((result) => {
        console.log(JSON.stringify(result['data'], null, '  '));
    }).catch((error) => {
        console.error(error);
    });
}).catch((error) => {
    console.error(error);
});

The sample above always ends with the following trace:

Error: 400 Bad Request
    at IncomingMessage.<anonymous> (/Users/julian/WebstormProjects/cctv-bridge/node_modules/node-onvif/lib/modules/soap.js:130:16)
    at IncomingMessage.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1183:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

Any hints appreciated!