RSS

Prowl and Ncid – CallerID forwarded to your iPhone, iPad or iPod

09 Feb

I have installed Prowl on my iPhone and hooked up a modem that supports CallerID to my Ubuntu Linux PC and I’ve got it working so that when someone calls my home phone line I now get a message sent to my iPhone.  This comes in handy when I’m waiting for a call at home but I can’t be there all the time and when the phone rings at home and I’m not close to the land line I can see on my iPhone if it’s for me or the rest of the family.

I’ve documented how I set it up here…  If you are comfortable with Linux and the command line this should be straight forward.

I updated the bash script with examples of how to add more personalized names based on the phone number called and added Richard Dansereau’s method of displaying the messages, also added call logging too…

  • First install the Prowl app (cool Growl for OS-X and Growl for Windows notification app) on your iPhone – $2.99
  • Login into the Prowl website and get an API key for your iPhone, you will need this in the ncid-prowl module (I’ll explain later)
  • Install the ncid software by opening a terminal on your Ubuntu PC and typing
  • $ sudo apt-get install ncid
  • Enter the sudo password and “Y” when asked if you want to continue (to install).
  • Install the curl software on your Ubuntu PC, typing
  • $ sudo apt-get install curl
  • If you do this soon after the ncid apt-get install you wont need to enter the sudo password again.
  • Press “Y” when asked if you want to continue to install.
  • I have an external USRobotics modem that I plug into the serial port on the back of my PC.  It uses device dev/ttyS0 (I/O 0x3f8 ,irq =4) so I had to change the ncidd.config file to use this port.  The default modem config didn’t work.  So make sure you have serial port  enabled in your BIOS then tweak the ncidd.conf file (make sure it has two d’s “ncidd.config” and not “ncid.config”).
  • I used $ sudo nano /etc/ncid/ncidd.conf and changed the line “# set ttyport = /dev/ttyS0″ to “set ttyport = /dev/ttyS0″ removing the “#” at the beginning, and setting it to my serial port (ctrl-x to save and exit the nano editor)
  • Test your modem is working with ncid by starting up the ncid server
  • $ sudo invoke-rc.d ncidd start
  • Try the standard ncid client
  • $ ncid
  • Call your landline from your iPhone and hopefully you see your number show up in the ncid displaybox on your pc
  • (If not read up on the ncid website to get it working)
  • Once it’s working close the ncid program
  • Next we need to modify the ncid-skel shell script to work with ‘Curl’ to send our CallerID message to the prowl server.
  • Using nano again copy the following script into the /usr/share/ncid directory calling the file “ncid-prowl”.

#!/bin/sh
# ncid-prowl Output Module
# Modify as needed for new module
# keep “ncid-” in the name
# input is 5 lines obtained from ncid
# input: DATEnTIMEnNUMBERnNAMEnLINEn
#
# input is 5 lines if a message was sent
# input: nnnMESSAGEnn
# Message will be in $CIDNAME
#
# ncid usage:
# ncid –no-gui [--message] –program ncid-prowl
ConfigDir=/etc/ncid
ConfigFile=$ConfigDir/ncidmodules.conf 

[ -f $ConfigFile ] && . $ConfigFile
read CIDDATE
read CIDTIME
read CIDNMBR
read CIDNAME
read CIDLINE
# Paste your apikey from the prowl website in the following line
apikey=0000000000000000000000000000000000000000

T1=$CIDNAME
#Personalize the call message name for specific numbers
#Add as many numbers and names you want copying the format of the two examples below
if [ "$CIDNMBR" = "555-555-1234" ]; then
T1=”Sam’s iPhone”
fi
if [ "$CIDNMBR" = "555-555-1111" ]; then
T1=”Joe’s Work”
fi

DESCMSG=”$CIDNMBRnTIME: $CIDTIMEnDATE: $CIDDATE”
echo $DESCMSG | curl https://prowl.weks.net/publicapi/add -F apikey=$apikey -F priority=2 -F application=”$T1″ -F description=”<-”

#Add call to phone log /phonelog.txt
INFO=”$CIDDATE – $CIDTIME # $CIDNMBR NAME: $CIDNAME – $T1″
echo “$INFO” > /temp.txt
cat /temp.txt /phonelog.txt > /temp3.txt
mv /temp3.txt /phonelog.txt

exit 0

  • You can copy and paste everything except for the apikey = 00000… to be your apikey from the prowl website
  • (it will be a long hex-decimal string)
  • ctrl-x to save and exit
  • Make the ncid-prowl executable
  • $ sudo chmod 777 ncid-prowl
  • Run it as a background process by using
  • $ ncid –no-gui -P ncid-prowl &
  • Call your landline from your iPhone and you should see the Prowl message on your iPhone.
  • If all is good you are done
  • If you want to start ncid up automatically when you boot your Ubuntu PC do the following
  • Make startup script (copy and paste the following into a file called start-ncid.sh)
  • $ nano start-ncid.sh

#! /bin/sh
# Script to start ncidd server and ncid client at boot-up

# Start the ncidd server as a daemon
ncidd

# Start the ncid client with the ncid-prowl module as output in the background
ncid –no-gui -P ncid-prowl &

  • Make it executable
  • $ chmod +x start-ncid.sh
  • Add the script to /etc/init.d
  • $ sudo cp start-ncid.sh /etc/init.d/start-ncid.sh
  • Add it to the system startup scripts for the different run levels
  • $ sudo update-rc.d start-ncid.sh defaults
  • Reboot and test it… Good Luck.


About these ads
 
10 Comments

Posted by on February 9, 2011 in Ncid

 

Tags: , , , , , , ,

10 responses to “Prowl and Ncid – CallerID forwarded to your iPhone, iPad or iPod

  1. Richard Dansereau

    February 27, 2011 at 9:11 pm

    Hi, I Love it.

    I customize the description like this:

    DescMsg=”\nNAME: $CIDNAME\nNMBR: $CIDNMBR\nTIME: $CIDTIME\nDATE: $CIDDATE\n”

    echo $DescMsg | curl https://prowl.weks.net/publicapi/add -F apikey=$apikey -F priority=2 -F application=”ncid-prowl” -F description=”<-"

     
    • nowhereman999

      March 2, 2011 at 7:25 am

      Nice tweak. :)

       
  2. Todd Young

    March 27, 2011 at 11:50 am

    As I could not get ubuntu running properly with my modem, I have cygwin running on top of my windows XP image.

    So can you tell me what this would look like if running yac2ncid, and what commands to make the file executable? I’m not a UNIX guru, so be gentle. ;-)

    thx, and a great tip I’m looking forward to using!

     
  3. Todd Young

    April 21, 2011 at 11:04 pm

    Any help here??

     
  4. Todd Young

    April 23, 2011 at 1:01 am

    Ok, so I’m trying to make some progress on my own. I think I’m almost there:

    1) I’ve already had my NCID environment running fine via the yac2ncid gateway.

    2) I’ve edited your ncid-prowl script to point to the ncidmodules file, as it’s located under /usr/local/etc/ncid, and I added my apikey where appropriate.

    3) I made the ncid-prowl script executable via chmod 777

    Now, the question becomes, what is the command line I would enter to launch this properly? I know I need to run NCIDD and yac2ncid, along with ncid-prowl. But do I also need to run NCID?

    Is it something like:
    yac2ncid ncid -no-gui -P ncid-prowl

    or perhaps:
    yac2ncid -no-gui -P ncid growl

    When I run either, I can see caller ID information as usual on my PC, but nothing passes to my iPhone. Btw, I’ve tested my Prowl setup by sending a test email to my apikey, and that works fine. So I think it’s all on how I run yac2ncid with ncid-prowl.

    Thanks for any assistance.

     
  5. Charlie Heitzig

    May 4, 2011 at 11:01 pm

    Let me know if you get it working. I’ll probably try this weekend. My impression is that ncid-skel is a standalone script in cygwin, so you potentially just need to run ncid-skel.

    That said, I just tried it, and it doesn’t get the callerid output.

    I don’t know why you need yac2ncid though– I guess you maybe are you getting callerid info via yac?

     
  6. Charlie Heitzig

    May 8, 2011 at 3:30 pm

    Got it running under cygwin on Windows. You need to install ssl certs for curl to work correctly with https, or use insecure mode.

    Command line in cygwin bash shell is as above, except I added –message to allow receiving messages. Required a slight tweak in ncid shell script. Will post details when at my PC.

     
    • Todd Young

      September 20, 2011 at 3:32 pm

      Hi Charlie – Could you please post your details for getting this to work on cygwin? Much appreciated…

       
  7. Jim

    August 15, 2011 at 10:43 am

    Wouldn’t it be a matter of just configuring grwol to watch for yac2ncid?

     
  8. cheitzig

    September 20, 2011 at 9:03 pm

    This is the shell script that I’m using, named ncid-prowl in C:\cygwin\usr\local\share\ncid

    #!/bin/sh

    # ncid-prowl Output Module
    # Modify as needed for new module
    # keep “ncid-” in the name

    # input is 5 lines obtained from ncid
    # input: DATE\nTIME\nNUMBER\nNAME\nLINE\n
    #
    # input is 5 lines if a message was sent
    # input: \n\n\nMESSAGE\n\n
    # Message will be in $CIDNAME
    #
    # ncid usage:
    # ncid –no-gui [--message] –program ncid-prowl

    ConfigDir=/etc/ncid
    ConfigFile=$ConfigDir/ncidmodules.conf

    [ -f $ConfigFile ] && . $ConfigFile

    read CIDDATE
    read CIDTIME
    read CIDNMBR
    read CIDNAME
    read CIDLINE
    # Paste your apikey from the prowl website in the following line
    apikey=07515eae77ef47798ee65c55be85dbbc9083718f

    # Need to properly install curl AND
    # make sure to have CA certificates in /usr/ssl/certs directory
    curl https://prowl.weks.net/publicapi/add -F apikey=$apikey -F priority=2 -F application=”$CIDNAME” -F description=”$CIDNMBR”

    exit 0

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: