Home Voip Setup : Linksys SPA 2102 ( Linux Mac Windows )

 


Some time ago, I received a USB handset phone as gift, so of course I had to hook it up to one of my Linux boxes. I settled on the soft-phone Twinkle  – an excellent little program. I opened an account with Les.Net,  a Voip service provider in Winnipeg, Canada.  I had expected to wade through all kinds of new techno-jargon, but to get up and running was really quite simple.

With this modest setup I could receive and send regular phone ( landline ) calls anywhere in the world for next to nothing…actually pennies. However, due to my constant tinkering  the phone service was not available while my computer lay in pieces.  There were a few missed calls and it became clear that something else was in order.

After some research into stand-alone Voip boxes ( ATA’s ) ,  I settled on the Linksys SPA 2102.  It is worth mentioning here that broadband access is required, and you may or may not have 911 emergency service with this arrangement.  Once it is configured,  a computer is not required. In theory one could take the ATA over to Grandma’s house or to the other side of the globe, connect it to broadband,  and it will work with your local number.  That is worth noting if you are a traveler, or if you require a US or Canadian phone number.

 

Setting up this little unit was easy too.  I scooped a few old phones from the local thrift shop. ( There are some really cool old retro phones out there ! Red Hotline anyone ? )

The SPA 2102 is readily available through on-line shops, but beware of forgeries or LOCKED ATA’s . They are tied to a particular service provider who has the secret password to the administration pages of the unit.  If you can’t get into these pages to enter your account information from your Voip provider  – you are out of luck.

My setup is behind a router; I have plugged the WAN port of the SPA 2101 into a LAN port of my router. So to repeat in another fashion, my SPA 2102 is connected to a router which is connected to the Internet.  I do not have it connected directly for security reasons.  There probably is no real reason why it could not be.  One can disable net access through the keypad on a connected phone.  It doesn’t seem to have shell access, either.

So to start :

1. disconnect your router from the Internet.  We don’t want this little unit to “phone home”, and perhaps get an update that we don’t care for.

2. connect a touch tone phone ( most are ) to the jack marked Line 1 in the back of the SPA 2102.

3. pick up the phone ( you will hear nothing – no dial tone ) and dial ****.  When you get a voice prompt, enter 7932# to enable access from the Web ( your internal network only at this point ) and hit 1 # to save.

3.1  If you get a “please enter password” prompt, then your unit is NOT unlocked. Hang up. Try entering **** on the dial pad again but this time enter 73738# and 1# to confirm.  This will do a factory reset and clear all passwords and such.  The unit will reboot, and then try the **** 7932# sequence again.  It should work.  If that fails try **** 877778 #, and 1 # to confirm, which will clear all user ( not supplier ) passwords.  If all this fails then think about returning your unit.  You may be able to get into the user area of the ATA, but  what is required is the administration area. Read on to see if you can access the user area, if you are curious.

4.  Pick up the phone again and enter **** 110 and our robot voiced ATA will report the IP address that it is using.  Note it down.

5. Assuming that your computer is hooked up to the same router – on the same LAN – fire up your favorite web browser (  Firefox, Safari etc ) and in the address bar ( not the search bar ) type in the IP address reported in step 4. Something like 192.168.0.10

6. That should get you to the SPA 2102.  Below is a sample of what we want.  You may have to click on the “Admin Login” then  “advanced” tab on the upper right.  This screen is cropped at the top, yet it clearly shows the administrative tabs such as SIP and Provisioning, which would be missing on a locked unit.  ( Click the thumbnail image to enlarge ).

 

7. The Provisioning Tab is the one we want next.  See below.  On the upper right of this screen you will see under the Configuration Profile that the Provision enable is set to yes.  We do not want that. Select no. Just below that is “Profile Rule” which may have an http://yada yada in the field next to it.  Remove it, or put some nonsense before the http:// part to ensure that it cannot call home. Next under Firmware Upgrade, set Upgrade Enable to no.  You can play with this setting later once it the unit is online, if you are adventurous. Hit “submit all changes” at the bottom of the page.

8. It is prudent to set the ATA’s password for Web Access. It is under the “System” tab at the top menu bar.   Enter in your desired password, then hit “submit all changes” again.  This same password can be used both for Web access and the telephone keypad . Again, one could turn access on and off just using the phone.

9. Enter your account settings.  Different versions of the web interface exist, but they should look something like the image below.  ( Click on image to enlarge it ). We’ll do just one phone line here, and if you can repeat it for the second line if you have one.

Within the line 1 or ext 1 tab there are 8 fields to fill in / modify:

Line Enable: Yes
NAT Keep Alive Enable: No Proxy: did.voip.les.net
Register Expires:120

User ID: your Peer Name ( assigned by Les.Net )
Password: peer password (visible on the peer edit page at Les.Net)
Preferred Codec: g711

DTMF Tx Method: auto

Finally, “submit all changes” to save your account settings.

Your unit will reboot, and you should be on the air – or on the wire ? Ah, on-line !

Some tweaks :

For choppy sound issues change the default RTP Packet Size from 0.03 to 0.02.

If the ATA fails to register at times, set SIP T1 to 1, and also set Reg Retry Long Intvl to 30.

Resources / Links :

Les.net for an account.  Their support staff are excellent, and respond quickly.

DSLReports has a great forum with users far more knowledgeable than me.  Many tips and hints to be found there.

 

Logitech Ast IBM Lirc IR Controller on Ubuntu with Rhythmbox

Lirc is a cool little project that can add a remote control to your computer.  No more running to turn the sound up, skip a tune, or pause movie playback.

My units are labeled IBM.  They ain’t.
They are from Logitech, with IBM’s logo slapped on.  This was discovered only by doing a search on the FCC ID ( DZL211067 ).

The Red Demon

Getting them to work with Ubuntu 10 was a bit of a trick too. ( This should work with Ubuntu 8 – 10. Ubuntu 11 untested yet )

These notes assume that the Receiver (above right) is plugged into a 9 pin serial port and that the Remote has charged batteries.

Cut to the chase -

From the terminal type

sudo apt-get install lirc

A configuration screen should pop up looking something like ( click on thumb ):

Select the Logitech / AST combination. Next up comes :

And with the screen above we lie to it, sort of.  There is no selection available for the receiver we have on the serial port, so select the “Serial Port Direct TV..” and we will edit the configuration file for that in a few moments.

Once it is installed there are a few tweaks to the configuration files, then we’re done.

Open the hardware configuration file:

nano /etc/lirc/hardware.conf

# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE=”Logitech/AST”
REMOTE_MODULES=”"
REMOTE_DRIVER=”logitech”
REMOTE_DEVICE=”/dev/ttyS0″
REMOTE_SOCKET=”"
REMOTE_LIRCD_CONF=”logitech/lircd.conf.logitech”
REMOTE_LIRCD_ARGS=”"

#Chosen IR Transmitter
TRANSMITTER=”Custom”
TRANSMITTER_MODULES=”"
TRANSMITTER_DRIVER=”"
TRANSMITTER_DEVICE=”"
TRANSMITTER_SOCKET=”/var/run/lirc/lircd”
TRANSMITTER_LIRCD_CONF=”"
TRANSMITTER_LIRCD_ARGS=”"

Edit or add to make your config look the same as above. The rest of the file leave untouched. Save the file.

Next, get rid of the configuration fib we told in the installation setup screen.

nano /etc/lirc/lircd.conf

Delete or comment out the line that refers to Direct TV Receiver:

Note that just above the line to be deleted there is a reference to the Logitech Remote – this is a good thing. Have a look at it – the knowledge may come in handy. Save the file.

The next step is to setup Rhythmbox to load the Lirc plugin.
Start Rhythmbox ( Applications > Sound & Video > Rhythmbox ), then go to “Edit > Preferences” and click on the Lirc Plugin.  Don’t be concerned that the “configure” button is greyed.

Almost there. Finally, a file named “.lircrc” needs to be created and dropped into your home folder.  The following can be cut and pasted to get you going.

nano /home/yourusername/.lircrc

##
# Rhythmbox key bindings.
##
begin
prog = Rhythmbox
button = Play
config = playpause
end
begin
prog = Rhythmbox
button = Pause
config = playpause
end
begin
prog = Rhythmbox
button = Stop
config = stop
end
begin
prog = Rhythmbox
button = SEEK+
config = next
end
begin
prog = Rhythmbox
button = SEEK-
config = previous
end
begin
prog = Rhythmbox
button = MUTE
config = mute
end
begin
prog = Rhythmbox
button = CH-
config = volume_down
end
begin
prog = Rhythmbox
button = CH+
config = volume_up
end

Save the file.

Now its time to restart lirc:

/etc/init.d/lirc restart

Turn your speakers up, grab the remote and point it at the receiver.  Hit play – should be music to your ears !

Troubles ?
Check the configs, especially the nasty dot (.) in the name .lircd
Make sure your user name is in properly when creating the file for the home folder for example:

nano /home/ace/.lircrc

The lirc commands can be issued from the terminal for testing:

lircd --driver=logitech --device=/dev/ttyS0 --nodaemon

will run the program. If you get an error message saying something like Lirc is already running with PID XXXX, note the xxxx number, and kill that process using

 kill xxxx

and run the lircd command again
Next run :

irw /var/run/lirc/lircd/

which will read the receiver. Grab the remote and press a few buttons. There should be some output on the screen similar to:
000000000000a041 01 MOUSE_NNE Logitech
000000000000a04f 00 MOUSE_NNW Logitech
000000000000a04f 01 MOUSE_NNW Logitech
000000000000a04f 00 MOUSE_NNW Logitech
000000000000a04f 01 MOUSE_NNW Logitech
000000000000a04f 02 MOUSE_NNW Logitech
( I hit the mouse key in the test. )

The things I didn’t get first time around were :
- lirc reads from the socket “/var/run/lirc/lircd”.
- I expected to see red lights on the receiver with no program like Rhythmbox running. No program no lights – what is there to control ?
- Finally, there is no need for the symbolic link mentioned in the 6 bazillion howto’s out there.  The Debian elves took care of that.

Reference: http://www.lirc.org/
Thanks to Lukas for excellent hints :  http://azug.minpet.unibas.ch/~lukas/linux_recipes/lirc_logitech-AST.html