Closed rogro82 closed 3 years ago
Awesome, do you want to open a pull request for your updated: buildIntStringCommandPayload
method? Or should I just include it?
@rogro82 I've added your changes to the code! Thanks! You've wrote that you use the CMD_NAS_TEST
command to start/stop RTSP, can you give some further details? With which method and value do you send that command and how can you access the RTSP then?
Thanks! Sorry i totally overlooked your previous message.
If you have the doorbell you first need to enable RTSP. I guess you can just use CMD_NAS_SWITCH to enable RTSP for the doorbell, but before I had that working I had already decompiled the Android app and basically the RTSP support is there but the menu-option is just hidden. I altered the smali-code and compiled/signed and after that I could enable RTSP like all the other camera's.
I use CMD_NAS_TEST as that is what is used in the app to manually start the stream when setting up the RTSP connection on a NAS. It enables the RTSP stream for a fixed amount of time, so you can just use that to start recording using anything you want.
Currently i use your push-message solution to run CMD_NAS_TEST and then cast the stream from my synology to my homehub when someone rings the doorbell. Its not perfect yet but its getting there.
The command I use to manually enable the RTSP stream ( on device/channel 2 ):
service.sendCommandWithIntString(CommandTypes.CMD_NAS_TEST, 1, 2);
Thanks for your amazing work! I have been analyzing some additional data to send commands to each device (channel) and with some minor adjustments its working.
Wireshark logs:
cam0 off:
8800 0000 0100 0000 0000 0000 0000 0100 0000
cam0 on:8800 0000 0100 0000 0000 0000 0000 0000 0000
cam1 off:8800 0000 0100 0100 0000 0100 0000 0100 0000
cam1 on:8800 0000 0100 0100 0000 0100 0000 0000 0000
cam2 off:8800 0000 0100 0200 0000 0200 0000 0100 0000
cam2 on:8800 0000 0100 0200 0000 0200 0000 0000 0000
I have altered
buildIntStringCommandPayload
to include the channel (0x00, 0x01, 0x02) as can be seen above. These correspond withdevice_channel
in the json-payload received fromget_devs_list
.Now you can send commands to the individual channels:
To switch individual cameras on/off use command 0b04 (1035) with 0 (on) or 1 (off)
Turn camera 0 on
service.sendCommandWithIntString(CommandTypes.CMD_DEVS_SWITCH, 0, 0);
Turn camera 2 off
service.sendCommandWithIntString(CommandTypes.CMD_DEVS_SWITCH, 1, 2);
Im currently using
CMD_NAS_TEST
to manually start/stop the RTSP stream which seems to work just fine.