python-miio icon indicating copy to clipboard operation
python-miio copied to clipboard

Unable to decode chuangmi.camera.ipc013d pcap file

Open suvl opened this issue 1 year ago • 3 comments

So I'm trying to decode the protocol for chuangmi.camera.ipc013d oldie camera, but the pcap is not being decoded.

I can get some data from the camera, like for instance (via xiaomi_miiot.get_token in home assistant):

list:
  - did: "322567174"
    name: Video camera
    host: 192.168.1.183
    model: chuangmi.camera.ipc013d
    token: ___REDACTED___
    miio_cmd: >-
      miiocli device --ip 192.168.1.183 --token ___REDACTED___ info
    miio_info:
      life: 3359
      model: chuangmi.camera.ipc013d
      token: ___REDACTED___
      ipflag: 1
      miio_ver: 0.0.9
      uptime: 3368
      mac: 64:90:C1:23:F7:E9
      fw_ver: 4.3.4_0509
      hw_ver: Linux
      bootloader_ver: a97a650aea304f0d2b08da11cab16439
      miio_client_ver: 4.3.4
      VmPeak: 7140
      VmSize: 6468
      VmRSS: 1716
      MemFree: 760
      ap:
        ssid: ___REDACTED___
        bssid: ___REDACTED___
        rssi: "-41"
        freq: 2472
      netif:
        localIp: 192.168.1.183
        mask: 255.255.255.0
        gw: 192.168.1.1
      miio_times:
        - 3358
        - 282
        - 0
        - 3074

But when I run

miiocli devtools parse-pcap ~/Downloads/camera.pcap __REDACTED__

nothing shows up.

My plan is to try and reverse engineer the video URL and try to make it work with https://github.com/miguelangel-nubla/videoP2Proxy because I'm mad switching from home assitant to Mi app just to see the cameras.

suvl avatar Jul 09 '24 18:07 suvl

It could also be that the camera itself is controlled using some other way. Have you looked into the pcap file to see if there are any relevant packets? 54321/udp is the used port.

rytilahti avatar Jul 11 '24 10:07 rytilahti

Nope, nothing's talking to 54321/udp. I have many UDP packets going into [23964-23970]/udp

image

this goes on for a while, and then finally a TCP session is estabilished and the video starts playing in the app.

image

edit: .125 is my mac and .183 is the camera.

suvl avatar Jul 11 '24 13:07 suvl

video stream use 'PPPP' protocol

wrysunny avatar Nov 05 '25 02:11 wrysunny