diff --git a/.gitignore b/.gitignore index c693559..5526752 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ bundle.js venv node_modules build +dist/ diff --git a/Makefile b/Makefile index 41c07ec..816921d 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ venv: requirements.txt build: node_modules ./node_modules/.bin/tsc - ./node_modules/.bin/esbuild cmd/bin.ts --bundle --platform=node --format=esm --outdir=dist + ./node_modules/.bin/esbuild cmd/bin.ts --bundle --platform=node --outfile=dist/bin.cjs --target=node12 tar czf build.tar.gz build package.json run: node_modules diff --git a/README.md b/README.md index 14c0c5b..cb95fdf 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,23 @@ Per pictures of the [X5](https://github.com/DavidVentura/cam-reverse/blob/master ## Running -To execute the HTTP server, run `make run`; you can access the JPEG stream at http://localhost:1234/ and a file `audio.pcm` will be created. +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. + +```bash +$ node dist/bin.cjs http_server --help + +start http server + +Options: + --help Show help [boolean] + --version Show version number [boolean] + --debug [boolean] [default: false] + --ansi [boolean] [default: false] + --audio [boolean] [default: false] + --discovery_ip [default: "192.168.1.255"] + --attempt_to_fix_packet_loss [default: false] + --port HTTP Port to listen on [number] [default: 5000] +``` The roundtrip delay when using MJPEG is [~350ms](pics/delay.jpg?raw=true). @@ -22,7 +38,22 @@ 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 `SSID= PSK= make pair`. +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