From a3a5a9404cd17f10bcdb0343eb0397d68710c45c Mon Sep 17 00:00:00 2001 From: Adriano Cunha <35786489+adrcunha@users.noreply.github.com> Date: Fri, 26 Apr 2024 08:18:20 -0700 Subject: [PATCH 1/3] Update instructions in README Update instructions a bit for first-time users, fix a few typos. --- README.md | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index cb95fdf..3e48b5b 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,35 @@ Re-implementation of the "iLnk"/"iLnkP2P"/"PPPP" protocol used on some cheap (\< Per pictures of the [X5](https://github.com/DavidVentura/cam-reverse/blob/master/pics/pcb.jpg?raw=true), [A9](https://github.com/DavidVentura/cam-reverse/blob/master/pics/pcb_a9.jpg?raw=true) the main chip is TXW817 ([chinese](https://www.taixin-semi.com/Product/ProductDetail?productId=306), [eng, google translate](https://www-taixin--semi-com.translate.goog/Product/ProductDetail?productId=306&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp)) +## Building + +Simply run `make build` to build the binaries. + +## Pairing a new camera + +Ensure your device in access point mode (the blue LED blinks slowly to indicate that); optionally, press the MODE button for 5s to switch to access point mode. + +Connect to the device's access point (e.g., FTYC811847AGFDZ) and run `node dist/bin.cjs pair --ssid --password `. + +```bash +$ node dist/bin.cjs pair --help + +configure a camera + +Options: + --help Show help [boolean] + --version Show version number [boolean] + --debug [boolean] [default: false] + --ansi [boolean] [default: false] + --discovery_ip [default: "192.168.1.255"] + --attempt_to_fix_packet_loss [default: false] + --ssid [string] [required] + --password [string] [required] +``` ## Running -To execute the HTTP server, run `node bin.cjs`; you can access the JPEG stream at http://localhost:5000/ and (optionally) a file `audio.pcm` will be created. + +To execute the HTTP server, run `node dist/bin.cjs http_server`; you can access the JPEG stream at http://localhost:5000/ and (optionally) a file `audio.pcm` will be created. ```bash $ node dist/bin.cjs http_server --help @@ -36,25 +62,6 @@ The server will send a broadcast packet every few seconds to discover all the ca Clicking on the image will take you to a page that has audio streaming enabled. -## Pairing a new camera - -Connect to the device's access point and run `node bin.cjs pair --ssid --password `. -```bash -$ node dist/bin.cjs pair --help - -configure a camera - -Options: - --help Show help [boolean] - --version Show version number [boolean] - --debug [boolean] [default: false] - --ansi [boolean] [default: false] - --discovery_ip [default: "192.168.1.255"] - --attempt_to_fix_packet_loss [default: false] - --ssid [string] [required] - --password [string] [required] -``` - ## Protocol The protocol is weirdly complex, though very little communication is necessary to use the device From 6b5026dcf18aa0847ec5dcf960489ad72ca8abcb Mon Sep 17 00:00:00 2001 From: Adriano Cunha <35786489+adrcunha@users.noreply.github.com> Date: Fri, 26 Apr 2024 08:24:55 -0700 Subject: [PATCH 2/3] Drop newline in the activity indicator The "." character is printed on a new line every 2s to indicate that the discovery process is running. However, using a new line unnecessary floods the output log; switch to printing "." without a newline, keeping the activity indicator while also drastically reducing the number of lines in the output log. --- discovery.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discovery.ts b/discovery.ts index e3f02ca..3c5c1e4 100644 --- a/discovery.ts +++ b/discovery.ts @@ -34,7 +34,7 @@ export const discoverDevices = (debug: boolean, discovery_ip: string): EventEmit let buf = create_LanSearch(); setInterval(() => { - console.log("."); + process.stdout.write("."); sock.send(new Uint8Array(buf.buffer), SEND_PORT, discovery_ip); }, 2000); sock.send(new Uint8Array(buf.buffer), SEND_PORT, discovery_ip); From 72de55b26f097f6f1854ab28bc3f4688219c8707 Mon Sep 17 00:00:00 2001 From: Adriano Cunha <35786489+adrcunha@users.noreply.github.com> Date: Fri, 26 Apr 2024 08:30:33 -0700 Subject: [PATCH 3/3] Remove the `pair` target Now that `pair` requires parameters and SSID/password have no defaults, this target doesn't work. --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index ad62c0a..d7a8ebe 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,6 @@ build: node_modules run: node_modules ./node_modules/.bin/ts-node --esm cmd/bin http_server --port=1234 -pair: node_modules - ./node_modules/.bin/ts-node --esm cmd/bin pair - hook: bundle.js venv ./venv/bin/python3 -u loader3.py