Hello,
I've just had a total meltdown of my rpi, Both the sd card and the usb hard drive got corrupted.
I have an old IBM T40. It has a built-in modem. I've loaded Q4OS and I believe that I have successfully built NCID from source. When I run ncidd, it shows in the ps list but it does not appear to open port 3333. Running ncid just hangs (probably waiting on ncidd).
After a while ncidd disappears from the ps list.
I don't really know enough about it at this point to have any idea how to diagnose/debug the problem.
Any help/guidance would be greatly appreciated.
Thank you,
Dan Essin
Anonymous
The ncidd process needs to run as root. The log file will be in /var/log/ncidd.log
The end of the log file should tell you why it is stopping. Try putting a higher number like 7 into /etc/ncid/ncidd.conf for verbose=7 to get more detailed logs.
If you're not getting a log file, try running ncidd in a window with
sudo ncidd -D -v7
so that the logging shows up in the window.
Using the logs suggested, I was able to get it to build and run. It is now open on port 3333.
I'm not sure that it's actually working.
I have the ncid app running on a windows machine. it shows me 2 entries from yesterday but then nothing.
I have tried testing by dialing the phone number. It does not answer and nothing appears in the log.
In /var/log there is a file called cidcall.log.new
there is no cidcall.log
I have tried to delete cidcall.log.new but when I do it asks me for the uucp password which is, of course, not known.
I have opened the modem with cu and can execute AT commands. The modem does not, however, say RING when I dial its number. At the moment this is running on my IBM T40 with debian 12. The modem is the one that was working on the raspberry pi before its sd card melted down.
I got this from ncidd -D -v7:
CID logfile: /var/log/cidcall.log size: 468 bytes, changed: 1695946210
writeClients:
Client 7 pos 2 from 192.168.1.138 [192.168.1.138] nodialout connected 09/29/2023 23:02:59
200 Server: ncidd [q4os-desktop:3333] (NCID) 1.14
210 API: 1.13 Feature Set 1 2 3 4 5
Client Sent: HELLO: IDENT: gateway SM-A037U1-bcd1/NCIDandroid 0.2.0.12@13api33
Client Ident: gateway SM-A037U1-bcd1/NCIDandroid 0.2.0.12@13api33
Client Sent: HELLO: CMD: no_log
Client Command Accepted: no_log
End of client HELLO data
251 Call log not sent 1695946210: /var/log/cidcall.log
Sent 'country: US' option to client
Sent LineIDs to client: "POTS"
Sent 'regex-0' option to client
300 End of connection startup
Received: REQ: ACK [09/29/2023 23:03:00]
Sent Client 7 pos 2: ACK: REQ: ACK 09/29/2023 23:03:00
As it says:
Call log not sent 1695946210: /var/log/cidcall.log
And there is no cidcall.log file.
Is this a permission issue of some kind that it can't write the file?
Any suggestions for what to do next?
Thanks
The most likely thing to have failed in your raspberry Pi is the micro SD card. You might get better results for buying a new 32 gb card and putting raspbian on it.
On your IBM T40 you need to use sudo to access the /var/log/ directory and to use the modem.
e.g.
sudo rm /var/log/cidcall.log.new
and
sudo ncidd -D -v7 |& less
The beginning of the log output will show the startup and initialization of the modem. Read through it carefully.
I tried to set a sratic ip on q4os and ended up hosing the network. I'm installing vanilla debian 11 32-bit. then I'll send the logs
i missed seeing this on first reading, but you said you were expecting to use the internal modem on the ThinkPad. It is quite possible that Linux does not have a driver for this modem, so you will need to use the external modem from your raspberry Pi setup.
You can comb through the boot sequence messages to see if it found a driver by running
sudo dmesg | less
Yes. I switched to this one that was working on the pi. I can talk to it with cu
USB 56K Voice Fax Data External V.90 V.92 Modem With Dual Ports,
thanks
I've run into a problem with the build and I can't locate any of the "undefined references" in any of the files. There were several packages that were not included in the source and were not mentioned in the prerequisites, especially all of the files in the #include "unicode/..." lines. I found a package and installed it. Doing that eliminated the compile errors but now it wont build.
This is now Debian 11 32-bit
This is the build output:
➜ ncid make package
make pkg prefix=/usr prefix2=
make[1]: Entering directory '/root/Downloads/ncid'
cd lib; make lib CC="gcc" CXX="g++" \
OFLAGS="" MFLAGS="-Wmissing-declarations -Wunused-variable -Wparentheses -Wreturn-type -Wuninitialized -Wsign-compare -Wformat -Wformat-zero-length -Wno-stringop-truncation " STRIP=
make[2]: Entering directory '/root/Downloads/ncid/lib'
make[2]: 'lib' is up to date.
make[2]: Leaving directory '/root/Downloads/ncid/lib'
cd libcarrier; make libcarrier CC="gcc" CXX="g++" \
OFLAGS="" MFLAGS="-Wmissing-declarations -Wunused-variable -Wparentheses -Wreturn-type -Wuninitialized -Wsign-compare -Wformat -Wformat-zero-length -Wno-stringop-truncation " STRIP=
make[2]: Entering directory '/root/Downloads/ncid/libcarrier'
make[2]: 'libcarrier' is up to date.
make[2]: Leaving directory '/root/Downloads/ncid/libcarrier'
cd server; make server CC="gcc" CXX="g++" \
prefix=/usr prefix2= \
prefix3= BIN=/usr/bin SBIN=/usr/sbin \
OFLAGS="" MFLAGS="-Wmissing-declarations -Wunused-variable -Wparentheses -Wreturn-type -Wuninitialized -Wsign-compare -Wformat -Wformat-zero-length -Wno-stringop-truncation " STRIP= \
RECORDING=DisconnectedNotInService.rmd HUPEXTENSION=hangup-nohangup \
RFLAGS="-Wl,-z,relro,-z,now"
make[2]: Entering directory '/root/Downloads/ncid/server'
g++ -I. -I.. -I../lib -I../libcarrier -I/usr/local/include -DCONFIG=\"/etc/ncid/ncidd.conf\" -DCIDALIAS=\"/etc/ncid/ncidd.alias\" -DBLACKLIST=\"/etc/ncid/ncidd.blacklist\" -DWHITELIST=\"/etc/ncid/ncidd.whitelist\" -DCIDLOG=\"/var/log/cidcall.log\" -DTTYPORT=\"/dev/modem\" -DDATALOG=\"/var/log/ciddata.log\" -DLOGFILE=\"/var/log/ncidd.log\" -DPIDFILE=\"/var/run/ncidd.pid\" -DLOCKFILE=\"/var/lock/lockdev/LCK..\" -DNCIDUPDATE=\"/usr/bin/cidupdate\" -DNCIDUTIL=\"/usr/bin/ncidutil\" -DNCIDEXT=\"/usr/share/ncid/extensions\" -DNCIDANN=\"/usr/share/ncid/recordings\" -DRECORDING=\"DisconnectedNotInService.rmd\" -DHUPEXTENSION=\"hangup-nohangup\" -DHASCARRIERLOOKUP -Wall -Wmissing-declarations -Wuninitialized -Wsign-compare -Wno-stringop-truncation -Wl,-rpath=/usr/lib/ncid -o ncidd ncidd.o nciddalias.o nciddhangup.o nciddmodems.o nciddexpandMESG.o nciddPN.cpp -Wl,-z,relro,-z,now -L../lib -L../libcarrier -L/usr/local/lib -lncid -lpcre2-8 -lphonenumber -lgeocoding -licuuc -lcarrier
/usr/bin/ld: /tmp/cc4HK3nH.o: in function
.L27': nciddPN.cpp:(.text+0xe13): undefined reference to
icu_57::Locale::Locale(char const, char const, char const, char const)'/usr/bin/ld: nciddPN.cpp:(.text+0xe54): undefined reference to
i18n::phonenumbers::PhoneNumberOfflineGeocoder::GetDescriptionForNumber[abi:cxx11](i18n::phonenumbers::PhoneNumber const&, icu_57::Locale const&) const' /usr/bin/ld: nciddPN.cpp:(.text+0xf26): undefined reference to
i18n::phonenumbers::PhoneNumberOfflineCarrier::GetDescriptionForNumberabi:cxx11 const'/usr/bin/ld: nciddPN.cpp:(.text+0xfc4): undefined reference to
icu_57::Locale::~Locale()' /usr/bin/ld: nciddPN.cpp:(.text+0x1461): undefined reference to
icu_57::Locale::~Locale()'collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:238: ncidd] Error 1
make[2]: Leaving directory '/root/Downloads/ncid/server'
make[1]: *** [Makefile:276: serverdir] Error 2
make[1]: Leaving directory '/root/Downloads/ncid'
make: *** [Makefile:316: package] Error 2
Last edit: Dan Essin 2023-10-04
The step-by-step instructions are in the User Manual here
https://ncid.sourceforge.io/doc/NCID-UserManual.html#instl_deb_comp
The piece you're missing is usually obtained with
sudo apt install libphonenumber-dev libicu-dev
but there's a good chance that the 32 bit distro that you're getting packages from has different versions of libphonenumber and libicu.
Editing the server/Makefile to change to the version you actually have might work (e.g. icu57 becomes icu56), but you might find there have been API changes.
Progress, but
cd gateway; make gateway CC="gcc" CXX="g++" \
prefix=/usr prefix2= \
prefix3= BIN=/usr/bin SBIN=/usr/sbin \
OFLAGS="" MFLAGS="-Wmissing-declarations -Wunused-variable -Wparentheses -Wreturn-type -Wuninitialized -Wsign-compare -Wformat -Wformat-zero-length -Wno-stringop-truncation " STRIP= \
RFLAGS="-Wl,-z,relro,-z,now"
make[2]: Entering directory '/root/Downloads/ncid/gateway'
gcc -D_BSD_SOURCE -D_DEFAULT_SOURCE -DCONFIG=\"/etc/ncid/sip2ncid.conf\" -DPIDFILE=\"/var/run/sip2ncid.pid\" -I. -I.. -I../lib -I/usr/local/include -Wmissing-declarations -Wunused-variable -Wparentheses -Wreturn-type -Wuninitialized -Wsign-compare -Wformat -Wformat-zero-length -Wno-stringop-truncation -c sip2ncid.c
In file included from sip2ncid.c:21:
sip2ncid.h:27:10: fatal error: pcap.h: No such file or directory
27 | #include <pcap.h>
| ^~~~~~~~
compilation terminated.</pcap.h>
You need to install libpcap0.8-dev. Refer to INSTALL-DEB (Debian, Raspbian or Ubuntu) in the NCID User Manual for required packages for Ubuntu.
Thanks for all the help. It's built now and running. If I just get the modem to answer...
This is the log:
➜ ~ cat x.txt
Started: 10/04/2023 20:17:01
Server: ncidd (NCID) 1.14
API: 1.13 Feature Set 1 2 3 4 5
Sysname: Linux
Nodename: T40
Machine: i686
Release: 5.10.0-25-686
Version: #1 SMP Debian 5.10.191-1 (2023-08-16)
Command line: /usr/sbin/ncidd
--pidfile /run/ncidd.pid
Logfile: /var/log/ncidd.log
Processed config file: /etc/ncid/ncidd.conf
Verbose level: 1
cidinput = 0
sendinfo = 1
Configured to send 'cidlog' to clients.
Configured to send 'cidinfo' to clients.
Helper tools:
/usr/bin/cidupdate
/usr/bin/ncidutil
country code set to : US
all-hyphen format (2): xxx-xxx-xxxx
Using simple expressions for alias/blacklist/whitelist entries
Begin: Loading alias, blacklist and whitelist files [20:17:01]
Processed alias file: /etc/ncid/ncidd.alias
Alias Table:
Number of Entries: 0
Processed blacklist file: /etc/ncid/ncidd.blacklist
Blacklist Table:
Number of Entries: 19
Processed whitelist file: /etc/ncid/ncidd.whitelist
Whitelist Table:
Number of Entries: 0
Leading 1 in call & alias/blacklist/whitelist not ignored
End: Loaded alias, blacklist and whitelist files [20:17:01]
CID logfile: /var/log/cidcall.log
CID logfile maximum size: 1000000 bytes
Data logfile not present: /var/log/ciddata.log
Hostname & Port: T40:3333
Telephone Line Identifier: POTS
TTY port speed: 115200
TTY lock file: /var/lock/LCK..ttyACM0
TTY port control signals enabled
Modem will be used for Caller ID
Does not handle modem calls without Caller ID
Caller ID from a modem and optional gateways
Modem also used to dial number
Dial Modem: POTS
Dial Timeout: 5 seconds
LineIDS: "POTS"
TTY port opened: /dev/ttyACM0
TTY port initialized in ICANON mode.
Checking Modem Capabilities...
TTY port changed to RAW mode.
Modem Initialized
Query modem software
Modem Identifier: CX93001-EIS_V0.2013-V92
Query chipset version
Modem Chipset Version: 0000000000
Query modem country setting (United States = B5)
Modem country code: B5 United States
Query active profile
Modem ACTIVE PROFILE:
B1 E1 L2 M1 N0 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0
S00:0 S01:0 S02:43 S03:13 S04:10 S05:8 S06:2 S07:50 S08:1 S09:6
S10:14 S11:85 S12:50 S18:0 S25:5 S26:1 S36:7 S38:20 S46:138 S48:7
S95:0
Query modem modes supported
Modem supports Data Mode
Modem supports FAX Mode 1
Modem supports FAX Mode 2
Modem supports VOICE Mode
TTY port changed to ICANON mode.
TTY port changed to RAW mode.
Modem initialized.
Modem Snooping CID (off = 0 on = 1 or 2): 0
Modem set for CallerID.
TTY port changed to ICANON mode.
Modem detected
Modem used for Caller ID
/etc/ncid/ncidd.conf declares 1 modems and/or serial devices
Maximum number of clients/gateways: 50
ncidd set for country US
ncidd US phonenumber format 2: xxx-xxx-xxxx
Wrote pid 1332 in pidfile: /run/ncidd.pid
End of startup: 10/04/2023 20:17:03
Well, when all else fails, change the phone wire.
it's answering now.
Thanks again
Dan
Problems solved.