Dahua intercom - API for VTH1550CH?

Antori91

n3wb
Joined
Jan 29, 2020
Messages
28
Reaction score
3
Location
France
I have slightly modified my code (you have to send the channels of the alarm profiles when you arm/disarm remotely the VTH alarm. If not, the alarm channels profiles configuration is reset).
And now it works at 99%. I've this minor issue: when you disarm remotely the VTH, the alarm window of its main screen is immediately updated. Fine ! But when you ARM REMOTELY, the alarm window of its main screen is never updated unless for example you click on this window and leave it by pressing on another window area and then go back to the main menu with the MENU key on its front panel. And now the the alarm window of its screen shows you that the VTH alarm is ARMED and which Alarm profile is armed.
 
Last edited:

riogrande75

Pulling my weight
Joined
Oct 19, 2017
Messages
390
Reaction score
140
Location
AUSTRIA
I guess this should'nt be a big deal: You need kinda display refresh after the changes.

There is an updated script from bashis available, get it.
With this you are able to use dahua's internal debugging functions:
Code:
[*] [Dahua JSON Debug Console 2019,2020 bashis <mcw noemail eu>]
[+] Opening connection to 192.168.1.1 on port 5000: Done
[+] Dahua JSON Console: Success
[+] Login: Success
[+] Started keepAlive thread
[*] Remote device: VTH5221D
[Console]# setDebug
[+] PrintLogLevel 0: True
[+] PrintLogLevel 6: True
[Console]# help
08:06:44|[Manager] [ver:] trace  tid:555 FBCtrl      FaceBoard(M60) Control
08:06:44|[Manager] [ver:] trace  tid:555 ImExport    ImExport handle
08:06:44|[Manager] [ver:] trace  tid:555 NetAddrIPv4   NetAddrIPv4 -h dump NetAddrIPv4 help
08:06:44|[Manager] [ver:] trace  tid:555 Netcheck    Netcheck -h dump Netcheck help
08:06:44|[Manager] [ver:] trace  tid:555 Third       Third operate!
08:06:44|[Manager] [ver:] trace  tid:555 ac          accept call.
08:06:44|[Manager] [ver:] trace  tid:555 alarm       simple alarm trigger.
08:06:44|[Manager] [ver:] trace  tid:555 alarmSensorType   set alarm sensorType
08:06:44|[Manager] [ver:] trace  tid:555 alarmset    set mode.
08:06:44|[Manager] [ver:] trace  tid:555 alr         input alarm record
08:06:44|[Manager] [ver:] trace  tid:555 amr         insert missed records, exp. amr 100.
08:06:44|[Manager] [ver:] trace  tid:555 autoTest    auto test
08:06:44|[Manager] [ver:] trace  tid:555 autoreg     Auto reg service.
08:06:44|[Manager] [ver:] trace  tid:555 bc          begin call.
08:06:44|[Manager] [ver:] trace  tid:555 bitrate     Bit Rate & Frame Info Statistics.
08:06:44|[Manager] [ver:] trace  tid:555 caps        get the encode caps
08:06:44|[Manager] [ver:] trace  tid:555 capsManager   Dahua capability application protocol server.
08:06:44|[Manager] [ver:] trace  tid:555 cfgmgr      something about Config.
08:06:44|[Manager] [ver:] trace  tid:555 cmos        CMOS info!
08:06:44|[Manager] [ver:] trace  tid:555 dg          NDN take times
08:06:44|[Manager] [ver:] trace  tid:555 dhcpv4      dhcpv4 -help
08:06:44|[Manager] [ver:] trace  tid:555 dtmf        send dtmf.
08:06:44|[Manager] [ver:] trace  tid:555 dvrip       Dahua net application protocol server.
08:06:44|[Manager] [ver:] trace  tid:555 ec          end call.
08:06:44|[Manager] [ver:] trace  tid:555 encrypt     Show devices support SSL.
08:06:44|[Manager] [ver:] trace  tid:555 event       Input 'event' show details!
08:06:44|[Manager] [ver:] trace  tid:555 exit        Exit the system!
08:06:44|[Manager] [ver:] trace  tid:555 format      Set encode format, -h for help
08:06:44|[Manager] [ver:] trace  tid:555 fstat       Dump frame stat.
08:06:44|[Manager] [ver:] trace  tid:555 gdprtest    GDPR test
08:06:44|[Manager] [ver:] trace  tid:555 gs          get state.
08:06:44|[Manager] [ver:] trace  tid:555 guiset      Publish test
08:06:44|[Manager] [ver:] trace  tid:555 help        Dump this help message!
08:06:44|[Manager] [ver:] trace  tid:555 language    crypt language info!
08:06:44|[Manager] [ver:] trace  tid:555 lc          begin cycling call.
08:06:44|[Manager] [ver:] trace  tid:555 log         Show log information!
08:06:44|[Manager] [ver:] trace  tid:555 m           test mon.
08:06:44|[Manager] [ver:] trace  tid:555 memory      Dump the memory infomation!
08:06:44|[Manager] [ver:] trace  tid:555 missr       input missed record
08:06:44|[Manager] [ver:] trace  tid:555 naastat     naastat -h
08:06:44|[Manager] [ver:] trace  tid:555 netapp_statemanager   netapp_statemanager -help
08:06:44|[Manager] [ver:] trace  tid:555 o           open pageMain.
08:06:44|[Manager] [ver:] trace  tid:555 od          open door.
08:06:44|[Manager] [ver:] trace  tid:555 packet      Dump packet infomation or packet!
08:06:44|[Manager] [ver:] trace  tid:555 print       Set Print Level!
08:06:44|[Manager] [ver:] trace  tid:555 ps          play sounds.0:phone_call.mp3;1:alarm1.mp3;2:phone_ring1.mp3.
08:06:44|[Manager] [ver:] trace  tid:555 pt          print config:pt filename
08:06:44|[Manager] [ver:] trace  tid:555 ptd         print default config:pt filename
08:06:44|[Manager] [ver:] trace  tid:555 publish     Publish test
08:06:44|[Manager] [ver:] trace  tid:555 quit        Logout myself!
08:06:44|[Manager] [ver:] trace  tid:555 rc          get remote config.
08:06:44|[Manager] [ver:] trace  tid:555 reboot      Reboot the system!
08:06:44|[Manager] [ver:] trace  tid:555 reg         register
08:06:44|[Manager] [ver:] trace  tid:555 res         Dump the CPU usage!
08:06:44|[Manager] [ver:] trace  tid:555 restart     Restart the application!
08:06:44|[Manager] [ver:] trace  tid:555 rh          return home page.
08:06:44|[Manager] [ver:] trace  tid:555 routev4     routev4 -help
08:06:44|[Manager] [ver:] trace  tid:555 routev6     routev6 -help
08:06:44|[Manager] [ver:] trace  tid:555 rpccmd      rpccmd [-help|-h]
08:06:44|[Manager] [ver:] trace  tid:555 sb          stateBar.
08:06:44|[Manager] [ver:] trace  tid:555 screen      print screen!
08:06:44|[Manager] [ver:] trace  tid:555 setReg      set register Config
08:06:44|[Manager] [ver:] trace  tid:555 sf          storage file.
08:06:44|[Manager] [ver:] trace  tid:555 shell       Entering system shell!
08:06:44|[Manager] [ver:] trace  tid:555 shutdown    Shutdown the system!
08:06:44|[Manager] [ver:] trace  tid:555 spi         input spi
08:06:44|[Manager] [ver:] trace  tid:555 ssh         enable ssh
08:06:44|[Manager] [ver:] trace  tid:555 t           test mon config.
08:06:44|[Manager] [ver:] trace  tid:555 talkv       Set talkback Volume, -h for help
08:06:44|[Manager] [ver:] trace  tid:555 tch         touch screen test.eg.tch 10
08:06:44|[Manager] [ver:] trace  tid:555 thread      Dump all thread!
08:06:44|[Manager] [ver:] trace  tid:555 time        Time operating!
08:06:44|[Manager] [ver:] trace  tid:555 timer       Dump all timer!
08:06:44|[Manager] [ver:] trace  tid:555 tm          test monitor:open PageMonitor per second and close a second later.
08:06:44|[Manager] [ver:] trace  tid:555 tracode     set/get tracode
08:06:44|[Manager] [ver:] trace  tid:555 ts          Touch Screen Calibrate.
08:06:44|[Manager] [ver:] trace  tid:555 upan        update announcement
08:06:44|[Manager] [ver:] trace  tid:555 user        Show user information!
08:06:44|[Manager] [ver:] trace  tid:555 userlock    UserLockInfo
08:06:44|[Manager] [ver:] trace  tid:555 vdp_accardrec   call handle
08:06:44|[Manager] [ver:] trace  tid:555 vdp_alarmrecord   call handle
08:06:44|[Manager] [ver:] trace  tid:555 vdp_announce   call handle
08:06:44|[Manager] [ver:] trace  tid:555 vdp_call    call handle
08:06:44|[Manager] [ver:] trace  tid:555 vdp_calllog   calllog handle
08:06:44|[Manager] [ver:] trace  tid:555 vdp_card    card handle
08:06:44|[Manager] [ver:] trace  tid:555 vdp_dbhelper   DBhelper handle
08:06:44|[Manager] [ver:] trace  tid:555 vdp_finger   finger handle
08:06:44|[Manager] [ver:] trace  tid:555 vdp_opendoor   opendoor handle
08:06:44|[Manager] [ver:] trace  tid:555 vdp_password   password handle
08:06:44|[Manager] [ver:] trace  tid:555 vdp_phonebook   phonebook handle
08:06:44|[Manager] [ver:] trace  tid:555 vdp_qrcode   create QRCode
08:06:44|[Manager] [ver:] trace  tid:555 vdp_record   record handle
08:06:44|[Manager] [ver:] trace  tid:555 vdp_registaruserlist   call handle
08:06:44|[Manager] [ver:] trace  tid:555 videotest   Test Video In parameters:
 f: flip
 m: mirror
08:06:44|[Manager] [ver:] trace  tid:555 watchdog    set reset WatchDog Time!
08:06:44|[Manager] [ver:] trace  tid:555 wifi        wifi help
08:06:44|[Manager] [ver:] trace  tid:555 wire        Show ptz information!
08:06:44|[Manager] [ver:] trace  tid:555 write       write data.
08:06:44|[Manager] [ver:] trace  tid:555 -------------------------------------------------------------------
08:06:44|[Manager] [ver:] trace  tid:555 To see details, please use `cmd -h`.
[*] Local cmd:
[+] telnet: Start / Stop (-h for params)
[+] ssh: Start / Stop (-h for params)
[+] config: remote config (-h for params)
[+] service: List remote services and "methods" (-h for params)
[+] device: Dump some information of remote device
[+] certificate: Dump some information of remote certificate
[+] REBOOT: Try force reboot of remote
[+] setDebug: Should start produce output from Console in VTO/VTH
[+] test-config:  New config test (-h for params)
[Console]#
[Console]#
[Console]#
[Console]# quit
08:07:04|[Manager] [ver:] trace  tid:554 CConsole::onQuit quit debug.
[*] All done
You might have success with the command "o open pageMain.". This forces the VTH to jump to main page if you are in any submenu. Could understand that it entails a screen refresh as well. Just give it a try.
With "alarmset" you might even find another way to enable/disable alarms.
 

Antori91

n3wb
Joined
Jan 29, 2020
Messages
28
Reaction score
3
Location
France
It doesn't work with the "o" command (no answer and nothing updated on the VTH screen) ...but...yes it works with the "rh" command for return home page. I have now to implement the DHIP commands sequence in my program to request the VTH to refresh its screen after the alarm changes.
Capture.GIF
 

Antori91

n3wb
Joined
Jan 29, 2020
Messages
28
Reaction score
3
Location
France
Hello RioGrande75,

Could you please tell me what is the purpose of the two args: SID and magic

query_args = {
"SID":self.SID, # SID will be returned after we called <service>.attach with 'Object ID'
"magic":"0x1234",
 

riogrande75

Pulling my weight
Joined
Oct 19, 2017
Messages
390
Reaction score
140
Location
AUSTRIA
As far as I understood this:
"SID" (explained already after hashtag), it's a kind of a session id you get from the device after attaching a service.
"magic" is part of the the protocol, obviously not important what value it has - it just has to be included.
 

Antori91

n3wb
Joined
Jan 29, 2020
Messages
28
Reaction score
3
Location
France
I've updated the code (available on GitHub) which now includes some security management items:
MQTT: Messages to/from other servers signed using MD5 hash.
VTH: No SSL available, but VTH serial number verified at login and Alarm Disarm requests coming from VTH only accepted:
- if the login time is more than an hour old
- and if the notifyConfigChange SID and request number (self.id) are the same as the configManager.attach SID and request number saved values.
 
Last edited:

Antori91

n3wb
Joined
Jan 29, 2020
Messages
28
Reaction score
3
Location
France
Yesterday, it was the Go Live! Below a picture to try to explain how it works.Alarm channel architecture.GIF
 
Top