Git Product home page Git Product logo

cam-reverse's People

Contributors

adrcunha avatar davidventura avatar soraxas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cam-reverse's Issues

stream usage with go2rtc or VLC

hey there,

im using for all my different cameras go2rtc so i can multiplex the streams to eg. frigate, as native apple homekit device and in Home Assistant

but, your implementation only outputs a endless jpg stream.

i have absolutely no idea how to use this as jpg or ffmpeg input in go2rtc or view the stream with VLC

a native mjpg stream which audio included would be nice.

Can't pair with my camera

Hello!
I'm trying to pair my TXW806-840 but I can't get any success. Maybe the code doesn't work with this model?
When connected to the pairing camera hotspot, my gateway is 192.168.1.1, so scanning for 192.168.1.255 would work, right?

I also tried to change the discovery ip to 192.168.1.1 but it continued not working.
I confirmed in wireshark that the camera is indeed 192.168.1.1.

Maybe you could help me?

Thanks

Some questions :)

Some questions and comments on the X5 camera itself, partially connected with the cam-reverse app.

Generally X5 camera is rather useless ;) Even with the YsxLite works in the randomly - sometiems connects, sometimes not :)

OK. I configured and run cam-reverse. It discovered both my cameras and I added them to the HomeAssistant (links to nodejs server). Works, but after some time one or another camera dissaperars. On the server screen it looks the same:

requested for BATC631408JMENX
requested for BATC631486CDCID
Conn closed, kicked
Conn closed, kicked
.
.
.
.
.

Restart of the server does not help. Power cycle on the camera itself is required to get it back.

Is it possible to repair this issue in the cam-reverse server code?

The cam-reverse stremas MJPEG with 640x480 resolution. Is the higher resolution available? Is it possible to get rtsp stream directly from the camera?

Package dependiences

On the first try I had:

$ make run
npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>= 14.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=14.17' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }

added 97 packages, and audited 98 packages in 5s

20 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
./node_modules/.bin/ts-node --esm http_server.ts
/home/marcinkk/cam-reverse/node_modules/typescript/lib/typescript.js:139
    for (let i = startIndex ?? 0; i < array.length; i++) {
                             ^

SyntaxError: Unexpected token '?'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at attemptRequireWithV8CompileCache (/home/marcinkk/cam-reverse/node_modules/ts-node/dist/util.js:104:16)
    at loadCompiler (/home/marcinkk/cam-reverse/node_modules/ts-node/dist/configuration.js:237:56)
    at resolveAndLoadCompiler (/home/marcinkk/cam-reverse/node_modules/ts-node/dist/configuration.js:226:16)
make: *** [Makefile:16: run] Error 1

I thought it is the version problem, so after some searching I've made:

npm install [email protected]
npm install [email protected]

and the server started.

Maybe proper/required versions of the packages can be implemented somewhere in the code?

How all of this project works ?

Hello, sorry it will may be a dumb question, i'm very new to all this GitHub stuff, but... What are the prerequisites to install this project ?
I tried to clone the repository in a folder on a fresh debian OS and run "make build" but nothing happened. I think i'm missing something important but i can't find what ?

Can someone clearly explain me or provide me a link with some additionnal explanation ?

Thank you and sorry for this dumb question.

Video resolution

Hi,

First, thanks for your amazing work, I was very annoyed using YsxLite app...

Is there an option for getting FullHD resolution from X5 camera ?

Thanks !

Battery state?

Hello, is there any information about retrieving battery info from camera? There is "low battery" signal in an YsxLite app, but no info about percentage, or even state of charging

Dont find the device...

my gateway network is 192.168.0.1 in this case do I have to modify something?

I didn't understand the help well. Would I have to find out the IP address of the camera?? But how to do this before it pairs with the app??

Help me please

Message from bin.cjs...

Searching for devices on 192.168.1.255

Information about PPPP

This is not a proper bug report, it is just me misusing the only communication channel on Github to show some appreciation for this project and provide some helpful links.

I started reverse engineering the PPPP protocol some time ago, but never got around to actually implement working code. Still, you might find my work interesting. I have documented my findings at this PPPP Protocol Description. I have also written a Wireshark dissector for the PPPP protocol (that was how it all started), at https://github.com/magicus/pppp-dissector. I found it quite helpful in analyzing the traffic to and from my camera.

Unable to pair A9 mini camera

I'm attempting to use the cam-reverse project to secure my home surveillance setup, specifically an A9 mini camera from Aliexpress that (probably.. most likely) has a backdoor. However, I'm experiencing difficulties in pairing the camera with the tool.

Steps to reproduce:

NOTE: (Steps 1 and 2 might be useless, I did them to look at the code in VSC)

  1. Clone the cam-reverse repository and run the script.
  2. Download the latest release of bin.cjs (v0.4) and place it in the dist/ directory of the project (create if not already created)
  3. Run "node dist/bin.cjs pair --ssid (MySSIDHere) --password (MyWiFiPasswordHere)"
    NOTE: The ssid and password fields correspond to my home WiFi configuration
  4. The program appears to be stuck at:
2024-09-02T19:01:17.556Z [info] Will configure any devices found to join (MySSIDHere)
2024-09-02T19:01:17.586Z [info] Searching for devices on 192.168.1.255

System details

Question

Could you provide guidance on how to proceed with pairing the camera? I'd appreciate any additional information or documentation that would help me resolve this issue. Might prove useful for others too. Thanks!

Labels:

  • bug
  • troubleshooting
  • cam-reverse

Few comments on documentation :)

I started using your server and it's workind fine. I can connect to the camer without YsxLite. I have 2 X5. both works. But I have to take a look into sources :)

discovery_ip: "192.168.40.104",

discovery_ip has to be changed to get camera visible - broadcast addres of the user network or IP of the camera

I coulndn't pair the camera with my WiFi. I connected with the AP created by the camera and the pairing wasn't successful. I paired both my cameras with YsxLite and then blocked them from the Internet on firewall ;)

The first problem i that the structure opts:

const opts = {

is lack from the element attempt_to_fix_packet_loss.
I added it and then the discovery prosess started, but without success :(

Clarification about the Spyware section

Background/extra info

The "Spyware" section in the README mentions 4 IPs where a HELLO message is sent to, and they're stored inside the YsxLite app APK. The README also mentions other IPs, some already extracted in the dec_svr.py file. Right now, they map to the following:

SWPNPDPFLVAOLNSXPHSQPIEOPAIDENLXHXEHIFLKPGLRHUARSTLQEEEPSUIHPDLSPEAOICLOSQEMLPPALNIBIAERHZLKHXEJHYHUEIEHELEEEKEG

  • 139.155.68.77: not found: 2(SERVFAIL)
  • 119.45.114.92: not found: 2(SERVFAIL)
  • 162.62.63.154: not found: 2(SERVFAIL)
  • 3.132.215.40: ec2-3-132-215-40.us-east-2.compute.amazonaws.com.

PFLXLSTBLKHYLPLRHUEHIEEGEEARLQPLIHIAEKAOSTLVEOSQPDHZLNPAICIFEREJLKEMENHUHXIBEPEEEHEIEL

  • 69.235.180.149: ec2-69-235-180-149.cn-northwest-1.compute.amazonaws.com.cn.
  • 44.198.131.69: ec2-44-198-131-69.compute-1.amazonaws.com.
  • 3.67.159.125: ec2-3-67-159-125.eu-central-1.compute.amazonaws.com.

EKTDROREHXHURHRKRMCXEEKPRNKKUZPNLXNYNOHYAONRNUNWRJSQGZNXGUNTIHKIJYEHPAKBHTKEKGKDLKJVKHKFERGSGIEIHUGLEDGOGQGNEEGFGRGP

  • pf1.ilnk.work: private registration through GoDaddy
  • pf2.ilnk.work: private registration through GoDaddy
  • pf1.i-lnk.com: private registration through Alibaba
  • pf2.i-lnk.com: private registration through Alibaba

EKPNHXIDAUAOEHLOTBSQEJSWPAARTAPKLXPGENLKLUPLHUATSVEESTPFHWIHPDIEHYAOLVEISQLNEGLPPALQHXERELIALKEHEOHZHUEKIFEEEPEJ

  • 174.129.34.188: ec2-174-129-34-188.compute-1.amazonaws.com.
  • 47.89.33.130: not found: 2(SERVFAIL)
  • 182.92.103.41: not found: 2(SERVFAIL)
  • 54.183.49.93: ec2-54-183-49-93.us-west-1.compute.amazonaws.com.

PFLXLNPKSULKLVPEHUHXHWLPEEPGEHIHARENLQAOSTLOIFSQHZIAPAPDLUIEERLNEOHYLKEPEIHUHXEGEJEEEKEH

  • 182.92.103.41: not found: 2(SERVFAIL)
  • 174.129.34.188: ec2-174-129-34-188.compute-1.amazonaws.com.
  • 182.92.103.41: not found: 2(SERVFAIL)

SVLXLNENPGLKHXLOLVHUPFLQEEEHPKLUIHIALPAOARHYIESQSTEKIBPAPDEIHZERLNEJIFLKHXEOEMHUEHELHWEEEPEG

  • 69.235.180.149: ec2-69-235-180-149.cn-northwest-1.compute.amazonaws.com.cn.
  • 44.198.131.69: ec2-44-198-131-69.compute-1.amazonaws.com.
  • 3.67.159.125: ec2-3-67-159-125.eu-central-1.compute.amazonaws.com.

I found a subset of the exact strings in the FtyCampro app:

EKPNHXIDAUAOEHLOTBSQEJSWPAARTAPKLXPGENLKLUPLHUATSVEESTPFHWIHPDIEHYAOLVEISQLNEGLPPALQHXERELIALKEHEOHZHUEKIFEEEPEJ

  • 174.129.34.188: ec2-174-129-34-188.compute-1.amazonaws.com.
  • 47.89.33.130: not found: 2(SERVFAIL)
  • 182.92.103.41: not found: 2(SERVFAIL)
  • 54.183.49.93: ec2-54-183-49-93.us-west-1.compute.amazonaws.com.

PFLXLNPKSULKLVPEHUHXHWLPEEPGEHIHARENLQAOSTLOIFSQHZIAPAPDLUIEERLNEOHYLKEPEIHUHXEGEJEEEKEH

  • 182.92.103.41: not found: 2(SERVFAIL)
  • 174.129.34.188: ec2-174-129-34-188.compute-1.amazonaws.com.
  • 182.92.103.41: not found: 2(SERVFAIL)

SVLXLNENPGLKHXLOLVHUPFLQEEEHPKLUIHIALPAOARHYIESQSTEKIBPAPDEIHZERLNEJIFLKHXEOEMHUEHELHWEEEPEG

  • 69.235.180.149: ec2-69-235-180-149.cn-northwest-1.compute.amazonaws.com.cn.
  • 44.198.131.69: ec2-44-198-131-69.compute-1.amazonaws.com.
  • 3.67.159.125: ec2-3-67-159-125.eu-central-1.compute.amazonaws.com.

SVLXLNENPGLKHXLOLVHUPFLQEEEHPKLUIHIALPAOARHYIESQSTEKIBPAPDEIHZERLNEJIFLKHXEOEMHUEHELHWEEEPEG

  • 174.129.34.188: ec2-174-129-34-188.compute-1.amazonaws.com.
  • 43.128.145.123: not found: 2(SERVFAIL)
  • 139.186.150.90: not found: 2(SERVFAIL)

SWPNPDPFLVAOLNSXPHSQPIEOPAIDENLXHXEHIFLKPGLRHUARSTLQEEEPSUIHPDLSPEAOICLOSQEMLPPALNIBIAERHZLKHXEJHYHUEIEHELEEEKEG

  • 139.155.68.77: not found: 2(SERVFAIL)
  • 119.45.114.92: not found: 2(SERVFAIL)
  • 162.62.63.154: not found: 2(SERVFAIL)
  • 3.132.215.40: ec2-3-132-215-40.us-east-2.compute.amazonaws.com.

These generic catch-all camera apps seem to be all derived from the same source, changing just the UI and some bits of behavior.

Ping origin: camera or app?

I don't have a setup to trace the attempts to send the HELLO messages to these IPs, but they're found in the APKs and the README states that "connecting the camera to a network, it tries to send a HELLO". I'd like to confirm the source of the messages, so the documentation can be updated about optionally blocking these IPs on the router (but hopefully they're sent by the app and thus using cam-reverse is totally safe).

@DavidVentura were you able to confirm the source of the messages, if they are sent by the app or by the camera firmware?

firmware dump of v380 blub e27 IoT WiFI smart camera

hi, i have a firmware dump of a v380 blub e27 IoT WiFI smart camera.
image
this camera uses a T25S80 flash chip, with a XF16 P9141EA6AD1 SoC.
some part of UART shell:

wlan information ===================================================
firmware:
    version : R-XR_C10.08.52.64_01.80 Jul  6 2019 20:05:10-P01.46-R
    buffer  : 12
driver:
    version : XR_V02.05
====================================================================

PMA: wlan mode:a

platform information ===============================================
XRADIO Skylark SDK 1.2.0 Jun  7 2023 11:32:54

sram heap space [0x21e4c0, 0x25fc00), total size 268096 Bytes
cpu  clock 240000000 Hz
HF   clock  40000000 Hz

sdk option:
    XIP           : enable
    INT LF OSC    : enable

mac address:
    efuse         : a0:17:f1:98:84:e2
    in use        : 34:bc:87:f3:00:0d
====================================================================

i thought you or someone else might need it
name: v380-blub-IoT-camera-firmware.bin
sha256: 28c1bd4fa632d7ba30148c0c51acd15a7844b90bb06db83e254c8be7c434cdb8
download link: Google Drive

New option to skip a camera

In my network there are 3 cameras that use the ILINKP2P protocol. One of them is very old (detected but the video dont is shown) and I would like to exclude it from the search. Could you implement an option to esclude some IP o Cameras from discovery and handshake?

http_server crashes when camera is discovered

node dist/bin.cjs http_server --port=1234
2024-05-06T19:57:07.793Z [info] Starting HTTP server on port 1234
2024-05-06T19:57:07.803Z [info] Searching for devices on 192.168.1.255
2024-05-06T19:57:07.914Z [info] Discovered camera FTYC811847AGFDZ at 192.168.1.103
/Users/adriano/cc/cam-reverse/dist/bin.cjs:25374
    if (config2.cameras[dev.devId].audio) {
                                   ^

TypeError: Cannot read properties of undefined (reading 'audio')
    at EventEmitter.<anonymous> (/Users/adriano/cc/cam-reverse/dist/bin.cjs:25374:36)
    at EventEmitter.emit (node:events:518:28)
    at handleIncomingPunch (/Users/adriano/cc/cam-reverse/dist/bin.cjs:24765:6)
    at Socket.<anonymous> (/Users/adriano/cc/cam-reverse/dist/bin.cjs:24776:38)
    at Socket.emit (node:events:518:28)
    at UDP.onMessage [as onmessage] (node:dgram:942:8)

Culprit: d5d4161

http_server crashes when displaying image from camera

Error:

2024-05-02T06:22:19.917Z [info] Video stream requested for camera FTYC811847AGFDZ
_http_outgoing.js:785
      throw new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);
      ^

TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer. Received an instance of Uint8Array
    at ServerResponse.end (_http_outgoing.js:785:13)
    at Server.<anonymous> (/Users/adriano/cc/cam-reverse/dist/bin.cjs:17998:11)
    at Server.emit (events.js:315:20)
    at parserOnIncoming (_http_server.js:874:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17) {
  code: 'ERR_INVALID_ARG_TYPE'
}

By trial and error, culprit checkout is 9c19c05.

Audio not working

Hi,

First of all, congrats for this awesome project! The protocol breakdown was awesome!

I have an "a9" camera, BATA984383XVUQD. It's working the video but when I request audio, never replies.

audio_context.createBuffer(channels, 960, sample_rate);

Might be this static decode length?

Any tips, I appreciate.

Thanks.

Single image option

Thanks for the project, I got everything working great so far.

Would it be possible to get a single image from a single camera? I only need one image every 15 minutes and no stream.

This would be perfect for me:
node bin.cjs frame --discovery_ip xxx --out frame.jpg

CI tests fare failing (biting is not defined in fn.tests.js)

Example:

https://github.com/DavidVentura/cam-reverse/actions/runs/8896395389/job/24428947521

Error:

1) parse packet
       parses PunchPkt:
     ReferenceError: bigint is not defined
      at Context.<anonymous> (file:///home/runner/work/cam-reverse/cam-reverse/tests/fn.test.js:138:18)
      at processImmediate (node:internal/timers:[46](https://github.com/DavidVentura/cam-reverse/actions/runs/8896395389/job/24428947521#step:6:47)6:21)

Line:

serialU64: bigint(156362),

Culprit:

11ab159

Two cameras not found

I bought 2 of https://www.temu.com/goods.html?goods_id=601099566919307 and set both up via https://play.google.com/store/apps/details?id=com.macrovideo.v380pro and also i have a https://www.amazon.de/-/en/gp/product/B0BXNM48TD which uses https://play.google.com/store/apps/details?id=shix.vi.camera (more info) but none of the cameras are found in my wifi. The last cam works in https://github.com/magicus/PPPP

blu@xxx:/tmp $ node bin.cjs http_server --discovery_ip 192.168.2.255
2024-08-06T13:57:16.030Z [info] Starting HTTP server on port 5000
2024-08-06T13:57:16.058Z [info] Searching for devices on 192.168.2.255

HASS Agent_esujiKiut2

Pairing failing for some cameras

This is a follow-up from #17

The camera is discovered, login happens, the WiFi setup and reboot commands are sent, but the camera continues in AP mode (even after power cycling it).

tcpdump: https://we.tl/t-sBeOus51cM

$ node dist/bin.cjs pair --ssid ...
2024-05-03T13:26:54.794Z [info] Will configure any devices found to join XXXX
2024-05-03T13:26:54.809Z [info] Searching for devices on 192.168.1.255
2024-05-03T13:26:54.810Z [trace] >> LanSearch
2024-05-03T13:26:54.953Z [debug] Received a PunchPkt message
2024-05-03T13:26:54.954Z [info] Discovered camera FTYB492321INQAX at 192.168.1.1
2024-05-03T13:26:54.954Z [trace] >> P2pRdy
2024-05-03T13:26:55.019Z [trace] << P2PAlive
2024-05-03T13:26:55.019Z [trace] >> P2PAliveAck
2024-05-03T13:26:55.019Z [trace] << P2pRdy
2024-05-03T13:26:55.020Z [debug] Sending Drw Packet with id 0
2024-05-03T13:26:55.020Z [trace] >> Drw
2024-05-03T13:26:55.028Z [trace] << DrwAck
2024-05-03T13:26:55.028Z [debug] Removing 0 from pending
2024-05-03T13:26:55.029Z [trace] << P2PAlive
2024-05-03T13:26:55.029Z [trace] >> P2PAliveAck
2024-05-03T13:26:55.202Z [trace] << Close
2024-05-03T13:26:55.202Z [debug] ^^ Close (f1f0) and it's not implemented yet
2024-05-03T13:26:56.157Z [trace] >> P2PAlive
2024-05-03T13:26:56.557Z [trace] >> P2PAlive
2024-05-03T13:26:56.958Z [trace] >> P2PAlive
2024-05-03T13:26:57.360Z [trace] >> P2PAlive
2024-05-03T13:26:57.760Z [trace] >> P2PAlive
2024-05-03T13:26:57.810Z [trace] >> LanSearch
2024-05-03T13:26:57.812Z [debug] Received a PunchPkt message
2024-05-03T13:26:57.812Z [info] Camera FTYB492321INQAX at 192.168.1.1 already discovered, ignoring
2024-05-03T13:26:58.161Z [trace] >> P2PAlive
2024-05-03T13:26:58.561Z [trace] >> P2PAlive
2024-05-03T13:26:58.960Z [trace] >> P2PAlive
2024-05-03T13:26:59.362Z [trace] >> P2PAlive
2024-05-03T13:26:59.762Z [trace] >> P2PAlive
2024-05-03T13:27:00.162Z [trace] >> P2PAlive
2024-05-03T13:27:00.564Z [trace] >> P2PAlive
2024-05-03T13:27:00.564Z [info] Disconnected from camera FTYB492321INQAX at 192.168.1.1
2024-05-03T13:27:00.564Z [info] Camera FTYB492321INQAX disconnected
2024-05-03T13:27:00.564Z [info] Press CONTROL+C if you're done setting up your cameras
2024-05-03T13:27:00.811Z [trace] >> LanSearch
2024-05-03T13:27:00.813Z [debug] Received a PunchPkt message
2024-05-03T13:27:00.813Z [info] Discovered camera FTYB492321INQAX at 192.168.1.1
2024-05-03T13:27:00.814Z [trace] >> P2pRdy
2024-05-03T13:27:00.815Z [trace] << P2PAlive
2024-05-03T13:27:00.815Z [trace] >> P2PAliveAck
2024-05-03T13:27:00.816Z [trace] << P2pRdy
2024-05-03T13:27:00.816Z [debug] Sending Drw Packet with id 0
2024-05-03T13:27:00.816Z [trace] >> Drw
2024-05-03T13:27:00.826Z [trace] << DrwAck
2024-05-03T13:27:00.826Z [debug] Removing 0 from pending
2024-05-03T13:27:00.826Z [trace] << P2PAlive
2024-05-03T13:27:00.826Z [trace] >> P2PAliveAck
2024-05-03T13:27:01.001Z [trace] << Drw
2024-05-03T13:27:01.002Z [trace] >> DrwAck
2024-05-03T13:27:01.002Z [info] Logging in to camera FTYB492321INQAX
2024-05-03T13:27:01.002Z [info] Configuring camera FTYB492321INQAX
2024-05-03T13:27:01.003Z [debug] Sending Drw Packet with id 1
2024-05-03T13:27:01.003Z [trace] >> Drw
2024-05-03T13:27:01.003Z [info] WiFi config for camera FTYB492321INQAX is done
2024-05-03T13:27:01.003Z [info] Validating WiFi settings on FTYB492321INQAX
2024-05-03T13:27:01.003Z [debug] Sending Drw Packet with id 2
2024-05-03T13:27:01.003Z [trace] >> Drw
2024-05-03T13:27:01.003Z [info] Asking FTYB492321INQAX to reboot
2024-05-03T13:27:01.003Z [debug] Sending Drw Packet with id 3
2024-05-03T13:27:01.003Z [trace] >> Drw
2024-05-03T13:27:01.208Z [trace] << P2PAlive
2024-05-03T13:27:01.208Z [trace] >> P2PAliveAck
2024-05-03T13:27:01.315Z [debug] Resending packet 1 as 4
2024-05-03T13:27:01.315Z [debug] Sending Drw Packet with id 4
2024-05-03T13:27:01.315Z [trace] >> Drw
2024-05-03T13:27:01.315Z [debug] Resending packet 2 as 5
2024-05-03T13:27:01.315Z [debug] Sending Drw Packet with id 5
2024-05-03T13:27:01.315Z [trace] >> Drw
2024-05-03T13:27:01.315Z [debug] Resending packet 3 as 6
2024-05-03T13:27:01.315Z [debug] Sending Drw Packet with id 6
2024-05-03T13:27:01.315Z [trace] >> Drw
2024-05-03T13:27:01.318Z [trace] << DrwAck
2024-05-03T13:27:01.318Z [debug] Removing 4 from pending
2024-05-03T13:27:01.319Z [trace] << DrwAck
2024-05-03T13:27:01.319Z [debug] Removing 6 from pending
2024-05-03T13:27:01.541Z [trace] << P2PAlive
2024-05-03T13:27:01.541Z [trace] >> P2PAliveAck
2024-05-03T13:27:01.810Z [trace] << P2PAlive
2024-05-03T13:27:01.810Z [trace] >> P2PAliveAck
2024-05-03T13:27:01.815Z [debug] Resending packet 5 as 7
2024-05-03T13:27:01.815Z [debug] Sending Drw Packet with id 7
2024-05-03T13:27:01.815Z [trace] >> Drw
2024-05-03T13:27:01.817Z [trace] << DrwAck
2024-05-03T13:27:01.817Z [debug] Removing 7 from pending
2024-05-03T13:27:02.111Z [trace] << P2PAlive
2024-05-03T13:27:02.111Z [trace] >> P2PAliveAck
2024-05-03T13:27:02.501Z [trace] << P2PAlive
2024-05-03T13:27:02.501Z [trace] >> P2PAliveAck
2024-05-03T13:27:02.801Z [trace] << P2PAlive
2024-05-03T13:27:02.801Z [trace] >> P2PAliveAck
2024-05-03T13:27:03.101Z [trace] << P2PAlive
2024-05-03T13:27:03.101Z [trace] >> P2PAliveAck
2024-05-03T13:27:03.401Z [trace] << P2PAlive
2024-05-03T13:27:03.401Z [trace] >> P2PAliveAck
2024-05-03T13:27:03.701Z [trace] << P2PAlive
2024-05-03T13:27:03.701Z [trace] >> P2PAliveAck
2024-05-03T13:27:03.811Z [trace] >> LanSearch
2024-05-03T13:27:03.813Z [debug] Received a PunchPkt message
2024-05-03T13:27:03.813Z [info] Camera FTYB492321INQAX at 192.168.1.1 already discovered, ignoring
2024-05-03T13:27:04.001Z [trace] << P2PAlive
2024-05-03T13:27:04.001Z [trace] >> P2PAliveAck
2024-05-03T13:27:04.301Z [trace] << P2PAlive
2024-05-03T13:27:04.301Z [trace] >> P2PAliveAck
2024-05-03T13:27:04.601Z [trace] << P2PAlive
2024-05-03T13:27:04.601Z [trace] >> P2PAliveAck
2024-05-03T13:27:04.901Z [trace] << P2PAlive
2024-05-03T13:27:04.901Z [trace] >> P2PAliveAck
2024-05-03T13:27:05.201Z [trace] << P2PAlive
2024-05-03T13:27:05.201Z [trace] >> P2PAliveAck
2024-05-03T13:27:05.501Z [trace] << P2PAlive
2024-05-03T13:27:05.501Z [trace] >> P2PAliveAck
2024-05-03T13:27:05.801Z [trace] << P2PAlive
2024-05-03T13:27:05.801Z [trace] >> P2PAliveAck
2024-05-03T13:27:06.102Z [trace] << P2PAlive
2024-05-03T13:27:06.102Z [trace] >> P2PAliveAck
2024-05-03T13:27:06.423Z [trace] << P2PAlive
2024-05-03T13:27:06.423Z [trace] >> P2PAliveAck
2024-05-03T13:27:06.752Z [trace] << P2PAlive
2024-05-03T13:27:06.752Z [trace] >> P2PAliveAck
2024-05-03T13:27:06.811Z [trace] >> LanSearch
2024-05-03T13:27:06.814Z [debug] Received a PunchPkt message
2024-05-03T13:27:06.814Z [info] Camera FTYB492321INQAX at 192.168.1.1 already discovered, ignoring
2024-05-03T13:27:07.069Z [trace] << P2PAlive
2024-05-03T13:27:07.069Z [trace] >> P2PAliveAck
2024-05-03T13:27:07.369Z [trace] << P2PAlive
2024-05-03T13:27:07.369Z [trace] >> P2PAliveAck
2024-05-03T13:27:07.669Z [trace] << P2PAlive
2024-05-03T13:27:07.669Z [trace] >> P2PAliveAck
2024-05-03T13:27:07.969Z [trace] << P2PAlive
2024-05-03T13:27:07.969Z [trace] >> P2PAliveAck
2024-05-03T13:27:08.269Z [trace] << P2PAlive
2024-05-03T13:27:08.269Z [trace] >> P2PAliveAck
2024-05-03T13:27:08.576Z [trace] << P2PAlive
2024-05-03T13:27:08.576Z [trace] >> P2PAliveAck
2024-05-03T13:27:08.870Z [trace] << P2PAlive
2024-05-03T13:27:08.870Z [trace] >> P2PAliveAck
2024-05-03T13:27:09.170Z [trace] << P2PAlive
2024-05-03T13:27:09.170Z [trace] >> P2PAliveAck
2024-05-03T13:27:09.470Z [trace] << P2PAlive
2024-05-03T13:27:09.470Z [trace] >> P2PAliveAck
2024-05-03T13:27:09.770Z [trace] << P2PAlive
2024-05-03T13:27:09.770Z [trace] >> P2PAliveAck
2024-05-03T13:27:09.812Z [trace] >> LanSearch
2024-05-03T13:27:09.814Z [debug] Received a PunchPkt message
2024-05-03T13:27:09.814Z [info] Camera FTYB492321INQAX at 192.168.1.1 already discovered, ignoring
2024-05-03T13:27:10.070Z [trace] << P2PAlive
2024-05-03T13:27:10.070Z [trace] >> P2PAliveAck
2024-05-03T13:27:10.370Z [trace] << P2PAlive
2024-05-03T13:27:10.370Z [trace] >> P2PAliveAck
2024-05-03T13:27:10.670Z [trace] << P2PAlive
2024-05-03T13:27:10.670Z [trace] >> P2PAliveAck
2024-05-03T13:27:10.971Z [trace] << P2PAlive
2024-05-03T13:27:10.971Z [trace] >> P2PAliveAck
2024-05-03T13:27:11.270Z [trace] << P2PAlive
2024-05-03T13:27:11.270Z [trace] >> P2PAliveAck
2024-05-03T13:27:11.650Z [trace] << P2PAlive
2024-05-03T13:27:11.650Z [trace] >> P2PAliveAck
2024-05-03T13:27:11.995Z [trace] << P2PAlive
2024-05-03T13:27:11.995Z [trace] >> P2PAliveAck
2024-05-03T13:27:12.296Z [trace] << P2PAlive
2024-05-03T13:27:12.296Z [trace] >> P2PAliveAck
2024-05-03T13:27:12.597Z [trace] << P2PAlive
2024-05-03T13:27:12.597Z [trace] >> P2PAliveAck
2024-05-03T13:27:12.811Z [trace] >> LanSearch
2024-05-03T13:27:12.814Z [debug] Received a PunchPkt message
2024-05-03T13:27:12.814Z [info] Camera FTYB492321INQAX at 192.168.1.1 already discovered, ignoring
2024-05-03T13:27:12.889Z [trace] << P2PAlive
2024-05-03T13:27:12.889Z [trace] >> P2PAliveAck
2024-05-03T13:27:13.189Z [trace] << P2PAlive
2024-05-03T13:27:13.189Z [trace] >> P2PAliveAck
2024-05-03T13:27:13.490Z [trace] << P2PAlive
2024-05-03T13:27:13.490Z [trace] >> P2PAliveAck
2024-05-03T13:27:13.790Z [trace] << P2PAlive
2024-05-03T13:27:13.790Z [trace] >> P2PAliveAck
2024-05-03T13:27:14.090Z [trace] << P2PAlive
2024-05-03T13:27:14.090Z [trace] >> P2PAliveAck
2024-05-03T13:27:14.390Z [trace] << P2PAlive
2024-05-03T13:27:14.390Z [trace] >> P2PAliveAck
2024-05-03T13:27:14.690Z [trace] << P2PAlive
2024-05-03T13:27:14.690Z [trace] >> P2PAliveAck
2024-05-03T13:27:14.990Z [trace] << P2PAlive
2024-05-03T13:27:14.990Z [trace] >> P2PAliveAck
2024-05-03T13:27:15.290Z [trace] << P2PAlive
2024-05-03T13:27:15.290Z [trace] >> P2PAliveAck
2024-05-03T13:27:15.590Z [trace] << P2PAlive
2024-05-03T13:27:15.590Z [trace] >> P2PAliveAck
2024-05-03T13:27:15.812Z [trace] >> LanSearch
2024-05-03T13:27:15.815Z [debug] Received a PunchPkt message
2024-05-03T13:27:15.815Z [info] Camera FTYB492321INQAX at 192.168.1.1 already discovered, ignoring
2024-05-03T13:27:15.890Z [trace] << P2PAlive
2024-05-03T13:27:15.890Z [trace] >> P2PAliveAck
2024-05-03T13:27:16.190Z [trace] << P2PAlive
2024-05-03T13:27:16.190Z [trace] >> P2PAliveAck
2024-05-03T13:27:16.490Z [trace] << P2PAlive
2024-05-03T13:27:16.490Z [trace] >> P2PAliveAck
2024-05-03T13:27:16.836Z [trace] << P2PAlive
2024-05-03T13:27:16.836Z [trace] >> P2PAliveAck
2024-05-03T13:27:17.160Z [trace] << P2PAlive
2024-05-03T13:27:17.160Z [trace] >> P2PAliveAck
2024-05-03T13:27:17.460Z [trace] << P2PAlive
2024-05-03T13:27:17.460Z [trace] >> P2PAliveAck
2024-05-03T13:27:17.760Z [trace] << P2PAlive
2024-05-03T13:27:17.760Z [trace] >> P2PAliveAck
2024-05-03T13:27:18.061Z [trace] << P2PAlive
2024-05-03T13:27:18.061Z [trace] >> P2PAliveAck
2024-05-03T13:27:18.361Z [trace] << P2PAlive
2024-05-03T13:27:18.361Z [trace] >> P2PAliveAck
2024-05-03T13:27:18.661Z [trace] << P2PAlive
2024-05-03T13:27:18.661Z [trace] >> P2PAliveAck
2024-05-03T13:27:18.812Z [trace] >> LanSearch
2024-05-03T13:27:18.814Z [debug] Received a PunchPkt message
2024-05-03T13:27:18.815Z [info] Camera FTYB492321INQAX at 192.168.1.1 already discovered, ignoring
2024-05-03T13:27:18.961Z [trace] << P2PAlive
2024-05-03T13:27:18.961Z [trace] >> P2PAliveAck
2024-05-03T13:27:19.261Z [trace] << P2PAlive
2024-05-03T13:27:19.261Z [trace] >> P2PAliveAck
2024-05-03T13:27:19.561Z [trace] << P2PAlive
2024-05-03T13:27:19.561Z [trace] >> P2PAliveAck
2024-05-03T13:27:19.861Z [trace] << P2PAlive
2024-05-03T13:27:19.861Z [trace] >> P2PAliveAck
2024-05-03T13:27:20.161Z [trace] << P2PAlive
2024-05-03T13:27:20.161Z [trace] >> P2PAliveAck
2024-05-03T13:27:20.461Z [trace] << P2PAlive
2024-05-03T13:27:20.462Z [trace] >> P2PAliveAck
2024-05-03T13:27:20.762Z [trace] << P2PAlive
2024-05-03T13:27:20.762Z [trace] >> P2PAliveAck
2024-05-03T13:27:21.062Z [trace] << P2PAlive
2024-05-03T13:27:21.063Z [trace] >> P2PAliveAck
2024-05-03T13:27:21.362Z [trace] << P2PAlive
2024-05-03T13:27:21.363Z [trace] >> P2PAliveAck
2024-05-03T13:27:21.733Z [trace] << P2PAlive
2024-05-03T13:27:21.733Z [trace] >> P2PAliveAck
2024-05-03T13:27:21.813Z [trace] >> LanSearch
2024-05-03T13:27:21.816Z [debug] Received a PunchPkt message
2024-05-03T13:27:21.816Z [info] Camera FTYB492321INQAX at 192.168.1.1 already discovered, ignoring
2024-05-03T13:27:22.071Z [trace] << P2PAlive
2024-05-03T13:27:22.071Z [trace] >> P2PAliveAck
2024-05-03T13:27:22.392Z [trace] << P2PAlive
2024-05-03T13:27:22.392Z [trace] >> P2PAliveAck
2024-05-03T13:27:22.691Z [trace] << P2PAlive
2024-05-03T13:27:22.691Z [trace] >> P2PAliveAck
2024-05-03T13:27:22.991Z [trace] << P2PAlive
2024-05-03T13:27:22.991Z [trace] >> P2PAliveAck
2024-05-03T13:27:23.291Z [trace] << P2PAlive
2024-05-03T13:27:23.291Z [trace] >> P2PAliveAck
2024-05-03T13:27:23.591Z [trace] << P2PAlive
2024-05-03T13:27:23.591Z [trace] >> P2PAliveAck
2024-05-03T13:27:23.891Z [trace] << P2PAlive
2024-05-03T13:27:23.891Z [trace] >> P2PAliveAck
2024-05-03T13:27:24.191Z [trace] << P2PAlive
2024-05-03T13:27:24.191Z [trace] >> P2PAliveAck
2024-05-03T13:27:24.492Z [trace] << P2PAlive
2024-05-03T13:27:24.492Z [trace] >> P2PAliveAck
2024-05-03T13:27:24.792Z [trace] << P2PAlive
2024-05-03T13:27:24.792Z [trace] >> P2PAliveAck
2024-05-03T13:27:24.814Z [trace] >> LanSearch
2024-05-03T13:27:24.816Z [debug] Received a PunchPkt message
2024-05-03T13:27:24.816Z [info] Camera FTYB492321INQAX at 192.168.1.1 already discovered, ignoring
2024-05-03T13:27:25.092Z [trace] << P2PAlive
2024-05-03T13:27:25.092Z [trace] >> P2PAliveAck
2024-05-03T13:27:25.392Z [trace] << P2PAlive
2024-05-03T13:27:25.392Z [trace] >> P2PAliveAck
2024-05-03T13:27:25.692Z [trace] << P2PAlive
2024-05-03T13:27:25.692Z [trace] >> P2PAliveAck
2024-05-03T13:27:25.992Z [trace] << P2PAlive
2024-05-03T13:27:25.992Z [trace] >> P2PAliveAck
2024-05-03T13:27:26.293Z [trace] << P2PAlive
2024-05-03T13:27:26.293Z [trace] >> P2PAliveAck
2024-05-03T13:27:26.593Z [trace] << P2PAlive
2024-05-03T13:27:26.593Z [trace] >> P2PAliveAck
2024-05-03T13:27:26.918Z [trace] << P2PAlive
2024-05-03T13:27:26.918Z [trace] >> P2PAliveAck
2024-05-03T13:27:27.265Z [trace] << P2PAlive
2024-05-03T13:27:27.265Z [trace] >> P2PAliveAck
2024-05-03T13:27:27.564Z [trace] << P2PAlive
2024-05-03T13:27:27.565Z [trace] >> P2PAliveAck
2024-05-03T13:27:27.814Z [trace] >> LanSearch
2024-05-03T13:27:27.816Z [debug] Received a PunchPkt message
2024-05-03T13:27:27.816Z [info] Camera FTYB492321INQAX at 192.168.1.1 already discovered, ignoring
2024-05-03T13:27:27.859Z [trace] << P2PAlive
2024-05-03T13:27:27.859Z [trace] >> P2PAliveAck
2024-05-03T13:27:28.159Z [trace] << P2PAlive
2024-05-03T13:27:28.159Z [trace] >> P2PAliveAck
2024-05-03T13:27:28.459Z [trace] << P2PAlive
2024-05-03T13:27:28.460Z [trace] >> P2PAliveAck
2024-05-03T13:27:28.760Z [trace] << P2PAlive
2024-05-03T13:27:28.760Z [trace] >> P2PAliveAck
2024-05-03T13:27:29.059Z [trace] << P2PAlive
2024-05-03T13:27:29.060Z [trace] >> P2PAliveAck
2024-05-03T13:27:29.359Z [trace] << P2PAlive
2024-05-03T13:27:29.360Z [trace] >> P2PAliveAck
2024-05-03T13:27:29.659Z [trace] << P2PAlive
2024-05-03T13:27:29.660Z [trace] >> P2PAliveAck
2024-05-03T13:27:29.959Z [trace] << P2PAlive
2024-05-03T13:27:29.960Z [trace] >> P2PAliveAck
2024-05-03T13:27:30.259Z [trace] << P2PAlive
2024-05-03T13:27:30.260Z [trace] >> P2PAliveAck
2024-05-03T13:27:30.559Z [trace] << P2PAlive
2024-05-03T13:27:30.559Z [trace] >> P2PAliveAck
^C

Unknown file extension ".ts"

What am I doing wrong?
jim@jim-lenovo:~/cam-reverse-master$ make run ./node_modules/.bin/ts-node --esm http_server.ts TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/jim/cam-reverse-master/http_server.ts at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9) at defaultGetFormat (node:internal/modules/esm/get_format:203:36) at defaultLoad (node:internal/modules/esm/load:143:22) at async nextLoad (node:internal/modules/esm/hooks:866:22) at async nextLoad (node:internal/modules/esm/hooks:866:22) at async Hooks.load (node:internal/modules/esm/hooks:449:20) at async MessagePort.handleMessage (node:internal/modules/esm/worker:196:18) { code: 'ERR_UNKNOWN_FILE_EXTENSION' } make: *** [Makefile:16: run] Error 1
jim@jim-lenovo:~/cam-reverse-master$ node -v
v20.12.2
jim@jim-lenovo:~/cam-reverse-master$

Instructions unclear

I seriously do not understand what I should be doing here.

I bought an A9 model. Tried it with the official app, and it works.
Now I wanna use it directly (for HomeAssistant, ultimately).

  1. I clicked remove in the app, so it doesn't interfere.
  2. I turned on the camera and entered AP mode.
  3. I connected to that AP from my PC
  4. I built this project

Everything is clear until now. But after that, I'm confused.

HTTP Server
I ran node dist/bin.cjs http_server, and but nothing happens.
Tried modifying the config file so that it checks other IPs for discovery.
It did not work.
Apparently you have to pass the config explicitly with --config_file config.example.yml (please add this to the Readme)
I added 192.168.0.1, because that's what I see in ip route, and 192.168.0.255 because it was posted in another issue here.
Now it's checking every IP address, and it is in debug mode.
However still, nothing happens whatsoever.
No error in the console, either.

Pairing
I struggled to understand what I should even pass as SSID and Password, until I realized you must mean my proper (2.4ghz) Wifi network.
I ran node dist/bin.cjs http_server --ssid what --password ever, and nothing happens.
Tried passing --config_file config.example.yml but didn't help.
Saw in the code that you're not actually loading the config from the command line parameters, so the config object is always going to be the default, which seems like a mistake. (if so, please fix)
Fixed it and rebuilt the project.
Now it's checking each IP, but still no change, or even a debug message.

Tried the same thing again after re-doing everything in the app so that it might already be "paired" with my Wifi, but the result is the same.

What am I even supposed to do?

usar opencv

Hey David,

I'm working on a robotics project with an autonomous car that uses various sensors for object detection, a gyroscope, and a WiFi X5 camera for image recognition. I'm trying to use OpenCV to process the camera's video in real-time, but I'm not sure how to go about it.

I saw your GitHub repo, and it looks like you've worked with this camera before. Could you give me some guidance on how to integrate it with OpenCV? Any help would be awesome!

I'll show you a little bit of the project I've been working on.

Thanks in advance,
`import cv2
import numpy as np
import serial
import time

Configuración del módulo Bluetooth

bluetooth_port = 'COM8' # Ajustar según el puerto utilizado
bluetooth_baudrate = 9600
ser = serial.Serial(bluetooth_port, bluetooth_baudrate)

Configuración de la cámara7

numero_camara = 1 # Índice de la cámara
cap = cv2.VideoCapture(numero_camara)

Definir los colores para identificar (HSV)

color_ranges = {
'naranja': ([5, 100, 100], [15, 255, 255]),
'amarillo': ([25, 100, 100], [35, 255, 255]),
'rojo': ([0, 100, 100], [10, 255, 255]),
'verde': ([50, 100, 100], [70, 255, 255]),
'azul': ([100, 100, 100], [130, 255, 255])
}

Selección del color a rastrear por el usuario

print("Colores disponibles para rastrear:")
for color in color_ranges.keys():
print(f"- {color}")
color_a_rastrear = 'verde'#input("Selecciona el color que deseas rastrear: ").lower()

if color_a_rastrear == 'naranja':
indcolor = 1
elif color_a_rastrear =='amarillo':
indcolor = 2
elif color_a_rastrear == 'rojo':
indcolor = 3
elif color_a_rastrear == 'verde':
indcolor = 4
elif color_a_rastrear == 'azul':
indcolor = 5

if color_a_rastrear not in color_ranges:
print("Color no válido. Se utilizará 'rojo' por defecto.")
color_a_rastrear = 'rojo'

Divisiones del frame en zonas

zonas_horizontales = 18
zonas_verticales = 8
ancho_frame = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
alto_frame = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
ancho_zona = ancho_frame // zonas_horizontales
alto_zona = alto_frame // zonas_verticales

Inicialización de la última posición enviada y temporizador

ultima_coordenada_horizontal = 90 #None
ultima_coordenada_vertical = 90#None
ultimo_tiempo = time.time()
comando_enviado = False

#0.06 # Tiempo en segundos para considerar la posición como estable

while True:
ret, frame = cap.read()

if not ret:
    print("Error al capturar la imagen.")
    break

# Convertir el frame a HSV
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)

# Crear una máscara para el color seleccionado
lower_color = np.array(color_ranges[color_a_rastrear][0])
upper_color = np.array(color_ranges[color_a_rastrear][1])
mask = cv2.inRange(hsv, lower_color, upper_color)

# Encontrar contornos
contours, _ = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

`

Minicamera A9 detected but not logged

I've ha minicam A9.
Running the tool I see the camera name: BATD..... but don't see the video in web browser.
I believe that there is some difference in login protocol. In attachment there are the screenshot and the file captured with wireshark.
The camera has IP 192.168.238.1 (AP Mode). The pc has ip 192.168.238.103
a9_debug_issue.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.