Open comet424 opened 3 years ago
The project is pretty old and not maintained, I think you are referring to the installation of node.js? In that case probably easiest to search for tutorials installing node.js on your device.
Regarding functionality for Home Assistant, I'm not planning on continuing development for this project.
ah ok thank you.. ya was the node.js thing.. ill. look.. thanks.. as i interested in getting this running for my mom she having hard time reading the phone.. picked up a phone with big buttons.. and id like to put this setup over the phone so she can read it..
thanks for replying i appreciate it.. and great thing you did your mom too
If her hearing is still ok you can also look into combining the CallerPi with a Google Home speaker.
Using Node Red (https://flows.nodered.org/node/node-red-contrib-cast) you could do a POST call from the CallerPi software to Node Red which would broadcast the message to the speaker.
It is a lot more installing and configuring to get working though.
ah ok so i got the nvm npm node.js installed i just dont know how to install your program
i tried
apt get install CallerPi
but that didnt work how do i do the apt get
Try running it by going to the directory where app.js is located and execute the command "node app.js" https://nodejs.org/en/docs/guides/getting-started-guide/
ok. so i did figure how to install CallerPi i had to type "sudo git clone https://github.com/kjepper/CallerPi.git" took a while.. when i run "node app.js" or "sudo node app.js" i get error
" pi@raspberrypi:~/CallerPi $ node app.js /home/pi/CallerPi/libs/modemlistener.js:5 parser: serialport.parsers.readline("\n") ^
TypeError: serialport.parsers.readline is not a function
at Object.
my steps i did to get there was i ran curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - sudo apt install nodejs curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
npm install express npm install serialport npm install nedb --save sudo apt-get install chromium x11-xserver-utils unclutter
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart sudo nano /etc/xdg/lxsession/LXDE/autostart
@lxpanel --profile LXDE-pi @pcmanfm --desktop --profile LXDE-pi @xscreensaver -no-splash @xset s off @xset -dpms @xset s noblank @sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences @chromium --noerrdialogs --kiosk ~/CallerPi/public/index.html @chromium --noerrdialogs --kiosk ~/CallerPi/public/index.html --incognito
so far i done.. i didnt add the "node app.js" to the rc.local or config.txt to boot yet as i didnt get that far
also if i install nvm install --lts nvm install 8.9.4
pi@raspberrypi:~/CallerPi $ node app.js /home/pi/node_modules/bindings/bindings.js:121 throw e; ^
Error: The module '/home/pi/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using npm rebuild
or npm install
).
at Object.Module._extensions..node (module.js:672:18)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at bindings (/home/pi/node_modules/bindings/bindings.js:112:48)
at Object.
This might be due to incorrect port (if you didn't change that one) or because you are using the latest version of serialport which uses different code to initialize.
Please check that "global.modemPort" is set to the correct value in app.js
If that is the case see below snippet which you may need to replace in modemlistener.js, it might need some changes to work in your code.
//Load and initialize the serial modem and set parser
var SerialPort = require('serialport');
var Readline = require('@serialport/parser-readline');
var port = new SerialPort(global.modemPort);
var parser = port.pipe(new Readline({ delimiter: '\n' }));
//Respond to data received from modem
parser.on('data', function(data) {
console.log('Data received: ' + data);
//If data contains a number extract it and activate the current caller.
if(data.indexOf("NMBR=") > -1){
var phoneNumber = data.substring(5);
phoneNumber = phoneNumber.substring(0, phoneNumber.length-1);
console.log('Callers number: ' + phoneNumber);
global.callHandler.receiveCall(phoneNumber);
}
});
i didnt change anything just ran the steps u see above
app.js "//The current active caller global.activeCaller = {activeCaller:false}; //Timeout for when current call ends (since we can't monitor if call is still ongoing) global.activeCallerTimeOut = null; //global.modemPort = "/dev/ttyACM0"; global.modemPort = "COM1";
//Loading own libraries
global.callHandler = require('./libs/callhandler');
global.modemListener = require('./libs/modemlistener');
"
modem
//Load and initialize the serial modem and set parser
var serialport = require("serialport");
var SerialPort = serialport.SerialPort;
var sp = new SerialPort(modemPort, {
parser: serialport.parsers.readline("\n")
});
//Respond to data received from modem sp.on('data', function(data) { console.log('Data received: ' + data); //If data contains a number extract it and activate the current caller. if(data.indexOf("NMBR=") > -1){ var phoneNumber = data.substring(5); phoneNumber = phoneNumber.substring(0, phoneNumber.length-1); console.log('Callers number: ' + phoneNumber); global.callHandler.receiveCall(phoneNumber); } so do i change the code to what you got above then? wish i was better at this stuff lol
so i altered the code.. i kept the sp.pipe.. as i not good in nano to search and replace all sp. to port
but i had to recomple nvm rebuild
but when i ran it i got another error.. not sure where to look? and there is no util command i guess i have to install it?
pi@raspberrypi:~/CallerPi $ node app.js (node:31735) [DEP0025] DeprecationWarning: sys is deprecated. Use util instead. events.js:183 throw er; // Unhandled 'error' event ^
Error: listen EACCES 0.0.0.0:80
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1334:19)
at listenInCluster (net.js:1392:12)
at Server.listen (net.js:1476:7)
at Function.listen (/home/pi/node_modules/express/lib/application.js:618:24)
at Object.
I pushed some changes to the master branch, please pull the latest code. I rewrote the modemlistener to work with the latest version.
Are you using an usb modem on a linux machine? In that case it might now be able to find it with the new code.
i not sure how to pull? i kinda new to this stuff im more a windows user
id like to run it in a ubunutu VM be nice so it just runs off my unraid server..
but i followed ur setup but i bought a Raspberry Pi 4 4GB running latest Rasbian.. and then i tried to follow ur instructions the few steps you included then followed the Kiosk setup where i added ~/CallerID/public/index.html as i dont have a webpage and ur instructions didnt say what do i need to change.. but i think the "node app.js" is the website? and then i should change ~/CallerID/public/index.html to "http://192.168.0.12" thats the ip address of my raspberry pi.
i wasnt 100% sure i not fluent with linux raspberry pis i more of windows user so i learning as i go
but wanted to set this up for my home.. running on ubunut VM but also on a Raspberry Pi for my mother .. but also be able to run from more then 1 screen she has 4 phone locations.. and what i was hoping to do was also put a tablet at each phone location so then each location would populate your program but only need 1 raspberry pi.. but i not there yet still trying to get this to work but thats my idea.. but i not sure i can get it to work off a tablet as a keyosk.. unles i had 4 of those setups
you did "sudo git clone https://github.com/kjepper/CallerPi.git" which downloads the complete code, either do that again so you get the latest code or do a git pull which updates your current code with that latest changes. https://git-scm.com/docs/git-pull
The node app will communicate with the modem and also act as a webserver which you can reach in the browser from another device.
It's important that "global.modemPort" in app.js is set to the location of your modem, if your modem is using USB then it might already be correct with the new code. Else you need to figure out what the address is.
ok so then ill change the ~/callerpi/public/index.html; to http://192.168.0.12 and ya my modem is usb and its set for AMC0 i think its teh default one anyways
so doing the clone didnt work 2nd time i did the pull but it talked about a merg? im guessing i done something wrong i not expert at this .. do i use
sudo git merg https://github.com/kjepper/CallerPi.git
`pi@raspberrypi:~/CallerPi $ sudo git clone https://github.com/kjepper/CallerPi.git Cloning into 'CallerPi'... remote: Enumerating objects: 7, done. remote: Counting objects: 100% (7/7), done. remote: Compressing objects: 100% (7/7), done. remote: Total 54 (delta 1), reused 0 (delta 0), pack-reused 47 Unpacking objects: 100% (54/54), done. pi@raspberrypi:~/CallerPi $ node app.js (node:1881) [DEP0025] DeprecationWarning: sys is deprecated. Use util instead. events.js:183 throw er; // Unhandled 'error' event ^
Error: listen EACCES 0.0.0.0:80
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1334:19)
at listenInCluster (net.js:1392:12)
at Server.listen (net.js:1476:7)
at Function.listen (/home/pi/node_modules/express/lib/application.js:618:24)
at Object.
Error: listen EACCES 0.0.0.0:80
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1334:19)
at listenInCluster (net.js:1392:12)
at Server.listen (net.js:1476:7)
at Function.listen (/home/pi/node_modules/express/lib/application.js:618:24)
at Object.
You probably already made changes, and now it tries to merge those. You could merge them, delete them and clone again or make a new folder and clone in there.
Btw the deprecated warning can be ignored.
http://192.168.0.12 should be reachable from another device on the same network if the app.js is able to start properly.
so it didnt wanna work .. still having issues.. so i did a sudo rm -r ~/CallerID i rebooted and ssh'd and then i did this.. i guessing i did something wrong `pi@raspberrypi:~ $ sudo git clone https://github.com/kjepper/CallerPi.git Cloning into 'CallerPi'... remote: Enumerating objects: 7, done. remote: Counting objects: 100% (7/7), done. remote: Compressing objects: 100% (7/7), done. remote: Total 54 (delta 1), reused 0 (delta 0), pack-reused 47 Unpacking objects: 100% (54/54), done. pi@raspberrypi:~ $ cd CallerPi pi@raspberrypi:~/CallerPi $ nano app.js pi@raspberrypi:~/CallerPi $ ^C pi@raspberrypi:~/CallerPi $ node app.js /home/pi/node_modules/bindings/bindings.js:121 throw e; ^
Error: The module '/home/pi/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 83. Please try re-compiling or re-installing
the module (for instance, using npm rebuild
or npm install
).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at bindings (/home/pi/node_modules/bindings/bindings.js:112:48)
at Object.
@serialport/bindings@9.0.4 install /home/pi/node_modules/@serialport/bindings prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
prebuild-install WARN install No prebuilt binaries found (target=14.15.4 runtime=node arch=arm libc= platform=linux)
make: Entering directory '/home/pi/node_modules/@serialport/bindings/build'
CXX(target) Release/obj.target/bindings/src/serialport.o
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:78:69: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
uv_queue_work(uv_default_loop(), req, EIO_Open, (uv_after_work_cb)EIO_AfterOpen);
^~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:135:71: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
uv_queue_work(uv_default_loop(), req, EIO_Update, (uv_after_work_cb)EIO_AfterUpdate);
^~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:175:70: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
uv_queue_work(uv_default_loop(), req, EIO_Close, (uv_after_work_cb)EIO_AfterClose);
^~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:215:70: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
uv_queue_work(uv_default_loop(), req, EIO_Flush, (uv_after_work_cb)EIO_AfterFlush);
^~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:270:68: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
uv_queue_work(uv_default_loop(), req, EIO_Set, (uv_after_work_cb)EIO_AfterSet);
^~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Get(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:314:68: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
uv_queue_work(uv_default_loop(), req, EIO_Get, (uv_after_work_cb)EIO_AfterGet);
^~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE GetBaudRate(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:363:76: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
uv_queue_work(uv_default_loop(), req, EIO_GetBaudRate, (uv_after_work_cb)EIO_AfterGetBaudRate);
^~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:409:70: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
uv_queue_work(uv_default_loop(), req, EIO_Drain, (uv_after_work_cb)EIO_AfterDrain);
^~~~~~
../src/serialport.cpp: At global scope:
../src/serialport.cpp:430:28: warning: unnecessary parentheses in declaration of ‘ToParityEnum’ [-Wparentheses]
SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local~~~~
../src/serialport.cpp:483:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(serialport, init);
^~~
CXX(target) Release/obj.target/bindings/src/serialport_unix.o
../src/serialport_unix.cpp: In function ‘int setup(int, OpenBaton*)’:
../src/serialport_unix.cpp:176:60: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1005 [-Wformat-truncation=]
snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path);
^~~~~~~~~
../src/serialport_unix.cpp:176:13: note: ‘snprintf’ output 20 or more bytes (assuming 1043) into a destination of size 1024
snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path);
../src/serialport_unix.cpp: In function ‘void EIO_Open(uv_work_t*)’:
../src/serialport_unix.cpp:86:60: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1003 [-Wformat-truncation=]
snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport_unix.cpp:86:13: note: ‘snprintf’ output 22 or more bytes (assuming 1045) into a destination of size 1024
snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CXX(target) Release/obj.target/bindings/src/poller.o
CXX(target) Release/obj.target/bindings/src/serialport_linux.o
SOLINK_MODULE(target) Release/obj.target/bindings.node
COPY Release/bindings.node
make: Leaving directory '/home/pi/node_modules/@serialport/bindings/build'
> serialport@9.0.4 postinstall /home/pi/node_modules/serialport
> node thank-you.js
Thank you for using serialport!
If you rely on this package, please consider supporting our open collective:
> https://opencollective.com/serialport/donate
@serialport/binding-abstract@9.0.2 /home/pi/node_modules/@serialport/binding-abstract
debug@4.3.1 /home/pi/node_modules/@serialport/binding-abstract/node_modules/debug
ms@2.1.2 /home/pi/node_modules/@serialport/binding-abstract/node_modules/ms
@serialport/binding-mock@9.0.2 /home/pi/node_modules/@serialport/binding-mock
debug@4.3.1 /home/pi/node_modules/@serialport/binding-mock/node_modules/debug
ms@2.1.2 /home/pi/node_modules/@serialport/binding-mock/node_modules/ms
@serialport/bindings@9.0.4 /home/pi/node_modules/@serialport/bindings
@serialport/parser-readline@9.0.1 /home/pi/node_modules/@serialport/parser-readline
@serialport/parser-delimiter@9.0.1 /home/pi/node_modules/@serialport/parser-delimiter
bindings@1.5.0 /home/pi/node_modules/bindings
file-uri-to-path@1.0.0 /home/pi/node_modules/file-uri-to-path
debug@4.3.1 /home/pi/node_modules/@serialport/bindings/node_modules/debug
ms@2.1.2 /home/pi/node_modules/@serialport/bindings/node_modules/ms
nan@2.14.2 /home/pi/node_modules/nan
prebuild-install@6.0.0 /home/pi/node_modules/prebuild-install
detect-libc@1.0.3 /home/pi/node_modules/detect-libc
expand-template@2.0.3 /home/pi/node_modules/expand-template
github-from-package@0.0.0 /home/pi/node_modules/github-from-package
minimist@1.2.5 /home/pi/node_modules/minimist
mkdirp-classic@0.5.3 /home/pi/node_modules/mkdirp-classic
napi-build-utils@1.0.2 /home/pi/node_modules/napi-build-utils
node-abi@2.19.3 /home/pi/node_modules/node-abi
semver@5.7.1 /home/pi/node_modules/semver
noop-logger@0.1.1 /home/pi/node_modules/noop-logger
npmlog@4.1.2 /home/pi/node_modules/npmlog
are-we-there-yet@1.1.5 /home/pi/node_modules/are-we-there-yet
delegates@1.0.0 /home/pi/node_modules/delegates
readable-stream@2.3.7 /home/pi/node_modules/readable-stream
core-util-is@1.0.2 /home/pi/node_modules/core-util-is
inherits@2.0.3 /home/pi/node_modules/inherits
isarray@1.0.0 /home/pi/node_modules/isarray
process-nextick-args@2.0.1 /home/pi/node_modules/process-nextick-args
safe-buffer@5.1.2 /home/pi/node_modules/safe-buffer
string_decoder@1.1.1 /home/pi/node_modules/string_decoder
util-deprecate@1.0.2 /home/pi/node_modules/util-deprecate
console-control-strings@1.1.0 /home/pi/node_modules/console-control-strings
gauge@2.7.4 /home/pi/node_modules/gauge
aproba@1.2.0 /home/pi/node_modules/aproba
has-unicode@2.0.1 /home/pi/node_modules/has-unicode
object-assign@4.1.1 /home/pi/node_modules/object-assign
signal-exit@3.0.3 /home/pi/node_modules/signal-exit
string-width@1.0.2 /home/pi/node_modules/string-width
code-point-at@1.1.0 /home/pi/node_modules/code-point-at
is-fullwidth-code-point@1.0.0 /home/pi/node_modules/is-fullwidth-code-point
number-is-nan@1.0.1 /home/pi/node_modules/number-is-nan
strip-ansi@3.0.1 /home/pi/node_modules/strip-ansi
ansi-regex@2.1.1 /home/pi/node_modules/ansi-regex
wide-align@1.1.3 /home/pi/node_modules/wide-align
set-blocking@2.0.0 /home/pi/node_modules/set-blocking
pump@3.0.0 /home/pi/node_modules/pump
end-of-stream@1.4.4 /home/pi/node_modules/end-of-stream
once@1.4.0 /home/pi/node_modules/once
wrappy@1.0.2 /home/pi/node_modules/wrappy
rc@1.2.8 /home/pi/node_modules/rc
deep-extend@0.6.0 /home/pi/node_modules/deep-extend
ini@1.3.8 /home/pi/node_modules/ini
strip-json-comments@2.0.1 /home/pi/node_modules/strip-json-comments
simple-get@3.1.0 /home/pi/node_modules/simple-get
decompress-response@4.2.1 /home/pi/node_modules/decompress-response
mimic-response@2.1.0 /home/pi/node_modules/mimic-response
simple-concat@1.0.1 /home/pi/node_modules/simple-concat
tar-fs@2.1.1 /home/pi/node_modules/tar-fs
chownr@1.1.4 /home/pi/node_modules/chownr
tar-stream@2.2.0 /home/pi/node_modules/tar-stream
bl@4.0.3 /home/pi/node_modules/bl
buffer@5.7.1 /home/pi/node_modules/buffer
base64-js@1.5.1 /home/pi/node_modules/base64-js
ieee754@1.2.1 /home/pi/node_modules/ieee754
inherits@2.0.4 /home/pi/node_modules/bl/node_modules/inherits
readable-stream@3.6.0 /home/pi/node_modules/bl/node_modules/readable-stream
fs-constants@1.0.0 /home/pi/node_modules/fs-constants
readable-stream@3.6.0 /home/pi/node_modules/tar-stream/node_modules/readable-stream
tunnel-agent@0.6.0 /home/pi/node_modules/tunnel-agent
which-pm-runs@1.0.0 /home/pi/node_modules/which-pm-runs
@serialport/parser-byte-length@9.0.1 /home/pi/node_modules/@serialport/parser-byte-length
@serialport/parser-cctalk@9.0.1 /home/pi/node_modules/@serialport/parser-cctalk
@serialport/parser-ready@9.0.1 /home/pi/node_modules/@serialport/parser-ready
@serialport/parser-regex@9.0.1 /home/pi/node_modules/@serialport/parser-regex
@serialport/stream@9.0.2 /home/pi/node_modules/@serialport/stream
debug@4.3.1 /home/pi/node_modules/@serialport/stream/node_modules/debug
ms@2.1.2 /home/pi/node_modules/@serialport/stream/node_modules/ms
accepts@1.3.7 /home/pi/node_modules/accepts
mime-types@2.1.28 /home/pi/node_modules/mime-types
mime-db@1.45.0 /home/pi/node_modules/mime-db
negotiator@0.6.2 /home/pi/node_modules/negotiator
array-flatten@1.1.1 /home/pi/node_modules/array-flatten
async@0.2.10 /home/pi/node_modules/async
binary-search-tree@0.2.5 /home/pi/node_modules/binary-search-tree
underscore@1.4.4 /home/pi/node_modules/underscore
body-parser@1.19.0 /home/pi/node_modules/body-parser
bytes@3.1.0 /home/pi/node_modules/bytes
content-type@1.0.4 /home/pi/node_modules/content-type
debug@2.6.9 /home/pi/node_modules/debug
ms@2.0.0 /home/pi/node_modules/ms
depd@1.1.2 /home/pi/node_modules/depd
http-errors@1.7.2 /home/pi/node_modules/http-errors
setprototypeof@1.1.1 /home/pi/node_modules/setprototypeof
statuses@1.5.0 /home/pi/node_modules/statuses
toidentifier@1.0.0 /home/pi/node_modules/toidentifier
iconv-lite@0.4.24 /home/pi/node_modules/iconv-lite
safer-buffer@2.1.2 /home/pi/node_modules/safer-buffer
on-finished@2.3.0 /home/pi/node_modules/on-finished
ee-first@1.1.1 /home/pi/node_modules/ee-first
qs@6.7.0 /home/pi/node_modules/qs
raw-body@2.4.0 /home/pi/node_modules/raw-body
unpipe@1.0.0 /home/pi/node_modules/unpipe
type-is@1.6.18 /home/pi/node_modules/type-is
media-typer@0.3.0 /home/pi/node_modules/media-typer
content-disposition@0.5.3 /home/pi/node_modules/content-disposition
cookie@0.4.0 /home/pi/node_modules/cookie
cookie-signature@1.0.6 /home/pi/node_modules/cookie-signature
destroy@1.0.4 /home/pi/node_modules/destroy
encodeurl@1.0.2 /home/pi/node_modules/encodeurl
escape-html@1.0.3 /home/pi/node_modules/escape-html
etag@1.8.1 /home/pi/node_modules/etag
express@4.17.1 /home/pi/node_modules/express
finalhandler@1.1.2 /home/pi/node_modules/finalhandler
parseurl@1.3.3 /home/pi/node_modules/parseurl
fresh@0.5.2 /home/pi/node_modules/fresh
merge-descriptors@1.0.1 /home/pi/node_modules/merge-descriptors
methods@1.1.2 /home/pi/node_modules/methods
path-to-regexp@0.1.7 /home/pi/node_modules/path-to-regexp
proxy-addr@2.0.6 /home/pi/node_modules/proxy-addr
forwarded@0.1.2 /home/pi/node_modules/forwarded
ipaddr.js@1.9.1 /home/pi/node_modules/ipaddr.js
range-parser@1.2.1 /home/pi/node_modules/range-parser
send@0.17.1 /home/pi/node_modules/send
mime@1.6.0 /home/pi/node_modules/mime
ms@2.1.1 /home/pi/node_modules/send/node_modules/ms
serve-static@1.14.1 /home/pi/node_modules/serve-static
utils-merge@1.0.1 /home/pi/node_modules/utils-merge
vary@1.1.2 /home/pi/node_modules/vary
immediate@3.0.6 /home/pi/node_modules/immediate
lie@3.1.1 /home/pi/node_modules/lie
localforage@1.9.0 /home/pi/node_modules/localforage
mkdirp@0.5.5 /home/pi/node_modules/mkdirp
nedb@1.8.0 /home/pi/node_modules/nedb
serialport@9.0.4 /home/pi/node_modules/serialport
debug@4.3.1 /home/pi/node_modules/serialport/node_modules/debug
ms@2.1.2 /home/pi/node_modules/serialport/node_modules/ms
pi@raspberrypi:~/CallerPi $ node app.js
(node:1887) [DEP0025] DeprecationWarning: sys is deprecated. Use util instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
events.js:292
throw er; // Unhandled 'error' event
^
Error: listen EACCES: permission denied 0.0.0.0:80
at Server.setupListenHandle [as _listen2] (net.js:1301:21)
at listenInCluster (net.js:1366:12)
at Server.listen (net.js:1452:7)
at Function.listen (/home/pi/node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (/home/pi/CallerPi/app.js:65:18)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1345:8)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'EACCES',
errno: -13,
syscall: 'listen',
address: '0.0.0.0',
port: 80
}
pi@raspberrypi:~/CallerPi $ lsusb -l
lsusb: invalid option -- 'l'
Usage: lsusb [options]...
List USB devices
-v, --verbose
Increase verbosity (show descriptors)
-s [[bus]:][devnum]
Show only devices with specified device and/or
bus numbers (in decimal)
-d vendor:[product]
Show only devices with the specified vendor and
product ID numbers (in hexadecimal)
-D device
Selects which device lsusb will examine
-t, --tree
Dump the physical USB device hierarchy as a tree
-V, --version
Show version of program
-h, --help
Show usage and help
pi@raspberrypi:~/CallerPi $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0572:1349 Conexant Systems (Rockwell), Inc.
Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~/CallerPi $ lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 3: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 3: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 4: Dev 4, If 1, Class=CDC Data, Driver=cdc_acm, 12M
|__ Port 4: Dev 4, If 0, Class=Communications, Driver=cdc_acm, 12M
pi@raspberrypi:~/CallerPi $`
and when i run that dmesg
for the modem its
[ 4.743167] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
so should i just reformat Pi and start over?
Try running it as root or execute using sudo, "sudo node app.js"
didnt help `pi@raspberrypi:~/CallerPi $ sudo node app.js /home/pi/node_modules/bindings/bindings.js:121 throw e; ^
Error: The module '/home/pi/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using npm rebuild
or npm install
).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at bindings (/home/pi/node_modules/bindings/bindings.js:112:48)
at Object.
so i guess its working?? but depreciated too.
this time i did
"sudo npm rebuild" and then
pi@raspberrypi:~/CallerPi $ sudo node app.js (node:3170) [DEP0025] DeprecationWarning: sys is deprecated. Use util instead. Enabling CallerId nice Data received: Data received: OK
pi@raspberrypi:~/CallerPi $ sudo node app.js (node:3170) [DEP0025] DeprecationWarning: sys is deprecated. Use util instead. Enabling CallerId nice Data received: Data received: OK
That looks like it's working, or at least it's running correctly. You should be able to reach it using a browser. Ofcourse it could still be that things like connecting to the modem or extracting the phone number need some work.
so when i goto 192.168.0.12 its the black screen
so do it is printing on screen { activeCaller: false } { activeCaller: false } { activeCaller: false } { activeCaller: false } { activeCaller: false } { activeCaller: false }
so for the autostart
do i change the ~/CallerID/publuic
to http://192.168.0.12
and to autostart when you start up the pi is it
rc.local file sudo node ~/CallerID/app.js &
oh so modem things need tweaking then? so now i just have to wait for someone to call lol so far just a black screen on the webpage is that what you wanna see first
It works like this, the webserver delivers data using REST calls and also serves a dumb HTML page. The HTML page uses javascript to call the webserver using the REST calls to get data. So every second it will call get current caller to see if someone is calling.
To test things you could manually do a REST calls (these also work by just going to the url in a browser)
Simulate caller: http://192.168.0.12/api/debug/fakecall/2342323 (change 2342323 to any number you want to fake).
Add name to a number: http://192.168.0.12/api/insert?phoneNumber=123&firstName=aaaa&lastName=bbb
List ports (I don't know exactly what this shows?) http://192.168.0.12/api/debug/listports
so i read and u need to add it i guess to the rc.local like this but it wasnt working
so i tried to run in the command line and i get that throw error again pi@raspberrypi:/etc $ su Password: su: Authentication failure pi@raspberrypi:/etc $ sudo pi -c 'node /home/pi/CallerPI/app.js < /dev/null &' sudo: pi: command not found pi@raspberrypi:/etc $ sudo -i
SSH is enabled and the default password for the 'pi' user has not been changed. This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
Wi-Fi is currently blocked by rfkill. Use raspi-config to set the country before use.
root@raspberrypi:~# su root@raspberrypi:~# su pi -c 'node /home/pi/CallerPI/app.js < /dev/null &' root@raspberrypi:~# internal/modules/cjs/loader.js:638 throw err; ^
Error: Cannot find module '/home/pi/CallerPI/app.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) ^C root@raspberrypi:~# cd /home/pi root@raspberrypi:/home/pi# cd CallerPi root@raspberrypi:/home/pi/CallerPi# ls app.js db libs LICENSE public README.md root@raspberrypi:/home/pi/CallerPi# node app.js (node:2132) [DEP0025] DeprecationWarning: sys is deprecated. Use util instead. Enabling CallerId nice Data received: Data received: OK
so the listports link gives me ReferenceError: serialport is not defined at listPorts (/home/pi/CallerPi/libs/modemlistener.js:36:5) at Object.listPorts (/home/pi/CallerPi/libs/modemlistener.js:30:5) at /home/pi/CallerPi/app.js:51:26 at Layer.handle [as handle_request] (/home/pi/node_modules/express/lib/router/layer.js:95:5) at next (/home/pi/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/home/pi/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/home/pi/node_modules/express/lib/router/layer.js:95:5) at /home/pi/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/home/pi/node_modules/express/lib/router/index.js:335:12) at next (/home/pi/node_modules/express/lib/router/index.js:275:10)
also is there an editor for the gui? so far its seems to be working gotta fix the phone number thing i gotta find so when a number 1-123-123-1234 comes up it displays it as long distance and 123-123-1234 comes up for local numbers but least i seen it on the web browser and i like it as u hit enter for the fake.. it pretty much instantly updates the webpage i like that as its not delayed
so when i goto 192.168.0.12 on my browser it displays like 4 calls and then right away goes to fake calls i made how does it display the Callers i tried clicking the webpage but i guess its ment for the raspberry pis screen not a regular page .. i gotta plug the raspberry pi into tv i using it headless at the moment. but looks good so far does it let u change the picture if u save an image for certain caller
When someone calls it will show that caller for 5 minutes (it doesn't know when the call is ended).
To setup the raspberry to start the node app and browser in kiosk mode is a bit of work, I struggled to get that working myself 5 years ago. You can also use another device with a webbrowser to display the webpage with callers, or create something that calls the REST endpoints to retrieve the caller data/status in json format.
The formatting of the number is probably something you need to adapt since it was specifically made for my countries format.
The webpage itself doesn't do anything, it was meant to only display recent callers or display current caller for 5 minutes. You could press middle mouse button to highlight that you seen the recent callers (it will reset when refreshing the page).
ah ok ya i just fiddling i currently trying to get that turn off the hdmi to work. for screen saver.. just trying to follow instructions
ya in canada when we get a normal call its (area code)-(number)-(number) 123-123-1234 when long distance or outside of the country (country number)-(area)-(number)-(number) 1-223-222-2222 or 066-222-222-2222
ya so far having 0 luck raspberry pi not and just trying to get the hdmi on off.. but least the main part work least you got me this far,, your program will help my mom i just need to figure to play with it.. least its full screen display which i really like as she cant see the display on the phones.. i planning to get her another phone with the Big Buttons they just dont make cordless with big buttons so ur stuck with the cord
i tried installing your program but it doesnt work get 404 error for the first line of the installation..
and any new tweaks or MQTT offerings so can read it on a Home Assistant screen