logo elektroda
logo elektroda
X
logo elektroda

How to access cheap 1$ A9 camera video stream from LAN page (NodeJS)?

p.kaczmarek2 3447 6
ADVERTISEMENT
  • A small, round WiFi camera held between fingers, with icons showing HD, wide lens, and multi-platform viewing features.
    Here's a step by step guide for accessing video and audio stream data of cheap Chinese X5/A9/etc cameras using the iLnk/iLnkP2P/PPPP protocol. Those cameras can be bought for as low as 1$ and are sometimes battery powered, but they still come in various models.
    This demonstration will use a cam-reverse project by David Ventura, which is written in NodeJS. Here's the repository with full readme:
    https://github.com/DavidVentura/cam-reverse

    First, you need a camera. I bought one here:
    Miniature wireless spy camera with a display showing its use in a living room.
    The box arrived slightly dent, but camera is still in one piece:
    Back side of A9 Mini IP camera packaging with barcode and product information. A box of A9 model HD IP camera with a camera illustration and function icons. Mini Wi-Fi camera set with accessories: USB cable, mounting bracket, Chinese manual, and box.
    By the way, my camera is using XF16 chip, you can see details here: https://www.elektroda.com/rtvforum/topic4074636.html
    Still, we don't need to open the case now. Just power it via USB.
    Then, you need to run cam-reverse with NodeJS. You can build it from source, but I'd recommend to get precompiled CJS file:
    A section of a webpage showing downloadable assets, with the bin.cjs file highlighted.
    Of course, also install NodeJS if you don't have it yet.
    The default command to run the server is very simple:
    
    node dist/bin.cjs http_server
    

    However, this will NOT work in many cases. This is because you may have multiple network interfaces (like VMware adapters), and they will not be checked unless specified. That's why I recommend creating config.yml:
    
    http_server:
      port: 5000
    
    logging:
      level: debug
      use_color: true
    
    
    # If you are crossing broadcast domains (VLANs) then
    # you need to specify all IPs as unicast targets
    discovery_ips:
      - 192.168.238.1
    
    

    Enter your network adapter IP that is in the same network as camera.
    For the start, we will just put camera in AP mode and connect to its WiFi:
    Wi-Fi network window showing no Internet connection and network name BATA825001CKETR.
    Run the app with config specified:
    
    node bin.cjs http_server --config_file <your_config.yml>
    

    This should detect the cam:
    HTTP server and IP camera connection logs displayed in a Windows console.
    Now you can access the stream:
    Close-up of a QR code on a white label with a partially visible border.
    A blurry photo of a manual page with visible English text and an unclear image of an electronic device.

    Excerpt from a user manual showing Wi-Fi connection instructions in English.
    Label reading “DC FAN MOTOR” and “CR Electronics” on a white background.
    You can also pair camera with your WiFi:
    
    node dist/bin.cjs pair --ssid <SSID> --password <PASSWORD>
    

    This way you should be able to have multiple cameras in NodeJS page, but I haven't tested that yet.

    I've did some initial tests with this project, and it seems to work, however XF16 chip gets warm and I'm not yet sure how to connect it to Home Assistant. I will try to investigate it futher and provide more information in another topic. Let me know if you have any A9 cameras, did you try to access the video stream? Is your camera also getting warm? Stay tuned!

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 11858 posts with rating 9943, helped 566 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 21522742
    ferbulous
    Level 18  
    Hi, what’s the resolution on these cameras?
    As for the battery powered ones, can you still get the live feed or does it only send images/video when motion is triggered?
    Also, how do you export the stream? Is it via onvif or rtsp
  • ADVERTISEMENT
  • #3 21522799
    gulson
    System Administrator
    Interesting. I have such a camcorder, but had to use the Chinese cloud. I didn't know it was possible to capture the video stream. Thanks.
  • ADVERTISEMENT
  • #4 21522825
    eDZio
    Level 16  
    After applying this, the camera does not need to have an internet connection?
  • ADVERTISEMENT
  • #5 21523556
    operator5wp
    Level 16  
    I have such a camcorder A9 and I have such a strange issue , when the camcorder is powered from usb the recorded image is good when recording is from the battery itself the video contains some transitions and stripes as if part of the image was in a different place, even with another battery it is the same. What could it be?
  • #6 21523575
    gulson
    System Administrator
    I had this when I plugged in the battery power - UPS under USB as a powerbank, as if something was introducing interference.
    It gets excited very easily. Possibly an inverter of some kind.

    Exactly, does the camera need to have external internet access after the change?
  • #7 21523729
    p.kaczmarek2
    Moderator Smart Home
    Of course, these solutions do not require a connection to the cloud, as can be seen from the example with the camera in AP mode - after all, it does not have access to the internet then. The application from the manufacturer works in an analogous way. There, too, there is no need to log in, just connect to the webcam's AP and then you can view the image.

    According to information from Github, this webcam connects, among others, to the following servers:
    
    139.155.68.77 - Shenzhen Tencent Computer Systems Company Limited 
    119.45.114.92 - Shenzhen Tencent Computer Systems Company Limited
    162.62.63.154 - Tencent Building, Kejizhongyi Avenue
    3.132.215.40 - ec2-3-132-215-40.us-east-2.compute.amazonaws.com
    
    .
    but these addresses (and all other output packets) can be blocked on the router, this will not affect the local video stream. Additionally, this may change in future copies.

    And if that's still not enough - I managed to upload my own firmware to this camcorder today, but for now I've only got the basics up and running, WiFi, flash, no video support yet:
    Web interface of OpenXR872 firmware with configuration, restart, web application launch, and about buttons, plus device status info. .
    I also added the possibility to compile firmware for it online, here: https://github.com/openshwprojects/OpenBK7231T_App/pull/1609
    Thus, the XR872 platform joined the other platforms supported by my project , namely BK7231T, BK7231N, BK7238, XR809, BL602, W800, W600, LN882H, BK7231M, TR6260, RTL87X0C, RTL8710A, RTL8710B, RTL8720D, ECR6600, ESP32, ESP32 S2, ESP32 S3, ESP32 C2, ESP32 C3, ESP32 C6, Windows (simulator).
    Details coming soon, but I'll already hint that this camcorder has.... derived RX/TX on D+ and D- from the USB port. A bit unnecessarily I soldered out its flash bone earlier.

    Programmer connected to a Wi-Fi camera PCB using a test clip and wires, placed on a wooden table. Close-up of a webcam's PCB with visible electronic components and a soldering clamp. CH341A programmer with SOP16 adapter and capacitors on a wooden surface. Close-up of a USB programmer with a DIP8 adapter and flash memory chip, placed on a wooden surface. Close-up of an electronic setup with a USB port and connected wires with goldpin connectors. .

    Added after 11 [hours] 31 [minutes]: .

    I also tried changing the Flash bone from 1MB to 2MB, the flash is read correctly, worse is that the bootloader (from ROM) doesn't want an image other than the 880K size:
    
    [img E] image_get_raw_cfg():774, fdcm read failed
    use default flash chip mJedec 0x0
    [FD I]: mode: 0x4, freq: 96000000Hz, drv: 0
    [img E] image_init():157, the image max size is invalid
    [fwk ERR] no xip section
    
    .
    Details: https://www.elektroda.com/rtvforum/topic4074636-30.html#21523067
    Helpful post? Buy me a coffee.

Topic summary

The discussion focuses on accessing video and audio streams from inexpensive Chinese cameras such as the X5 and A9 models using the iLnk/iLnkP2P/PPPP protocols. These cameras, sometimes battery powered and based on chips like the XF16, can be interfaced locally without requiring internet connectivity by utilizing projects like David Ventura's NodeJS cam-reverse repository. The cameras support local streaming via their own access point (AP) mode, bypassing cloud services. Users inquire about resolution, live feed availability on battery power, and streaming protocols (ONVIF, RTSP). Issues with video quality when powered by battery versus USB are noted, possibly due to power interference. Blocking outbound connections to Tencent servers on the router does not affect local streaming. Firmware modification is also mentioned as a possibility for advanced customization.
Summary generated by the language model.
ADVERTISEMENT