iSpy PTZ PUT doesn't work! Help me!

gianluca

n3wb
Joined
Jul 12, 2018
Messages
3
Reaction score
0
Location
italy
Hello everyone!
is the first time I write in this forum and I hope to be in the right section!
I bought an Onvif Cam and I'm trying to implement the PTZ for this camera not being supported by default.
The code is this:
HTML:
<Camera id="256">
    <Makes>
      <Make Name="HD" Model="IPC" />
    </Makes>
<CommandURL>/PSIA/YG/PTZCtrl/channels/0/</CommandURL>
<Method>PUT</Method>
<Commands>
      <Center></Center>
      <Left>continuous?pan=1&amp;tilt=0</Left>
      <Right>continuous?pan=-1&amp;tilt=0</Right>
      <Up>continuous?pan=0&amp;tilt=1</Up>
      <Down>continuous?pan=0&amp;tilt=-1</Down>
      <Stop>continuous?pan=0&amp;tilt=0</Stop>
      <ZoomIn></ZoomIn>
      <ZoomOut></ZoomOut>
    </Commands>
    <ExtendedCommands>
      <Command Name="Go Preset 1">presets/1/goto</Command>
      <Command Name="Go Preset 2">presets/2/goto</Command>
      <Command Name="Go Preset 3">presets/3/goto</Command>
      <Command Name="Go Preset 4">presets/4/goto</Command>
      <Command Name="Go Preset 5">presets/5/goto</Command>
      <Command Name="Go Preset 6">presets/6/goto</Command>
      <Command Name="Go Preset 7">presets/7/goto</Command>
      <Command Name="Go Preset 7">presets/8/goto</Command>
    </ExtendedCommands>
  </Camera>
It works perfectly when I try to recall a preset but does not work when I try to use the Left Right Up Down commands! I am desperate!
I noticed that the program when it reads the "?" in the code he breaks it by making this request:
HTML:
PUT /PSIA/YG/PTZCtrl/channels/0/continuous HTTP/1.0
User-Agent: Mozilla/5.0
Authorization: Basic YWRtaW46MTIzNDU2
Content-Type: application/x-www-form-urlencoded
Host: 192.168.1.21
Content-Length: 13
Connection: Keep-Alive

pan=-1&tilt=0
But this is what I get instead intercepting with Wireshark the command made by Browser! The first line is broken!
HTML:
PUT /PSIA/YG/PTZCtrl/channels/0/continuous?pan=1&tilt=0 HTTP/1.1
Host: 192.168.1.21
Connection: keep-alive
Content-Length: 0
Cache-Control: max-age=0
Accept: */*
Origin: http://192.168.1.21
X-Requested-With: XMLHttpRequest
If-Modified-Since: 0
Save-Data: on
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
Referer: http://192.168.1.21/doc/page/preview.html?version=0.0.0.1708161600
Accept-Encoding: gzip, deflate
Accept-Language: it,en;q=0.9
Cookie: PackSize=2; updateTips=true; language=en; cur_UserInfo=admin%3A123456; cur_userName=admin; isDisabledSaveBtn=false; plugin=flv
I also tried to replace the "?" with its HTML code but I always get the same result...
Can someone help me? I am going crazy!
 

gianluca

n3wb
Joined
Jul 12, 2018
Messages
3
Reaction score
0
Location
italy
no, unfortunately.
I used a different code that I intercepted with wireshark from another program, but I would prefer to use this type of code which is more convenient for me
can anyone help me?...
 

prenth

n3wb
Joined
Sep 5, 2018
Messages
5
Reaction score
0
Location
italy
no, unfortunately.
I used a different code that I intercepted with wireshark from another program, but I would prefer to use this type of code which is more convenient for me
can anyone help me?...
What's the problem then, can you explain it to me?

Se vuoi in italiano è pure meglio :rofl:
 

gianluca

n3wb
Joined
Jul 12, 2018
Messages
3
Reaction score
0
Location
italy
Che bello! Posso esprimermi molto più facilmente! :lmao:
Dunque ho intercettato con wireshark il codice che il browser invia alla telecamera per muoverla e mi sono ricreato quindi la lista di domandi da utilizzare in iSpy.
Quando vado a richiamare i preset tutto funziona perfettamente, il guaio però è quando devo muoverla manualmente nelle 4 direzioni.
Sempre con wireshark ho notato che iSpy invia alla telecamera un messaggio differente da quello che invece vorrei che inviasse perchè precisamente è come se andasse a "spezzare" il comando quando legge il carattere "?" .
Ho provato anche a sostituire il carattere con il suo codice in HTML ma niente ottengo sempre lo stesso risultato. Potresti aiutarmi? :facepalm:
Nel primo messaggio che ho inviato sperando di essere il più chiaro possibile ho postato sia i comandi che ho dato ad iSpy, ho postato quello che invece viene inviato ed in ultimo ho postato il messaggio che vorrei che inviasse
 

prenth

n3wb
Joined
Sep 5, 2018
Messages
5
Reaction score
0
Location
italy
Che bello! Posso esprimermi molto più facilmente! :lmao:
Dunque ho intercettato con wireshark il codice che il browser invia alla telecamera per muoverla e mi sono ricreato quindi la lista di domandi da utilizzare in iSpy.
Quando vado a richiamare i preset tutto funziona perfettamente, il guaio però è quando devo muoverla manualmente nelle 4 direzioni.
Sempre con wireshark ho notato che iSpy invia alla telecamera un messaggio differente da quello che invece vorrei che inviasse perchè precisamente è come se andasse a "spezzare" il comando quando legge il carattere "?" .
Ho provato anche a sostituire il carattere con il suo codice in HTML ma niente ottengo sempre lo stesso risultato. Potresti aiutarmi? :facepalm:
Nel primo messaggio che ho inviato sperando di essere il più chiaro possibile ho postato sia i comandi che ho dato ad iSpy, ho postato quello che invece viene inviato ed in ultimo ho postato il messaggio che vorrei che inviasse
Si ho capito perfettamente il problema ma non credo di saperti aiutare. Spulciando tra i vari preset di iSpy ho notato che quasi tutti contengono il carattere "?" nel codice, per cui mi fa strano questo errore.
L'unica cosa che mi viene da pensare è che non è realmente quello il problema! Mi spiego meglio: ho visto che anche io avevo notato il fatto, motivo per cui ti avevo risposto, ma...poi son riuscito a mandare comandi (senza controllare poi se il ? fosse presente o meno).
Il mio problema era l'utilizzo in iSpy di https (e non http), conseguente porta 443 e la corretta configurazione di username e pwd per la camera.
Purtoppo ora per riprova ho verificato con Wireshark ma giustamente la trasmissione è criptata e non posso verificare l'url spedito.
Ho una telecamera diversa dalla tua, forse necessita di configurazioni diverse.
Il mio unico indizio è ricontrollare altri parametri perchè forse (e dico forse) quel ? è fuorviante, e si tratta piuttosto di una visualizzazione in Wireshark (o un fatto di Payload).
 
Top