login | register
Mon 12 of May, 2008 [03:08 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.
 
Google Ads
Shoutbox
  • Nick Barnes, Fri 09 of May, 2008 [11:36 UTC]: Christopher - yesterday I tried an Asterisk install on a CentOS 5.1 box with stock GUI and it all worked fine. Sorry I can't help.
  • aero, Fri 09 of May, 2008 [08:20 UTC]: can someone help me out on this, i tried to play some sound files on my asterisk box and this is the error message i got. WARNING[4429]: format_wav.c:169 check_header: Unexpected freqency 22050 May 8 11:17:39 WARNING[4433]: codec_gsm.c:194 gsmtolin_fra
  • Christopher Faust, Thu 08 of May, 2008 [14:15 UTC]: I beleive that I may have to change something in the xserver configuration. Please advise
  • Christopher Faust, Thu 08 of May, 2008 [14:14 UTC]: Everything was perfect. In the bios I have increased the memory allocated Still receive input not supported on my display.
  • Christopher Faust, Thu 08 of May, 2008 [14:13 UTC]: This would not be my main box. I am doing some testing to see if I can install zaptel and asterisk 1.4 on a full centos 5.1 box with development software Its bizzare, because before I went through the asterisk and zaptel installation everything was perfe
  • Nick Barnes, Thu 08 of May, 2008 [13:44 UTC]: Christopher - I can't see any way in which an Asterisk installation would muck your GUI, but remember that it is advised not to use a GUI on an Asterisk box anyway.
  • Christopher Faust, Wed 07 of May, 2008 [15:28 UTC]: When I try to startx I ge input not supported. Though before installing asterisk I had no video issue to start the GUI
  • Christopher Faust, Wed 07 of May, 2008 [15:26 UTC]: Hi Nick, I got centos 5.1 and asterisk up But now I cannot start startx I have set the depth from 24 to 16 for the video i810 driver for the i845 on my netvista machine but I cannot start GNOME. Please advise
  • Nick Barnes, Wed 07 of May, 2008 [10:01 UTC]: Howard - You'll need to provide a lot more information if you really want help.
  • Nick Barnes, Wed 07 of May, 2008 [10:00 UTC]: Christopher - Search the Wiki and you'll find a page I wrote detailing exactly what you have to do for Asterisk 1.4 + CentOS 5.1.
Server Stats
  • Execution time: 0.79s
  • Memory usage: 2.21MB
  • Database queries: 32
  • GZIP: Disabled
  • Server load: 0.92

IP04 Open Hardware IP-PBX

The IP04 is an open (free as in speech) four port IP-PBX design that can be built for around $100 and will retail for around $400. Both the *hardware* and software are open. The goal of this Wiki page is build community generated content for the IP04, for example configuration and How-To's.


Links

  • IP04 and IP08 producer:ATCOM
  • IP04 page on the Free Telephony Project site.
  • Astfin is a Blackfin uClinux Asterisk distribution used to generate the IP04 firmware. The authors have used Buildroot to simply the very complex embedded build process.
  • The IP04 is similar to the Asterisk Appliance (AA) and several other embedded Asterisk products. Here is a comparison of the AA and IP04.
  • EdgePBX a based David's IP04 product for china users, and it still is open, including hardware and software.

How To - Asterisk Set Up on the IP04


The IP04 is actually easier to set up than most other Asterisk systems:
  • Asterisk is already installed - no Asterisk or even Linux installation required.
  • The Hardware is already installed - you don't have to pull the lid of your PC and install cards.

TODO - Step by step instructions on configuring an IP04 with the GUI or .conf files, assuming it is already flashed and tested. The audience is a reasonably technical administrator, who will at least be familiar with Windows but perhaps not with Linux and uClinux. Just basic Asterisk configuration examples, Asterisk is well documented on other sites.


How Tos - Technical


The following sections cover how to take an IP04 from a blank state (i.e. a newly constructed IP04 with erased flash) to a working IP-PBX. Useful for those hacking the IP04 and/or building their own IP04s (the hardware design is open, remember!).


HOWTO - Create a uClinux/Asterisk uImage for the IP04


$ svn co http://svn.rowetel.com/software/astfin/branches/astfin-ip04/ astfin-ip04
$ cd astfin-ip04
$ make menuconfig
  ** Target Architecture (IP04 IP-PBX) 
  ** Package Selection <*> Zaptel <*> 4fx <*> oslec 
$ make
$ make image
$ cp image_ip04/uImage /your/tftpboot

HOWTO - create u-boot for the IP04


Note that uBoot isn't built by default.

astfin-ip04$ make uBoot

This will generate:
 build_ip04/u-boot-1.1.5-bf1/u-boot.ldr: serial flash image
 build_ip04/u-boot-1.1.5-bf1/u-boot.bin: image you can execute for u-boot

u-boot Notes


To just make u-boot without making the entire astfin:
 
 astfin$ make uBoot

Clean u-boot (it's a good idea to make clean if you modify ip04.h):

 astfin$ make uBoot-clean

Create u-boot patches for IP04:

 astfin$ make uBoot-make-patch

NOTE: You will see something like this at the end: "make: uBoot-make-patch Error 1 (ignored)", this is an artifact of patch and is expected.

NAND Flash Config Notes


You shouldn't have to change this unless you change the NAND flash size from the default 256 MByte. However here is how to configure NAND flash:

 astfin$ cd build-ip04/uClinux-dist
 astfin$make linux_menuconfig

 Dig through the config menus to here:

   Linux Kernel Configuration 
     Device Drivers
       Memory Technology Devices (MTD)
         NAND Flash Device Drivers

Notes:

1/ uClinux-dist/linux-2.6.x/drivers/mtd/nand/bfin_nand.c

2/ The default size is 256M (0x10000000), and base address is 0x20000000.

3/ The NAND is divided into two partitions. The first partition is 8M (kernel), the second partition the remaining space and is used for yaffs.

HOWTO - Modify uClinux Configuration


1/ cd to the uClinux-dist folder:

 astfin-ip04$ cd build_ip04/uClinux-dist

2/ To change linux config (e.g. drivers, file systems, vendors/Rowetel/IP04/rc):

 uClinux-dist$ make linux_menuconfig

3/ To change applications (busy box etc):

 uClinux-dist$ make config_menuconfig

4/ Then remake the astfin image as per usual:

 uClinux-dist$ cd ../../
 astfin-ip04$ make

5/ These will just be temporary chnages to your local build tree. To
capture the changes to patches/config files to astfin:

 astfin-ip04$ make uClinux-ip04-make-patch

HOWTO - Recreate the Zaptel patch file


To (re)create package/uClinux-dist.mk/zaptel2.patch:

 astfin-ip04$ make uClinux-zaptel-make-patch


HOWTO - Copy a single file or dir to the IP04


Sometimes you want to test something without building a new uImage.

Use rcp (you need this installed on your host):

 rcp /home/david/tmp/t.txt root@ip04:/var/tmp

For some more info on rcp see the blackfin docs:

 http://docs.blackfin.uclinux.org/doku.php?id=remote_shell&s=rcp

GOTCHA


If you change anything in busybox (e.g. through make config_menuconfig),
it's a good idea to:

 astfin-ip04$ cd build_ip04/uClinux-dist/user/busybox
 astfin-ip04$ make clean

before rebuilding. The uClinux-dist build process doesn't seem to
capture changes to busybox well.

Initial Flashing using JTAG


I use a version of jtagprog hacked for the M25P20 as described above and an IGLOO cable. It takes about 20 minutes to write, or 45 for a write and verify. I got impatient after a while so I tend to Ctrl-C
out once the verify starts. Here are the commands I use to program the SPI flash:

jtag> cable parallel 0x378 IGLOO
Initializing Excelpoint IGLOO JTAG Cable on parallel port at 0x378
jtag> detect
IR length: 5
Chain length: 1
Device Id: 01010010011110100101000011001011
 Manufacturer: Analog Devices
 Part:         BF533
 Stepping:     5
 Filename:     /usr/local/share/jtag/analog/bf533/bf533
jtag> initbus bf532_bf1
jtag> spidetectflash 0
All 0xffs returned
Making the dangerous assumption that we have a M25P20!
SPI FLASH:
       Manufacturer ID: 20
       Memory type: 20
       Memory capacity: 12 (262144 bytes)
       Chip: STMicroelectronics M25P20
jtag> spieraseflash 0 4
erasing:
jtag> spiflashmem 0 u-boot.ldr
program:
addr: 0x00019B84 (done)
verify:
addr: 0x00013F60

Using u-boot to Test u-boot


ip04>tftp 0x1000000 u-boot.bin
ip04>go 0x1000000

NOTE: I had to remove a lot of options from u-boot to get the NAND code to fit in the 128k allocated by boards/ip04/config.mk. Lowering TEXT_BASE didn't help - u-boot wouldn't run. Not sure why, if any one
knows how to allocate more room for u-boot please tell me!

You can see if you have exceed the 128k limit by:

 $ grep PROV u-boot.map
 
Look at this line of the grep output and make sure it doesn't exceed 0x03ffffff (64M system):

 0x03ffe6b8                PROVIDE (end, .)

Note that the linker will quite happily place code and data outside of this limit - you need to check manually.



Using u-boot to Upgrade u-boot


NOTE: Make sure it's the u-boot.ldr file you tftp and write, not u-boot.bin which is used when testing u-boot using 'go'!

ip04>tftp 0x1000000 u-boot.ldr
ip04>eeprom write 0x1000000 0x0 $(filesize)
ip04>reset


Testing uClinux uImage


I have some u-boot environment variables set up like this:

 bootargs=root=/dev/mtdblock0 rw
 addnet=setenv bootargs $(bootargs) ethaddr=$(ethaddr)
 ramboot=tftp 0x1000000 uImage.ip04;run addnet;bootm 0x1000000

uImage.ip04 is placed on your tftpserver. Then to download and start uClinux:

 ip04>run ramboot

Notes:

  1. The ethaddr (the MAC address) is passed via the kernel command line, in this case the same MAC as u-boot is used.

  1. To set up environment variables like those above use quotes to make sure the spaces are processed correctly, e.g.:

  ip04>setenv bootargs 'root=/dev/mtdblock0 rw'

Writing a uImage to NAND


ip04>tftp 0x1000000 uImage.ip04
ip04>nand erase clean
ip04>nand write 0x1000000 0x0 0x4c0000

Notes:

  1. During the tftp step bytes transferred = 4b6901 hex. 'nand write' needs to have the size of the write rounded up to the nearest sector size. 'nand info' gave me a sector size of 128 KiB (0x20000 hex) so I rounded up to 0x4c0000.
  2. Make sure that the u-boot environment variable "autostart" is set to no, or else u-boot will try to immediately boot the uImage.ip04 after it is downloaded.
         ip04>setenv autostart no

Reference:

  1. Blackfin uClinux u-boot and NAND flash docs.



How To set up NAND/yaffs for root


This is a little indirect as the user-mode yaffs tools like mkyaffs are broken. The process is:

  • boot a uImage that contains the kernel and root fs on a ram based ext2 file system.
  • copy the root fs to yaffs
  • reboot mounting yaffs as root

These steps were adpated from Frank Hoffman's instructions.

  1. wget http://www.rowetel.com/ucasterisk/downloads/ip04/uImage.ext2

  1. First tftp the ext2 uImage and load into the kernel section of NAND flash. We need the ext2 image for the next step (copying files onto yaffs).

  In u-boot:

  ip04>tftp 0x1000000 uImage.ext2
  ip04>nand erase
  ip04>nand write 0x1000000 0x0 0x48000

  (see Note (1) in "Writing a uImage to NAND" section above re 0x48000)

  ip04>bootm 0x1000000

  1. Now we have the IP04 booted, but using a ram-based ext2 file system for root. So we need to copy /root into the yaffs file system:

  On the IP04:

    root:~> copy_rootfs.sh
    root:~> reboot

  1. Now set up u-boot to mount root from yaffs (some of these env variables may be set already, use 'print' to check):

  ip04>setenv autostart yes
  ip04>setenv addnet 'setenv bootargs $(bootargs) ethaddr=$(ethaddr)'
  ip04>setenv bootargs root=/dev/mtdblock2 rw
  ip04>setenv nandboot 'run addnet;nboot 0x2000000 0x0'
  ip04>setenv bootcmd run nandboot
  ip04>save
  ip04>reset

Notes:

  1. Don't used mkyaffs, it is very broken for flash chips with 2048 byte pages, like the one used by the IP04! It will fail badly. To recover use nand erase in u-boot.

  1. In u-boot 'nand dump' is helpful, for example after a nand erase:

  ip04>nand dump 0x0

  (you should see a flash "page" of 2048 0xff's + 64 OOB 0xffs)

  After 'nand write' use nand dump to see the uImage in NAND.

  1. For reference a typical boot sequence is here:

  http://www.rowetel.com/ucasterisk/downloads/ip04/ip04_boot_typical.txt

  1. To get some stats on the yaffs file system

  root:~> cat /proc/yaffs

How To - Erase/Format yaffs


This section has a little more information on yaffs, see also " How To set up NAND/yaffs for root".

In u-boot:

ip04>nand erase clean 0x800000
ip04>nand erase 0x800000

The 0x800000 ensures you don't erase the first 8M of NAND flash that is used to store the uImage (kernel plus root in ext2 filesystem). If you havent written the uImage or don't mind blowing it away it's OK to remove the 0x80000 which will erase the entire NAND chip.

Check bootargs root=/dev/mtdblock0 using:

ip04>print

Then reset and allow uClinux to boot:

ip04>reset

Now try mounting yaffs:

BusyBox v1.4.1 (2007-06-01 01:29:28 CST) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

root:~> mount /dev/mtdblock2 /mnt
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: auto selecting yaffs2
block 948 is bad
block 1061 is bad
root:~> umount /mnt/
root:~>

Then copy the root file system onto yaffs. There is a script for this but at the moment the permissions are incorrect:

root:~> chmod u+x bin/copy_rootfs.sh
root:~> copy_rootfs.sh

Now reboot into u-boot and set boot args to boot with yaffs as root.
Use print to determine your current bootargs:

ip04>print
<snip>
bootargs=root=/dev/mtdblock0 rw ethaddr=00:09:45:53:d1:b3
<snip>

Now re-set this environment variable, just changing /dev/mtdblock0 to /dev/mtdblock2. Make sure you retype the same ethernet MAC as currently set in _your_ bootargs:

ip04>setenv bootargs root=/dev/mtdblock2 rw ethaddr=00:09:45:53:d1:b3

NOTE: Don't just blindly copy the line above - this is _my_ ethernet MAC!

Check it's typed in OK:

ip04>print

Then save and reset:

ipo4>save
Saving Environment to EEPROM...
0x0003FFFF
ip04>reset

Allow the IP04 to boot into uClinux, and check you are using yaffs as root:

BusyBox v1.4.1 (2007-06-01 01:29:28 CST) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

root:~> mount
rootfs on / type rootfs (rw)
/dev/root on / type yaffs (rw)
<snip>

A good test for the IP04 and yaffs is to install some prompts. There is a script for this:

root:~> chmod u+x bin/install_asterisk_native_sounds.sh
root:~> install_asterisk_native_sounds.sh

NOTE: tab command-line-completeion is your friend here. No need to type long command lines.

These prompts are ulaw versions and sound a lot nicer than the default GSM prompts. The cool thing about the IP04 is that we have plenty of space in NAND flash so 5Mbyte of prompts is no big deal. This script downloads the prompts from the internet using wget, so you need to have an Internet connection to the IP04.

Yaffs Problems


If, just after the 'umount /mnt' above you get endless messages on the console for example:

root:~> umount /mnt/

<snip>
yaffs block 1876 gc prioritised
yaffs block 1877 gc prioritised
yaffs block 1878 gc prioritised
yaffs block 1879 gc prioritised
<snip>

The try the erase command above again. For some reason you need to run _both_ erase commands, and the order you run them is important.

Note that using u-boot to erase/format yaffs is a hack - in the future we hope to use mkyaffs from the uClinux command line, but at the time of writing it isn't working (either on the host or target).

Thanks to Alex Tao for working out this procedure.


How To - set zaptel driver wcfxs parameters


The zaptel drivers (including wcfxs) are compiled into the kernel. To set module parameters, the kernel command line can be used.

In this example we set opermode=AUSTRALIA and fxshonormode=1. At the u-boot prompt:

ip04>setenv bootargs root=/dev/mtdblock2 rw wcfxs.opermode=AUSTRALIA wcfxs.fxshonormode=1
ip04>print
<snip>
bootargs=root=/dev/mtdblock2 rw wcfxs.opermode=AUSTRALIA wcfxs.fxshonormode=1
ip04>save
Saving Environment to EEPROM...
0x0003FFFF
ip04>reset




Created by David Rowe, Last modification by lolo on Fri 09 of May, 2008 [08:34 UTC]

Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2008 VOIP-Info.org LLC

Powered by bitweaver