Archive

Archive for July, 2007

Embedded Systems

July 30, 2007 Pari Leave a comment

Like many who got onto the IT bandwagon, I never got to utilize what I was trained in – electrical engineering. After a career of high-level application development (i.e. in the IT Industry), I’ve taken the plunge, into the embedded world – back to my roots.

It really is an exciting and much more challenging area to be in – compared with drudgery of enterprise software development (fatware – where you don’t care about efficiency, you just slap on more memory, disk, cpu’s). Code-for-code embedded systems development pays a lot more too :-). I guess because Java programmers are a dime a dozen, but embedded systems need a tighter subject matter expertise. Compared with enterprise software development, one thing that sets embedded systems apart is the meticulous attention given to code correctness, efficiency, and reliability.

I have to thank the Slug for getting me into the world of embedded. It got me into learning about embedded Linux systems, embedded hardware, ARM processors, and 8-bit microcontrollers.

Surprisingly very little has changed since the Zilog Z80 (years ago) in terms of how they work. What has changed is that the CPU and all its peripheral components (RAM, EEPROM, Flash, USART, ADC, DAC, clock circuitry) have been all compressed into a single unit – the microcontroller (uC or MCU). And the cost typically around $2 and consumes typically less than 1W (compare that with $200 and 40W of CPU of PCs – I know it’s an unfair comparison, but how often big wig consultants propose CPU driven solutions to do an MCU’s job).

Categories: ARM

ARM Processors

July 29, 2007 Pari Leave a comment

What is an ARM processor? For those of us who have been living in the dark ages (that’s me!)… it stands for Advanced RISC Machine.

What is RISC? In short, once upon a time microprocessor engineers (in particular at Intel) thought it was a great idea to have the CPU handle more and more complex instructions. However, as the complexity increased, CPU’s were becoming power-hungry beasts with big fat instructions trying to accommodate just about everything (yes, you can even throw in the kitchen sink in there also). The downside of it is that it gave C compilers very little room for optimization – found it hard to churn out optimized code. In contrast RISC assembly language instructions are simple (the way microprocessor assembly languages started out to be), and easily optimized. See RISC vs CISC.

Not only is the C language far from dead, it is a very important language. Everything is written in C – all your operating systems, high-level languages, etc. As for embedded systems go, C – is where the metal meets the road, the software meets the hardware. Most of what you can do in assembly language, you can do in C. One can view C as a portable high level assembly language (in fact back then that was the reason that prompted it’s creation).

ARM processors (ARM9 and above) can be pretty overwhelming at first (compared with 8-bit microcontrollers). ARM based embedded systems are growing at a phenomenal rate – so it is worth getting to know if you’re getting into embedded systems.

Categories: ARM

The Slug

July 28, 2007 Pari Leave a comment

If I’m going to be running an Asterisk server 24×7, I shouldn’t really be needing a full blown PC or even a barebones PC costing at least $400 and burning at least 300-400W of power. I needed something which would consume less than 100W of power and cost less than $100.

My runner ups were the AMD Geode or the VIA C7 based boards. Both consume only about 40W of power (processor alone about 15-20W), and cost around $300. But after hours of reading up on Geode or C7 based boards – none of them satisfied me – each board had one peculiar problem or the other.

Then… I came across the Slug. In the same line as people hacked XBox’s to run Linux, a group of great folks have hacked the Linksys NSLU2 NAS to run Linux. At $70, consuming less than 10W, and solid state, the possibilities are endless: Asterisk, Internet Radio, File Sharing, Printer sharing, 24×7 web server, SSH, etc.

The heart of the Slug is an XScale IXP420 ARMv5TE processor, 133MHz, 32MB SDRAM, 8MB Flash, Linux firmware, Redboot bootloader.

More about the slug on the Slug Group.

Categories: Slug

Sox

July 27, 2007 Pari Leave a comment

A really versatile tool for converting between audio formats. Sox is to audio as convert is to images.

Came in real handy for creating custom IVR prompts and moh, in GSM format, for Asterisk.

Here’s an example, where I’m converting an OGG file to WAV and then resampling it to GSM.

/usr/bin/ogg123 -q -b 128 -p 32 -d wav -f – audio.ogg | sox -r 16000 -t wav – -r 8000 -c 1 -t raw – vol 0.10

Categories: Linux

Yummy Circuits

July 26, 2007 Pari Leave a comment

Take a look at these Yummy Circuits… the scary part is that I recognized the circuit in the first picture from when I last touched it 25 years ago. Just about every electronics hobbyist’s first exposure to integrate circuits (the LM555, aka “the triple-five-timer”). He’s even got the color codes on the resistors pretty reasonable (two 100K resistors and one 330ohm resistor and the capacitor values 0.1uF). drool :-}

Categories: General

Asterisk

July 26, 2007 Pari Leave a comment

Asterisk is now working with the SPA3102!! :-)

I thought I’ll share my struggle here (most of the struggle was with figuring out the much poorly documented SPA3102 configuration).

Here’s my Asterisk configuration files, along with the SPA3102 settings:

1. Asterisk Configuration
sip.conf

[line1]context=outgoinghost=192.168.1.100port=5060username=line1secret=welcometype=frienddtmfmode=rfc2833

[pstn]context=incominghost=192.168.1.100port=5061type=frienddtmfmode=rfc2833insecure=very

[gizmo]context=incominghost=proxy01.sipphone.comusername=YourGizmoUserName or YourGizmoSIPPhoneNumbersecret=YourGizmoPasswordfromuser=YourGizmoUserName or YourGizmoSIPPhoneNumberfromdomain=proxy01.sipphone.comtype=frienddtmfmode=rfc2833insecure=verynat=yes


extensions.conf

[incoming]exten => s,1,NoOP(${CALLERID}) ; show the caller ID info in the consoleexten => s,n,ResponseTimeout(10)exten => s,n,DigitTimeout(5)exten => s,n,SetMusicOnHold(native)exten => s,n,Ringingexten => s,n,Answerexten => s,n,Dial(SIP/line1,15)exten => s,n,Playback(nbdy-avail-to-take-call)exten => s,n,Directory(default,extensions,f)include => extensions [outgoing]; international/long-distance speed dials - through gizmoexten => 01,1,Dial(SIP/0111111111@gizmo,60)exten => 02,1,Dial(SIP/0112222222@gizmo,60) ; local speed dials - through pstnexten => 11,1,Dial(SIP/1111111111@pstn,30)exten => 12,1,Dial(SIP/2222222222@pstn,30) ; pass throughexten => _XXXXXXXXXX,1,Dial(SIP/${EXTEN}@pstn,30)exten => _1800XXXXXXX,1,Dial(SIP/${EXTEN}@pstn,30)exten => _1888XXXXXXX,1,Dial(SIP/${EXTEN}@pstn,30) include => extensions [extensions]exten => 101,1,VoiceMail(u101@default) ; Mailbox 1exten => 102,1,VoiceMail(u102@default) ; Mailbox 2 exten => 500,1,VoiceMailMainexten => 600,1,Directory(default,extensions,f)exten => 800,1,Background(if-u-know-ext-dial)exten => 800,n,WaitExten(5)exten => 900,1,Playback(demo-moreinfo)exten => 900,n,Hangup ; Invalidexten => i,1,Playback(pbx-invalid)exten => i,n,WaitExten(5) ; Timeoutexten => t,1,Playback(vm-goodbye)exten => t,n,Hangup


2. SPA3102 Settings:

A. Line1 Tab:

Proxy and Registration:
  • Display Name: spa3102-line1
  • User ID: line1
  • Password: welcome

Subscriber Information:


  • Display Name: spa3102-line1
  • User ID: line1
  • Password: welcome

Gateway Accounts:

  • Gateway 1:
  • GW1 Auth ID: line1
  • GW2 Password: welcome

Dialplan:

  • Dial Plan: (911S0|1800xxxxxxxS0|011xx.||x.)


B. PSTN Tab:


Proxy and Registration:
  • Proxy: IP of Asterisk Server
  • Register: no
  • Make Call without Reg: yes
  • Ans Call without Reg: yes

VoIP-To-PSTN Gateway Setup:

  • VoIP-To-PSTN Gateway Enable: yes
  • VoIP Caller Auth Method: none
  • VoIP Caller Default DP: none

PSTN-To-VoIP Gateway Setup:

  • PSTN Ring Thru Line 1: no
  • PSTN CID For VoIP CID: yes

FXO Timer Values (sec):

  • PSTN Answer Delay: 2

Dialplan:

  • Dial Plan: S0
Categories: General

Linksys SPA3102

July 25, 2007 Pari Leave a comment

I just got the LinkSys SPA3102-NA FXS/FXO ATA/Gateway (fyi, the NA represents the unlocked version).

I chose it as there just seems to be a lot of support for it on the web. Voxilla has dedicated forum for it. Costs about $80 (about the average low-end price).

It is very configurable, but I have to say though the interface is loaded with options, the design could be much better (but then most UI’s I’ve seen for embedded systems are horrible).

So far it’s working great. I’ve tried out VoIP to FXO and FXS (and FXO/FXS to VOIP), as well as POTS/PSTN bridging. All working great – though it took a good deal of experimenting to figure things out, not to mention that the document sucks — it’s pretty much non-existent. I’ll post my configuration for each these soon!

My next challenge is to hook it up with Asterisk – which is the whole purpose of why bought this for :-)

Categories: General

BSNL/EDGE

July 5, 2007 Pari 1 comment

If like me you’ve been desperately searching everywhere on how to get BSNL EDGE working, here it is:

First sign up for the service. This can be done over SMS. If you have a prepaid service, send an SMS to 53733 with the message “GPRSPRE”. I have no idea what it is for postpaid (maybe GPRSPOST?). I think it deducts an activation charge of around Rs. 200. After a few hours, you will get a message saying your service is activated. Then configure your phone with the settings below.

Settings:

The following settings are for the Samsung SGH-J210. This setting works with Opera and the J210’s default browser OpenWave.

Proxy IP: (no proxy)
Proxy Port: (no proxy)
APN: gprssouth.cellone.in
Login ID: 91xxxxxxxxxx
Password: 91xxxxxxxxxx

Alternative:

I found this alternative configuration setting also works, but it works only with OpenWave, not with Opera:

Proxy IP: 10.31.54.2
Proxy Port: 9401
APN: wapsouth.cellone.in
Login ID: ppp
Password: ppp123

Depending on signal quality (distance from tower) you might not get EDGE speeds, and the connection will downgrade itself to GPRS. On my Samsung J210 a GPRS connection appears as a “G” icon, and EDGE as “E” icon.

Categories: General