rpos
rpos copied to clipboard
clarify instructions - suggestion
Leaving the original 'issue' and comments for posterity. Jump to the last entry for potential improvement in the instructions.
Just installed rpos, and have an error on step 8 "node rpos.js"
that file "rpos.js" does not exist. It is not in the ~/rpos directories, nor do I see it here in the repository.
Did my install fail somewhere?
`laudix@RPi0-CameraUpstairs:~/rpos $ node rpos.js module.js:549 throw err; ^
Error: Cannot find module '/home/laudix/rpos/rpos.js' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:188:16) at bootstrap_node.js:609:3 `
arbitrarily trying a similarly named file also fails
laudix@RPi0-CameraUpstairs:~/rpos $ node rpos.ts /home/laudix/rpos/rpos.ts:29 import http = require("http"); ^^^^^^
SyntaxError: Unexpected token import at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:616:28) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:188:16) at bootstrap_node.js:609:3 `
in #54 @RogerHardiman says "check you have compiled rpos.ts into rpos.js"
here is my listing
laudix@RPi0-CameraUpstairs:~/rpos $ ls -l total 680 drwxr-xr-x 2 laudix laudix 4096 Jun 3 22:17 bin drwxr-xr-x 2 laudix laudix 4096 Jun 3 22:17 cpp -rw-r--r-- 1 laudix laudix 3055 Jun 3 22:17 ffserver_mac.conf -rw-r--r-- 1 laudix laudix 2698 Jun 3 22:17 gulpfile.js drwxr-xr-x 2 laudix laudix 4096 Jun 3 22:17 lib -rw-r--r-- 1 laudix laudix 1128 Jun 3 22:17 LICENSE drwxr-xr-x 587 laudix laudix 20480 Jun 4 18:09 node_modules -rw-r--r-- 1 laudix laudix 1019 Jun 4 18:09 package.json -rw-r--r-- 1 laudix laudix 241659 Jun 4 18:10 package-lock.json drwxr-xr-x 2 laudix laudix 4096 Jun 3 22:17 python -rw-r--r-- 1 laudix laudix 262709 Jun 3 22:17 raspberry_pi_missile_launcher.jpg -rw-r--r-- 1 laudix laudix 8088 Jun 3 22:17 README.md -rw-r--r-- 1 laudix laudix 1206 Jun 4 21:02 rposConfig.json -rw-r--r-- 1 laudix laudix 1198 Jun 3 22:17 rposConfig.release.json -rw-r--r-- 1 laudix laudix 1889 Jun 3 22:17 rpos.d.ts -rw-r--r-- 1 laudix laudix 5601 Jun 3 22:17 RPOS.njsproj -rw-r--r-- 1 laudix laudix 63867 Jun 3 22:17 RPOS_PanTiltHAT.jpg -rw-r--r-- 1 laudix laudix 955 Jun 3 22:17 RPOS.sln -rw-r--r-- 1 laudix laudix 3338 Jun 3 22:17 rpos.ts drwxr-xr-x 3 laudix laudix 4096 Jun 3 22:17 services -rw-r--r-- 1 laudix laudix 180 Jun 3 22:17 setup_v4l2rtspserver.sh -rw-r--r-- 1 laudix laudix 239 Jun 3 22:17 tsconfig.json -rw-r--r-- 1 laudix laudix 1434 Jun 3 22:17 typings.json drwxr-xr-x 12 laudix laudix 4096 Jun 4 18:25 v4l2rtspserver drwxr-xr-x 2 laudix laudix 4096 Jun 3 22:17 views drwxr-xr-x 2 laudix laudix 4096 Jun 3 22:17 web drwxr-xr-x 2 laudix laudix 4096 Jun 3 22:17 wsdl
I tried rerunning the install; still no file afterwards
laudix@RPi0-CameraUpstairs:~/rpos $ npm install npm WARN [email protected] requires a peer of typescript@~2.7.1 || >=2.8.0-dev || >=2.9.0-dev || ~3.0.0 || >=3.0.0-dev || >=3.1.0-dev || >= 3.2.0-dev || >= 3.3.0-dev but none is installed. You must install peer dependencies yourself.
up to date in 147.386s
The .ts file is written on Typescript. The install instructions have steps to compile (transpile) the Typescript into Javascript to give you the node.js file.
That is covered in Step 4 in the Readme file.
so. I wiped the SD card and reloaded the image (using a RPi Zero w/ camera attached)
uname -a
Linux raspberrypi 4.14.98+ #1200 Tue Feb 12 20:11:02 GMT 2019 armv6l GNU/Linux
Given Roger's insight, determined I hadn't copied the instructions correctly. After executing the 'missing' step: .................................................
laudix@RPi0-CameraUpstairs:~ /securitycamera/rpos $ npx gulp [21:41:00] Using gulpfile ~ /securitycamera/rpos/gulpfile.js [21:41:00] Starting 'default'... [21:41:00] Starting 'typings'... [21:41:11] Finished 'typings' after 11 s [21:41:11] Starting 'compile'... [21:42:26] Finished 'compile' after 1.25 min [21:42:26] Finished 'default' after 1.43 min laudix@RPi0-CameraUpstairs:~ /securitycamera/rpos $ ls -l total 668 drwxr-xr-x 2 laudix laudix 4096 Jun 5 19:58 bin drwxr-xr-x 2 laudix laudix 4096 Jun 5 19:58 cpp -rw-r--r-- 1 laudix laudix 3055 Jun 5 19:58 ffserver_mac.conf -rw-r--r-- 1 laudix laudix 2698 Jun 5 19:58 gulpfile.js drwxr-xr-x 2 laudix laudix 4096 Jun 5 21:42 lib -rw-r--r-- 1 laudix laudix 1128 Jun 5 19:58 LICENSE drwxr-xr-x 535 laudix laudix 20480 Jun 5 20:08 node_modules -rw-r--r-- 1 laudix laudix 1020 Jun 5 19:58 package.json -rw-r--r-- 1 laudix laudix 216511 Jun 5 20:09 package-lock.json drwxr-xr-x 2 laudix laudix 4096 Jun 5 19:58 python -rw-r--r-- 1 laudix laudix 262709 Jun 5 19:58 raspberry_pi_missile_launcher.jpg -rw-r--r-- 1 laudix laudix 8088 Jun 5 19:58 README.md -rw-r--r-- 1 laudix laudix 1198 Jun 5 19:58 rposConfig.json -rw-r--r-- 1 laudix laudix 1198 Jun 5 19:58 rposConfig.release.json -rw-r--r-- 1 laudix laudix 1889 Jun 5 19:58 rpos.d.ts -rw-r--r-- 1 laudix laudix 2133 Jun 5 21:42 rpos.js -rw-r--r-- 1 laudix laudix 5854 Jun 5 21:42 rpos.js.map -rw-r--r-- 1 laudix laudix 5601 Jun 5 19:58 RPOS.njsproj -rw-r--r-- 1 laudix laudix 63867 Jun 5 19:58 RPOS_PanTiltHAT.jpg -rw-r--r-- 1 laudix laudix 955 Jun 5 19:58 RPOS.sln -rw-r--r-- 1 laudix laudix 3338 Jun 5 19:58 rpos.ts drwxr-xr-x 3 laudix laudix 4096 Jun 5 21:42 services -rw-r--r-- 1 laudix laudix 180 Jun 5 19:58 setup_v4l2rtspserver.sh -rw-r--r-- 1 laudix laudix 239 Jun 5 19:58 tsconfig.json drwxr-xr-x 4 laudix laudix 4096 Jun 5 21:41 typings -rw-r--r-- 1 laudix laudix 1434 Jun 5 19:58 typings.json drwxr-xr-x 2 laudix laudix 4096 Jun 5 19:58 views drwxr-xr-x 2 laudix laudix 4096 Jun 5 19:58 web drwxr-xr-x 2 laudix laudix 4096 Jun 5 19:58 wsdl laudix@RPi0-CameraUpstairs:~/securitycamera/rpos $
@RogerHardiman thanks for confirming where the repos.js is created
Here's the output from step 3:
Not really sure if the warnings are expected. ....................................................
laudix@RPi0-CameraUpstairs:~/securitycamera/rpos $ npm install
npm WARN deprecated [email protected]: Typings is deprecated in favor of NPM @types -- see README for more information
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: Use agent
option with popsicle
directly
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This module relies on Node.js's internals and will break at some point. Do not use it, and update to [email protected].
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
[email protected] install /home/laudix/securitycamera/rpos/node_modules/serialport prebuild-install || node-gyp rebuild
prebuild-install WARN install No prebuilt binaries found (target=8.11.1 runtime=node arch=arm platform=linux)
make: Entering directory '/home/laudix/securitycamera/rpos/node_modules/serialport/build'
CXX(target) Release/obj.target/serialport/src/serialport.o
../src/serialport.cpp: In function ‘void EIO_AfterOpen(uv_work_t*)’:
../src/serialport.cpp:95:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated [-Wdeprecated-declarations]
data->callback.Call(2, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1740:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘void EIO_AfterUpdate(uv_work_t)’:
../src/serialport.cpp:150:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated -Wdeprecated-declarations]
data->callback.Call(1, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1740:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘void EIO_AfterClose(uv_work_t)’:
../src/serialport.cpp:188:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated -Wdeprecated-declarations]
data->callback.Call(1, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1740:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘void EIO_AfterFlush(uv_work_t)’:
../src/serialport.cpp:231:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated -Wdeprecated-declarations]
data->callback.Call(1, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1740:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘void EIO_AfterSet(uv_work_t)’:
../src/serialport.cpp:285:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated -Wdeprecated-declarations]
data->callback.Call(1, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1740:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘void EIO_AfterGet(uv_work_t)’:
../src/serialport.cpp:336:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated -Wdeprecated-declarations]
data->callback.Call(2, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1740:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘void EIO_AfterGetBaudRate(uv_work_t)’:
../src/serialport.cpp:383:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated -Wdeprecated-declarations]
data->callback.Call(2, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1740:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘void EIO_AfterDrain(uv_work_t)’:
../src/serialport.cpp:424:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated -Wdeprecated-declarations]
data->callback.Call(1, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1740:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
./Release/.deps/Release/obj.target/serialport/src/serialport.o.d.raw Stats {
dev: 45826,
mode: 33188,
nlink: 1,
uid: 1001,
gid: 1001,
rdev: 0,
blksize: 4096,
ino: 132692,
size: 1383,
blocks: 8,
atimeMs: 1559790456000,
mtimeMs: 1559790456000,
ctimeMs: 1559790456669.201,
birthtimeMs: 1559790456669.201,
atime: 2019-06-06T03:07:36.000Z,
mtime: 2019-06-06T03:07:36.000Z,
ctime: 2019-06-06T03:07:36.669Z,
birthtime: 2019-06-06T03:07:36.669Z }
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
./Release/.deps/Release/obj.target/serialport/src/serialport_unix.o.d.raw Stats {
dev: 45826,
mode: 33188,
nlink: 1,
uid: 1001,
gid: 1001,
rdev: 0,
blksize: 4096,
ino: 132692,
size: 1427,
blocks: 8,
atimeMs: 1559790479000,
mtimeMs: 1559790479000,
ctimeMs: 1559790479759.2327,
birthtimeMs: 1559790479759.2327,
atime: 2019-06-06T03:07:59.000Z,
mtime: 2019-06-06T03:07:59.000Z,
ctime: 2019-06-06T03:07:59.759Z,
birthtime: 2019-06-06T03:07:59.759Z }
CXX(target) Release/obj.target/serialport/src/poller.o
../src/poller.cpp: In static member function ‘static void Poller::onData(uv_poll_t, int, int)’:
../src/poller.cpp:69:29: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value*) const’ is deprecated [-Wdeprecated-declarations]
obj->callback.Call(2, argv);
^
In file included from ../src/poller.cpp:1:0:
../../nan/nan.h:1740:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
./Release/.deps/Release/obj.target/serialport/src/poller.o.d.raw Stats {
dev: 45826,
mode: 33188,
nlink: 1,
uid: 1001,
gid: 1001,
rdev: 0,
blksize: 4096,
ino: 132692,
size: 1353,
blocks: 8,
atimeMs: 1559790505000,
mtimeMs: 1559790505000,
ctimeMs: 1559790506009.2695,
birthtimeMs: 1559790506009.2695,
atime: 2019-06-06T03:08:25.000Z,
mtime: 2019-06-06T03:08:25.000Z,
ctime: 2019-06-06T03:08:26.009Z,
birthtime: 2019-06-06T03:08:26.009Z }
CXX(target) Release/obj.target/serialport/src/serialport_linux.o
./Release/.deps/Release/obj.target/serialport/src/serialport_linux.o.d.raw Stats {
dev: 45826,
mode: 33188,
nlink: 1,
uid: 1001,
gid: 1001,
rdev: 0,
blksize: 4096,
ino: 132692,
size: 85,
blocks: 8,
atimeMs: 1559790514000,
mtimeMs: 1559790514000,
ctimeMs: 1559790514499.2815,
birthtimeMs: 1559790514499.2815,
atime: 2019-06-06T03:08:34.000Z,
mtime: 2019-06-06T03:08:34.000Z,
ctime: 2019-06-06T03:08:34.499Z,
birthtime: 2019-06-06T03:08:34.499Z }
SOLINK_MODULE(target) Release/obj.target/serialport.node
COPY Release/serialport.node
make: Leaving directory '/home/laudix/securitycamera/rpos/node_modules/serialport/build'
npm notice created a lockfile as package-lock.json. You should commit this file.
added 717 packages from 457 contributors and audited 2792 packages in 576.433s
found 13 vulnerabilities (4 low, 2 moderate, 7 high)
run npm audit fix
to fix them, or npm audit
for details
Just to make this 'issue' complete... Once I used the instructions (including step 4) I am now able to detect and view my RPI from "ONVIF Device Manager v2.2.250"
Suggestion. Modify Step 4 layout to match the other steps so the required command is not overlooked. Specifically have "npx gulp" on a new line and indented, and prefix the comment with 'Note:"
Glad you got it working. Can you send over a Pull Request please and I can merge it in.
Thanks
Great suggestion. I think my pull request #76 addresses this, but feel free to review and suggest improvements there.