Very cool project, man. One of the best I've seen for these devices.
I was able to login but I got an error after login, in response to claimVideoStream:
Failed: { Ret: 103,
SessionID: '0x00000AAA',
ErrorMessage: 'Illegal request' }
I'm noticing the packets node_dvripclient generates are slightly different from the ActiveX client.
Namely, I'm seeing that _sessionID is being set like "0x00000AAA" in node_dvripclient and in the packets generated by the ActiveX client it would be something like "0xAAA"
The ActiveX app does it like this:
0000 54 2b 57 14 0e d9 98 ee cb 55 5b 1c 08 00 45 00 T+W......U[...E.
0010 00 fd 20 4b 40 00 80 06 55 61 c0 a8 01 78 c0 a8 .. [email protected]..
0020 01 86 10 da 87 07 16 20 f3 ef 6d 1d 4a ab 50 18 ....... ..m.J.P.
0030 c8 00 6a 91 00 00 ff 00 00 00 4e 02 00 00 00 00 ..j.......N.....
0040 00 00 00 00 85 05 c1 00 00 00 7b 20 22 4e 61 6d ..........{ "Nam
0050 65 22 20 3a 20 22 4f 50 4d 6f 6e 69 74 6f 72 22 e" : "OPMonitor"
0060 2c 20 22 4f 50 4d 6f 6e 69 74 6f 72 22 20 3a 20 , "OPMonitor" :
0070 7b 20 22 41 63 74 69 6f 6e 22 20 3a 20 22 43 6c { "Action" : "Cl
0080 61 69 6d 22 2c 20 22 50 61 72 61 6d 65 74 65 72 aim", "Parameter
0090 22 20 3a 20 7b 20 22 43 68 61 6e 6e 65 6c 22 20 " : { "Channel"
00a0 3a 20 30 2c 20 22 43 6f 6d 62 69 6e 4d 6f 64 65 : 0, "CombinMode
00b0 22 20 3a 20 22 43 4f 4e 4e 45 43 54 5f 41 4c 4c " : "CONNECT_ALL
00c0 22 2c 20 22 53 74 72 65 61 6d 54 79 70 65 22 20 ", "StreamType"
00d0 3a 20 22 4d 61 69 6e 22 2c 20 22 54 72 61 6e 73 : "Main", "Trans
00e0 4d 6f 64 65 22 20 3a 20 22 54 43 50 22 20 7d 20 Mode" : "TCP" }
00f0 7d 2c 20 22 53 65 73 73 69 6f 6e 49 44 22 20 3a }, "SessionID" :
0100 20 22 30 78 41 41 41 22 20 7d 0a "0xAAA" }.
node_dvripclient does it like this:
0000 54 2b 57 14 0e d9 98 ee cb 55 5b 1c 08 00 45 00 T+W......U[...E.
0010 00 e4 31 78 40 00 80 06 44 4d c0 a8 01 78 c0 a8 [email protected]..
0020 01 86 10 be 87 07 00 3c c0 6e f9 ab a5 10 50 18 .......<.n....P.
0030 08 05 d9 da 00 00 ff 00 00 02 4a 00 00 00 00 00 ..........J.....
0040 00 00 00 00 85 05 a8 00 00 00 7b 22 4e 61 6d 65 ..........{"Name
0050 22 3a 22 4f 50 4d 6f 6e 69 74 6f 72 22 2c 22 4f ":"OPMonitor","O
0060 50 4d 6f 6e 69 74 6f 72 22 3a 7b 22 41 63 74 69 PMonitor":{"Acti
0070 6f 6e 22 3a 22 43 6c 61 69 6d 22 2c 22 50 61 72 on":"Claim","Par
0080 61 6d 65 74 65 72 22 3a 7b 22 43 68 61 6e 6e 65 ameter":{"Channe
0090 6c 22 3a 30 2c 22 43 6f 6d 62 69 6e 4d 6f 64 65 l":0,"CombinMode
00a0 22 3a 22 43 4f 4e 4e 45 43 54 5f 41 4c 4c 22 2c ":"CONNECT_ALL",
00b0 22 53 74 72 65 61 6d 54 79 70 65 22 3a 22 4d 61 "StreamType":"Ma
00c0 69 6e 22 2c 22 54 72 61 6e 73 4d 6f 64 65 22 3a in","TransMode":
00d0 22 54 43 50 22 7d 7d 2c 22 53 65 73 73 69 6f 6e "TCP"}},"Session
00e0 49 64 22 3a 22 30 78 30 30 30 30 30 41 41 41 22 Id":"0x00000AAA"
00f0 7d 0a }.
I'm wondering if maybe it's the SessionId that the server software wants to be shaped like 0x24A instead of 0x0000024A
Either that or some of those mysterious bytes up there before the JSON.
UPDATE: In the error response from the server, the third digit from the right of the SessionID looks like it was omitted. Still looking like it's something to do with the SessionId.