Friday, October 7, 2011

Surge / High Voltage Protection using Metal Oxide Varistor (MOV)

There are times when power Supply in your surges and all devices goes for a Toss.

Fuse prevents the devices from High current but not from High Voltage ,To prevent devices burning up due to high voltage a simple device called a “Metal Oxide varisitor”

(MOV) can be used.

Put MOV in parallel to Power supply to each Device after Fuse to protect over voltage

varistor 07D Series (Should cost around Rs2 /Rs 5 INDIA)

Part Number

Varistor  Voltage

Maximum Allowable Voltage

Clamping Voltage(Max)

Maximum Energy

Maximum

Peak Current

Rated Power

Typical Capacitance (Reference)

(8/20μS)

(10/1000μS)

( 8/20μS )

Standard

High Surge

V1mA

ACrms

DC

Vc

Ip

Standard

High Surge

Standard

High Surge

(W)

(v)

(v)

(v)

(v)

(A)

(JOULE)

(A)

1kHz( pF)

07D361K

J

360(324-396)

230

300

595

10

25.00

32

1200

1750

0.25

140

07D391K

J

390(351-429)

250

320

650

10

25.00

35

1200

1750

0.25

130

07D431K

J

430(387-473)

275

350

710

10

28.00

40

1200

1750

0.25

115

07D471K

J

470(423-517)

300

385

775

10

30.00

42

1200

1750

0.25

105

07D511K

J

510(459-561)

320

415

845

10

30.00

45

1200

1750

0.25

100

07D561K

J

560(504-616)

350

460

925

10

30.00

49

1200

1750

0.25

90

07D621K

J

620(558-682)

385

505

1025

10

33.00

55

1200

1750

0.25

80

clip_image002

clip_image003

Typical MOV application. The MOV is connected in shunt across the power source, behind the fuse.

clip_image004

Tuesday, September 20, 2011

Asterisk ISDN using chan_lcr (LCR)

Asterisk with mISDNV2 using chan_lcr

Setting up ISDN Support in Asterisk using chan_lcr module

In this both LCR and Asterisk should be running,LCR handles all the ISDN related stuffs signaling and transmits to asterisk using

socket to chan_lcr.

 

A.Prepare fedora installation (Fedora 11 -2.6.30)

1. Install following packages

Yum install kernel,gcc,patch,autconf,vim,samba,openssh,newt-devel,gtk2-devel,gcc-c++,libtermcap-devel

 

2. Remove already exisiting misdn_core ,and hfc drivers (hfcpic.ko)

Delete

/lib/modules/2.6.30.10-105.2.23.fc11.i586/kernel/drivers/isdn

 

B.Installatin of mISDN,mISDNuser and LCR

1. Dowload all the packages from LCR site

http://isdn.eversberg.eu/download/lcr-1.7/mISDN-20100525.tar.gz

http://isdn.eversberg.eu/download/lcr-1.7/mISDNuser-20100525.tar.gz

http://isdn.eversberg.eu/download/lcr-1.7/lcr-20100601.tar.gz

2. Install Misdn Core

  • ./configure
  • Copy mISDN.cfg.default to standalone/mISDN.cfg and edit it for you needs

Comment these

#CONFIG_MISDN_HFCMULTI_8xx

#CONFIG_MISDN_HFCUSB

#CONFIG_MISDN_XHFC

#CONFIG_MISDN_L1LOOP

#CONFIG_MISDN_AVMFRITZ

#CONFIG_MISDN_SPEEDFAX

#CONFIG_MISDN_INFINEON

#CONFIG_MISDN_W6692

#CONFIG_MISDN_NETJET

#CONFIG_MISDN_IPAC

#CONFIG_MISDN_ISAR

  • make modules
  • make modules-install
  • insert the kernel modules created :

a.insmod ./standalone/drivers/isdn/mISDN/mISDN_core.ko  ( dmesg shows Modular ISDN core version 1.1.21 NET: Registered protocol family 34)

b.insmod ./standalone/drivers/isdn/mISDN/mISDN_dsp.ko

c.insmod ./standalone/drivers/isdn/hardware/mISDN/hfcpci.ko

 

(Note :

dmesg shows

hfcpci 0000:01:07.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

mISDN_hfcpci: found adapter CCD/Billion/Asuscom 2BD0 at 0000:01:07.0

mISDN: HFC-PCI driver 2.0

HFC-PCI: defined at mem 0xe1beac00 fifo 0xd89c0000(0x189c0000) IRQ 16 HZ 1000

HFC 1 cards installed

)

3.Install misdn user

· cd mISDNuser

· (2.6.32.2 use --with-AF_ISDN=34 (e.g. dmesg | grep family))

./configure --with-AF_ISDN=34

· make

· make install

ln -s /home/alok/ISDN/mISDNuser/lib/.libs/libmisdn.so /usr/lib/libmisdn.so.0

ln -s /home/alok/ISDN/mISDNuser/suppserv/.libs/libsuppserv.so /usr/lib/libsuppserv.so.0

 

4.Install LCR

Before installing LCR ensure asterisk is compiled,

cp -r asterisk-1.4.34/include/asterisk /usr/include/

./configure –with-asterisk

make

make install

Copying chan_lcr to asterisk

This creates a channel driver to interact with LCR - “chan_lcr” copy these channel driver so to asterisk module folder

cp chan_lcr.so  /usr/lib/asterisk/modules/

 

Run Programs

1.Start LCR

2.Start Asterisk now asterisk listerning to LCR using socket through chan_lcr

image image

 

Like asterisk configuration files sip.conf ,extensions.conf LCR to has configuration

most important is routing.conf and interface.conf.

Below is sample conf files to make SIP <->ISDN.

Generic Dialplans

Change asterisk conf files

Extensions.conf

[default]

exten => 1000,1,Dial(SIP/1000)

exten => 2000,1,Dial(SIP/2000)

include = asterisk_to_misdn

 

;directly called from lcr(ISDN to SIP)

[asterisk_from_misdn]

exten=>_X.,1,Dial(SIP/${EXTEN})

 

;SIP to ISDN

[asterisk_to_misdn]

exten => 8000,1,Dial(LCR/misdn/8000)

Dialing 8000 with Dial Phone connect to ISND port.

 

Change LCR conf files

interface.conf

[misdn]

portnum 0

nt

msn 8000

routing.conf

[main]

: remote application=asterisk context=asterisk_from_misdn

 

Some other Dialplan notes

ISDN to SIP

Interface.conf

[misdnintern]

portnum 0

nt

msn 400 ;this is called id of ISDN phone

>>Eg.1

Rounting.conf 
[main]
dialing=5678   : remote application=asterisk context=extern_context exten=5
extensions.conf
[extern_context]
exten=>5,1,Dial(SIP/1000)
 
Note:here dialing 5678 from ISDN Phone will call extern_context and send exten=5 so it will dial 1000
 
>>Eg.2
Generic calling
Rounting.conf 
[main]
: remote application=asterisk context=extern_context
extensions.conf
[extern_context]
exten=>_X.,1,Dial(SIP/${EXTEN})

Note:Dialing any number from ISDN will call extern_context in extensions.conf and will pass extension whatever we have dialed.i.e 1000 from ISDN phone will dial SIP/1000.

 

>>Eg.3

Routing through interface

Rounting.conf 
[main]

interface=misdnintern : remote application=asterisk context=extern_context

extensions.conf
[extern_context]
exten=>_X.,1,Dial(SIP/${EXTEN})

Wednesday, September 7, 2011

Installing Window 7 from USB Drive(No need to Burn DVD)

 
  1. Download PowerISO and open the Window 7 ISO from that .

Goto File ->Image Properties-tick the UDF if its not selected and save the ISO.

It will take a while to SAVE.

clip_image002

2. Download and Install this package from Microsoft

WindowsXP-KB932716-v2-x86-ENU.exe

Links:

http://rapidshare.com/files/119343365/WindowsXP-KB932716-v2-x86-ENU.exe

or

http://www.microsoft.com/downloads/details.aspx?FamilyId=B5F726F1-4ACE-455D-BAD7-ABC4DD2F147B&displaylang=en

or

http://download.microsoft.com/download/3/a/2/3a2deb62-2bc7-4069-aae5-55eadf9927a1/WindowsXP-KB932716-v2-x86-ENU.exe

3. Download isoavdpcopy and run from command prompt

Isoavdpcopy “windows ISO file name”

clip_image003

Download :

http://withinwindows.com/files/isoavdpcopy/isoavdpcopy_0.1.zip

Note:

If you don’t this you will get this error while using Window 7 ISB/DVD Download Tool

clip_image005

4.Download and Install Windows 7 USB/DVD Download tool

http://images2.store.microsoft.com/prod/clustera/framework/w7udt/1.0/en-us/Windows7-USB-DVD-tool.exe

5. Insert USB Driver & Run Windows 7 USB/DVD Download tool and select Window7 iso

clip_image007

clip_image009

Don’t worry if the below error shows up.Still you can run setup without issue.

clip_image011

All tools Attached in the document

clip_image013

Making Custom Initrd or Modifying Initrd

Use existing initrd.img from /boot or create one

Using

Mkinitrd myinitrd.img <uname –r>

  1. Extract the above initrd file using

gzip -dc initrd.img | cpio -idv

  1. the initrd is whole filesystem

clip_image002

  1. init file is the script that runs and finally mounts real filesystem
  2. Put your statement here.

Eg. Echo “welcome alok”

6.then again pack it using

find . | cpio -H newc -o > ../initramfs.cpio

7.compress

Cd ..

Gzip -9 initramfs.cpio

Cp to /boot

And make necessary changes in grub.conf

Note :No limit as such in size of initramfs,

Put fsarchiver in that.

Nash is simlar to busybox containing scripts in it

Hacking Beetle 220BX / 220BXi ADSL2 Modem

Most of the Router usually contains Vxworks or Linux as OS,

All Embedded Board has Serial Port to download and Configure the Image/Bootloader hence the router.

(Airtel’ Modem contains Broadcom BCM6338KFB CPU i.eMIPS32 240Mhz Processor)

220BX –Contains 8MB Flash

220BXi-Contains 16MB Flash

Steps to Run your own custom compile Kernel in Airtel Bx220 or Bx220i ADSL Router.

1. Opening the Router

Open the 4 screws and locate the Jumper J4 as shown in figure

clip_image002

2. Identification of RX,TX,GND and VCC

VCC can be easily located with + of LED matching one of the

-Get a multi-meter in continuity tester mode (beep sound) touch one probe to + of LED light and other pins of J4,the one where meter beeps is +

-Similary located GND of J4

-to Find RX and TX,its tricky .Change mode of multi-meter to measure voltage &

boot the modem and with one probe to GND and other to any of remaining two the Pins .The pin that shows some voltage fluctuation is the TX while other being RX.

The marked VCC,RX,TX and GND are actual pins in 220BX and 220BXi

3. Make a RS232 Adapter using Max232 or similar chips(google it ) & attach one end to J4 and other to Serial port of Computer.

4.Open Hyperterminal or Teraterm and set the Baud rate & Other settings as shown

clip_image004

5.Start the Modem

You will see a countdown –If don’t press any key it boots Linux and start the ADSL Router

clip_image006

Below is the complete bootup log capture –Shows Linux running.

CFE version 1.0.37-0.7 for BCM96338 (32bit,SP,BE)

Build Date: Wed Dec 7 14:11:44 CST 2005 (root@localhost.localdomain)

Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.

Initializing Arena.

Initializing Devices.

Auto-negotiation timed-out

10 MB Half-Duplex (assumed)

CPU type 0x29010: 240MHz

Total memory used by CFE: 0x80401000 - 0x80522A10 (1186320)

Initialized Data: 0x8041ACB0 - 0x8041C3B0 (5888)

BSS Area: 0x8041C3B0 - 0x80420A10 (18016)

Local Heap: 0x80420A10 - 0x80520A10 (1048576)

Stack Area: 0x80520A10 - 0x80522A10 (8192)

Text (code) segment: 0x80401000 - 0x8041ACA8 (105640)

Boot area (physical): 0x00523000 - 0x00563000

Relocation Factor: I:00000000 - D:00000000

Board IP address : 192.168.1.1:ffffff00

Host IP address : 192.168.1.100

Gateway IP address :

Run from flash/host (f/h) : f

Default host run file name : vmlinux

Default host flash file name : bcm963xx_fs_kernel

Boot delay (0-9 seconds) : 1

Board Id Name : 96338L-2M-8M

Psi size in KB : 24

Number of MAC Addresses (1-32) : 11

Base MAC Address : 00:08:5c:8a:9c:50

Ethernet PHY Type : Internal

Memory size in MB : 8

*** Press any key to stop auto run (1 seconds) ***

Auto run second count down: 110

Code Address: 0x80010000, Entry Address: 0x80175018

Decompression OK!

Entry at 0x80175018

Closing network.

Starting program at 0x80175018

Linux version 2.6.8.1 (root@localhost.localdomain) (gcc version 3.4.2) #1 Wed May 17 18:59:51 CST 2006

Total Flash size: 2048K with 35 sectors

96338L-2M-8M prom init

CPU revision is: 00029010

Determined physical RAM map:

memory: 007a0000 @ 00000000 (usable)

On node 0 totalpages: 1952

DMA zone: 1952 pages, LIFO batch:1

Normal zone: 0 pages, LIFO batch:1

HighMem zone: 0 pages, LIFO batch:1

Built 1 zonelists

Kernel command line: root=31:0 ro noinitrd

brcm mips: enabling icache and dcache...

Primary instruction cache 16kB, physically tagged, 2-way, linesize 16 bytes.

Primary data cache 8kB 2-way, linesize 16 bytes.

PID hash table entries: 32 (order 5: 256 bytes)

Using 120.000 MHz high precision timer.

Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)

Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)

Memory: 6076k/7808k available (1244k kernel code, 1712k reserved, 179k data, 68k init, 0k highmem)

Calibrating delay loop... 235.52 BogoMIPS

Mount-cache hash table entries: 512 (order: 0, 4096 bytes)

Checking for 'wait' instruction... unavailable.

NET: Registered protocol family 16

Can't analyze prologue code at 80145acc

PPP generic driver version 2.4.2

NET: Registered protocol family 24

Using noop io scheduler

bcm963xx_mtd driver v1.0

brcmboard: brcm_board_init entry

bcm963xx_serial driver v2.0

NET: Registered protocol family 2

IP: routing cache hash table of 512 buckets, 4Kbytes

TCP: Hash tables configured (established 512 bind 1024)

NET: Registered protocol family 1

NET: Registered protocol family 17

Ebtables v2.0 registered

NET: Registered protocol family 8

NET: Registered protocol family 20

VFS: Mounted root (squashfs filesystem) readonly.

Freeing unused kernel memory: 68k freed

init started: BusyBox v1.00 (2006.05.17-11:08+0000) multi-call binary

Algorithmics/MIPS FPU Emulator v1.5

BusyBox v1.00 (2006.05.17-11:08+0000) Built-in shell (msh)

Enter 'help' for a list of built-in commands.

Loading drivers and kernel modules...

atmapi: module license 'Proprietary' taints kernel.

blaadd: blaa_detect entry

adsl: adsl_init entry

Broadcom BCMPROCFS v1.0 initialized

Broadcom BCM6338A2 Ethernet Network Device v0.3 May 17 2006 18:54:09

Config Internal PHY Through MDIO

BCM63xx_ENET: Auto-negotiation timed-out

BCM63xx_ENET: 10 MB Half-Duplex (assumed)

eth0: MAC Address: 00:08:5C:8A:9C:50

Broadcom BCM6338A2 USB Network Device v0.4 May 17 2006 18:54:15

usb0: MAC Address: 00 08 5C 8A 9C 51

usb0: Host MAC Address: 00 08 5C 8A 9C 52

BcmAdsl_Initialize=0xC00551B8, g_pFnNotifyCallback=0xC0067CB4

AdslCoreHwReset: AdslOemDataAddr = 0xA07E504C

ip_tables: (C) 2000-2002 Netfilter core team

ip_conntrack version 2.1 (61 buckets, 0 max) - 368 bytes per conntrack

==> Bcm963xx Software Version: 3.00L.03.A2pB017l.d15h <==

device usb0 entered promiscuous mode

br0: port 1(usb0) entering learning state

br0: topology change detected, propagating

br0: port 1(usb0) entering forwarding state

device eth0 entered promiscuous mode

br0: port 2(eth0) entering learning state

br0: topology change detected, propagating

br0: port 2(eth0) entering forwarding state

pvc2684d: Interface "nas_0_32" created sucessfully

pvc2684d: Communicating over ATM 0.0.32, encapsulation: LLC

br0: port 2(eth0) entering disabled state

br0: port 1(usb0) entering disabled state

6.Login to shell

Once modem is completely booted pressing the enter will show u login prompt

Use deafault username/password (admin/password) otherwise the once u have set

Login: admin

Password:

[2J[HNote: If you have problem with Backspace key, please make sure you configure your terminal emulator settings. For instance, from HyperTerminal you would need to use File->Properties->Setting->Back Space key sends.

Main Menu

1. ADSL Link State

2. LAN

3. WAN

4. DNS Server

5. Route Setup

6. NAT

7. Firewall

8. Quality Of Service

9. Management

10. Passwords

11. Reset to Default

12. Save and Reboot

13. Exit

-> 13

Bye bye. Have a nice day!!!

Use sh to get busybox shell and use “echo * “ to show files and directory (ls command is not present in busybox of airtel)

Web page directory

Login: admin

Password:

> sh

BusyBox v1.00 (2006.12.06-10:41+0000) Built-in shell (msh)

Enter 'help' for a list of built-in commands.

# cd we echo *

bin dev etc images lib linuxrc mnt proc sbin usr var webs

# cd webs

# echo *

adslcfg.html adslcfg_en.html adslcfgadv.html adslcfgc.html adslcfgtone.html algcfg.html autoscan.html autoscancancel.html autoscanerr.html backupsettings.html berrun.html berstart.html berstop.html certadd.html certcaimport.html certimport.html certloadsigned.html colors.css colors_1.css ddnsadd.html defaultsettings.html dhcpinfo.html diag.html diagbr.html diagipow.html diaglan.html diagmer.html diagpppoa.html diagpppoe.html dnscfg.html dslinfo_en.html enblbridge.html enblservice.html footer.html footer_en.html index.html info.html info_en.html ipoacfg.html ippcfg.html ipsconfig.html ipsec.html lancfg.html lancfg2.html lancfg2_en.html lancfgbr.html languageprocess.html logconfig.html logintro.html logo.html logo_corp.gif logobkg.gif look.html lookme.html main.html menu.html menuBcm.js menuTitle.js menuTree.js menu_en.html my.js natcfg.html natcfg2.html ntwkprtcl.html ntwksum.html ntwksum2.html password.html password_en.html portName.js portmapadd.html portmapedit.html pppautherr.html pppauthinfo.html pppoe.html pvccfg.html pvccfgerr.html pvcindex.html qoscls.html quicksetuperr.html rebootinfo.html resetrouter.html resetrouter_en.html restoreinfo.html routeadd.html routeremove.html rtdefaultcfg.html rtdefaultcfgerr.html scacccntr.html scdmz.html scinflt.html scintro.html scmacflt.html scmacpolicy.html scoutflt.html scprttrg.html scvrtsrv.html snmpconfig.html sntpcfg.html statsadsl.html statsadslerr.html statsadslreset.html statsatm.html statsatmerr.html statsatmreset.html statsifc.html statsifcreset.html statsvdsl.html statsvdslreset.html statswanreset.html stylemain.css todadd.html tr69cfg.html updatesettings.html upload.html uploadinfo.html util.js vpivci.html vpivcierr.html wanadderr.html wancfg.html

some pages like tr69cfg.html are hidden pages and main webpage doesn’t have link to it,

you can access these page by directly appending page name to router ip in browser.

(TR69 sets the Autoconfiguration server address so that airtel guys can access it remotely and debug it)

7.Accessing Bootloader Prompt(CFE bootloader)

Start the modem and Pressing any key during 1 sec countdown.

Press Enter and u will CFE prompt ,type help to get list of command supported

CFE version 1.0.37-0.7 for BCM96338 (32bit,SP,BE)

Build Date: Wed Dec 7 14:11:44 CST 2005 (root@localhost.localdomain)

Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.

Initializing Arena.

Initializing Devices.

Auto-negotiation timed-out

10 MB Half-Duplex (assumed)

CPU type 0x29010: 240MHz

Total memory used by CFE: 0x80401000 - 0x80522A10 (1186320)

Initialized Data: 0x8041ACB0 - 0x8041C3B0 (5888)

BSS Area: 0x8041C3B0 - 0x80420A10 (18016)

Local Heap: 0x80420A10 - 0x80520A10 (1048576)

Stack Area: 0x80520A10 - 0x80522A10 (8192)

Text (code) segment: 0x80401000 - 0x8041ACA8 (105640)

Boot area (physical): 0x00523000 - 0x00563000

Relocation Factor: I:00000000 - D:00000000

Board IP address : 192.168.1.1:ffffff00

Host IP address : 192.168.1.100

Gateway IP address :

Run from flash/host (f/h) : f

Default host run file name : vmlinux

Default host flash file name : bcm963xx_fs_kernel

Boot delay (0-9 seconds) : 1

Board Id Name : 96338L-2M-8M

Psi size in KB : 24

Number of MAC Addresses (1-32) : 11

Base MAC Address : 00:08:5c:8a:9c:50

Ethernet PHY Type : Internal

Memory size in MB : 8

*** Press any key to stop auto run (1 seconds) ***

Auto run second count down: 111

CFE>

CFE> helo

Available commands:

w Write the whole image start from beginning of the flash

e Erase [n]vram or [a]ll flash except bootrom

r Run program from flash image or from host depend on [f/h] flag

p Print boot line and board parameter info

c Change booline parameters

f Write image to the flash

i Erase persistent storage data

b Change board parameters

reset Reset the board

flashimage Flashes a compressed image after the bootloader.

help Obtain help for CFE commands

For more information about a command, enter 'help command-name'

*** command status = 0

CFE> p

Board IP address : 192.168.1.1:ffffff00

Host IP address : 192.168.1.100

Gateway IP address :

Run from flash/host (f/h) : f

Default host run file name : vmlinux

Default host flash file name : bcm963xx_fs_kernel

Boot delay (0-9 seconds) : 1

Board Id Name : 96338L-2M-8M

Psi size in KB : 24

Number of MAC Addresses (1-32) : 11

Base MAC Address : 00:08:5c:8a:9c:50

Ethernet PHY Type : Internal

Memory size in MB : 8

*** command status = 0

CFE>

8.Flashing image

using flash image command –If you have right filesystem and kernel image u can flash .using flashiamge command .

Warning:You might brick it and render router unusable if the file is wrong so avoid this.

CFE> flashimage 192.168.0.1:bcm963xx_fs_kernel
Loading 192.168.0.1:bcm963xx_fs_kernel ...
Finished loading 3155261 bytes
...............................................................
 
Finished flashing image.
Resetting board...

9. Compiling your own kernel and running

Airtel doesn’t provide source code for the modem .but the Broadcom Chip BCM6338 is being used by different vendors like siemens,TP-Link and u can use source-code from there sites. (issues present)

Download

Following toolchain and other sources of Seimens modem.

http://opensource.albistechnologies.com/ADSL/CL-xxx_SL2-xxx_SLI-5300/GPL_source_CL_SL_SLI_series_consumer_release.tar

or

http://broadband.eip.siemens.ch/public/GPL_source/GPL_source_CL_SL_SLI_series_consumer_release.tar

a)Extract the GPL_source_CL_SL_SLI_series_consumer_release.tar

b)once extracted you will see following files

clip_image008

c) consumer_install is the script that install toolchains and extract kernel sources.

Make sure you have around 500mb of free space.

d)run the script sh consumer_install and press ‘y’when prompted

clip_image010

e)cd to /opt/bcm963xx_router

clip_image012

Read the README file.

Now compile the kernel using

Make PROFILE=SL2141

clip_image014

It will take some time to compile the kernel ,Once the kernel is compiled u can access it in bcm963xx_router/kernel/linux/vmlinux

Now use this vmlinux kernel to boot modem,don’t flash it as it dosent filesytem yet.

To run this image

Access the CFE prompt see point 7.

Now press c to change boot parameters here

Host IP is my pc ip where TFTP Server (tftpd32) is running

Board IP is router IP and vmlinux is image that it will run .

Change from “ f” to “h” to boot from tftp server instead of image from flash

CFE> c

Press: <enter> to use current value

'-' to go previous parameter

'.' to clear the current value

'x' to exit this command

Board IP address : 192.168.0.150

Host IP address : 192.168.0.100

Gateway IP address : 192.168.0.1

Run from flash/host (f/h) : f h

Default host run file name : vmlinux

Default host flash file name : bcm963xx_fs_kernel

Boot delay (0-9 seconds) : 5

*** command status = 0

CFE> r

0x80010000/1476988 0x8017a000/151686 0x8019f086/71586 Entry at 0x8018e018

Closing network.

Enter “r” to run the image vmlinux .

Following Shows a compiled kernel

clip_image016

clip_image018

Notes:

- Openwrt doesn’t Support 6338 ,a higher version is supported

- Airtel uses lots of GPL license Software (Busybox, Kernel Iptables etc) but don’t provide the source code, if you feel this article to be helpful please file a complain against airtel and intimate GPl licensing about the violation.

- Work in progess to get full shell with vi editor and other tools and to port siproxd to run my small sip registrar server.

Full log of kernel running from siemens source code

CFE> web info: Waiting for connection on socket 0.

CFE>

CFE>

CFE> c

Press: <enter> to use current value

'-' to go previous parameter

'.' to clear the current value

'x' to exit this command

Board IP address : 192.168.0.150

Host IP address : 192.168.0.100

Gateway IP address : 192.168.0.1

Run from flash/host (f/h) : f h

Default host run file name : vmlinux

Default host flash file name : bcm963xx_fs_kernel

Boot delay (0-9 seconds) : 5

*** command status = 0

CFE> r

0x80010000/1476988 0x8017a000/151686 0x8019f086/71586 Entry at 0x8018e018

Closing network.

Starting program at 0x8018e018

Linux version 2.6.8.1 (compiled by root) (gcc version 3.4.2) #1 Sun Feb 21 13:23:54 EST 2010

c2/2249 System PLL( MPI clock 0x0)

Flash Config: CS0(1fc00000,4),Base(bfc00000),Size(4MB)

FLASH_BASE bfc00000,blk 0

Total Flash size: 2048K with 35 sectors NVRAM @0 block

***Board id is not set****: Using the default PSI size: 24

Scratch pad is not used for this flash part.

CPU revision is: 00029010

Determined physical RAM map:

memory: 00fa0000 @ 00000000 (usable)

On node 0 totalpages: 4000

DMA zone: 4000 pages, LIFO batch:1

Normal zone: 0 pages, LIFO batch:1

HighMem zone: 0 pages, LIFO batch:1

Built 1 zonelists

Kernel command line: root=31:0 ro noinitrd

brcm mips: enabling icache and dcache...

Primary instruction cache 16kB, physically tagged, 2-way, linesize 16 bytes.

Primary data cache 8kB 2-way, linesize 16 bytes.

PID hash table entries: 64 (order 6: 512 bytes)

Using 16.000 MHz high precision timer.

Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)

Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)

Memory: 14088k/16000k available (1323k kernel code, 1892k reserved, 200k data, 72k init, 0k highmem)

Calibrating delay loop... 31.64 BogoMIPS

Mount-cache hash table entries: 512 (order: 0, 4096 bytes)

Checking for 'wait' instruction... unavailable.

NET: Registered protocol family 16

Can't analyze prologue code at 801597ac

PCI: device 0000:00:00.0 has unknown header type 1b, ignoring.

PCI: device 0000:00:01.0 has unknown header type 1b, ignoring.

PCI: device 0000:00:1a.0 has unknown header type 1b, ignoring.

PCI: device 0000:00:1b.0 has unknown header type 1b, ignoring.

PCI: device 0000:00:1c.0 has unknown header type 1b, ignoring.

PCI: device 0000:00:1d.0 has unknown header type 1b, ignoring.

PCI: device 0000:00:1e.0 has unknown header type 1b, ignoring.

PCI: device 0000:00:1f.0 has unknown header type 1b, ignoring.

1.parse options inodes 1763 block 1763

PPP generic driver version 2.4.2

NET: Registered protocol family 24

Using noop io scheduler

bcm963xx_mtd driver v1.0

rootfs_addr 0bfc10100

No BinFs

brcmboard: brcm_board_init entry

bcm963xx_serial driver v2.0

NET: Registered protocol family 2

Hold Reset button for 21474836 seconds<6>IP: routing cache hash table of 512 buckets, 4Kbytes

TCP: Hash tables configured (established 512 bind 1024)

NET: Registered protocol family 1

NET: Registered protocol family 17

Ebtables v2.0 registered

Hold Reset button for 0 seconds<6>NET: Registered protocol family 8

NET: Registered protocol family 20

802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>

All bugs added by David S. Miller <davem@redhat.com>

Hold Reset button for 0 secondsVFS: Mounted root (squashfs filesystem) readonly.

Freeing unused kernel memory: 72k freed

Hold Reset button for 0 secondsHold Reset button for 1 secondsHold Reset button for 2 secondsHold Reset button for 2 secondsHold Reset button for 3 seconds

Reset to factory default setting...

Local Jabber / XMPP Server

Local Jabber/XMPP Server

  1. Download and Install ejabberd

http://www.process-one.net/downloads/ejabberd/2.1.2/ejabberd-2.1.2-windows-installer.exe

2. Once installed click on start ejabberd using icon on desktop

clip_image002

3.It will open page – click on admin interface.

clip_image004

Click on virtual host->Host on right side

clip_image006

Users->”enter username and password for users” -.adduser

clip_image008

Setting Up Messenger

  1. Download and install spark messenger

http://download.igniterealtime.org/spark/spark_2_5_8.exe

clip_image010

IP address of Host is IP address of machine where ejabberd is installed.

clip_image012

Asterisk Failover Solution (IP Failover Solution)

Simplest way to setup a redundant asterisk system is by using UCARP application

If creates a vitual IP that will be assigned for the external world to use.

Here is my setup ,I have two machines on which asterisk is installed.

Master 192.168.0.201

Slave 192.168.0.202

Now I will create Virtual IP 192.168.0.250

Steps :

1.First thing is to install a ucarp packages to both machines this needs

Dependency : needs libpcap and libpcap-devel

Yum install libpcap libpcap-devel

This was the error when I tried to installed ucarp with installing libpcap libraries.

 
clip_image002
This shows pcap.h is missing i.e pcap library not installed.

2.Install UCARP on both machine

wget http://download.pureftpd.org/pub/ucarp/ucarp-1.5.1.tar.bz2

tar xvf ucarp-1.5.1.tar.gz

cd ucarp-1.5.1

./configure
make install-strip
 
Once installed on both the servers ucarp should be available in /usr/local/sbin/ucarp
 
 
3.Now Make Two scripts on both machine that will run whenever a UCARP Detects that other is not available so it should takeover.
/etc/vip-up.sh
#!/bin/bash
/sbin/ip addr add 192.168.0.250/24 dev eth0
arping -U –c 3 -I eth0 192.168.0.250
 
/etc/vip-down.sh
#!/bin/bash

/sbin/ip addr del 192.168.0.200/24 dev eth0
 
Note : 
1.#!/sbin/bash is necessary otherwise it will show exec format error
2.Since Router or pc caches the arp ,they might have old mac address of virtual ip ,so gratuitous arp has to be send to clear arp tables.so added arping on up screen.
 
4.Make them executable 
Chmod +x /etc/vip-up.sh
Chmod +x /etc/vip-down.sh
 
5.Now from Server1 (let it be Master)
/usr/local/sbin/ucarp -v 42 -P -p somepasswd -a  192.168.0.250 –s  192.168.0.201 –-upscript=/etc/vip-up.sh -–downscript=/etc/vip-down.sh  &
  
& From Server 2 run this command
 

Web based Terminal -Ajaxterm

Looking into some web based SSH Terminal, Found a really nice Tool Ajaxterm –

Ajaxterm is a web based terminal.

This lets to you SSH trough web browser

clip_image002

Installation steps for Ajaxterm

 
1.      wget  http://antony.lesuisse.org/software/ajaxterm/files/Ajaxterm-0.10.tar.gz
     (or Attached below)    
 
2.      tar -xvzf Ajaxterm-0.10.tar.gz


  1. Now build Ajaxterm as follows.
# ./configure --prefix=/usr/local
# make
# make install
 


  1. Add following lines in /etc/httpd/conf/http.conf

(Proxying is needed for remote access)

ProxyRequests Off

<Proxy *>

Order deny,allow

Allow from all

</Proxy>

ProxyPass /ajaxterm/ http://localhost:8022/

ProxyPassReverse /ajaxterm/ http://localhost:8022/


  1. service httpd reload
  2. /usr/local/Ajaxterm-0.10/ajaxterm.py &
  3. Access the page through http://ip_address/ajaxterm/

(leading / is necessary)

 

Note:Incase you are using lighttpd

Edit lighttpd.conf (settings for proxy server )

proxy.server    = ( "/ajaxterm/" =>
                   (
                    ( "host" => "127.0.0.1",
                      "port" => 8022
                     )
                    )
                   )

Simple SMTP

Installing Simple SMTP in Centos

Frustrated by configuring sendmail,i tried SSMTP and was amazed by simple installation and configuration step.

 

1. rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm

2. yum install ssmtp

3. Edit /etc/ssmtp/ssmtp.conf

# The person who gets all mail for userids < 500
# Make this empty to disable rewriting.
root=alok@voipone.in
 
# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named mail.domain.com
# The example will fit if you are in domain.com and your mailhub is so named.
mailhub=smtp.bizmail.yahoo.com:465
 
 [...]
 
# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
#FromLineOverride=YES
 
# Use SSL/TLS to send secure messages to server.
UseTLS=YES
 
[...]
 
AuthUser=alok@voipone.in
AuthPass=picseriesyah

4.Test the command using

echo -e "Subject: This weekend\n\nWant to get dinner friday? Call me.\n" | ssmtp sendto@mydomain.com

Optional Parameters

#mail will look likes it has come from intel.com
RewriteDomain=intel.com
 
 

PHP mail function

/etc/ /php.ini –

sendmail_path = /usr/sbin/ssmtp –t

PHP requires the -t flag.

Service httpd restart

Featured Post

XDP - Getting Started with XDP (Linux)