Sunday, November 22, 2009

Improve throughput with Intel 5100 in wireless N mode

When I test its throughput (from a wired computer) in wireless N-only mode with iperf in vista, the maximum throughput I was able to get is around 25Mbits/s although it shows 270-300Mbps data rate by windows. The router is a Airlink AR670W with stock firmware 1.01 and 40MHz channel width/Auto(DFS) channel. It's not faster than the throughput of Wireless G mode.

After I update the firmware of AR670W to DD-WRT build 13069, I found the signal quality of the Intel 5100 client is only around 23% at full Tx power (251mW) from the wireless status page. And it can only improves the throughput to ~35Mbits/s with iperf -w 64k -c intel-5100. Then I started to adjust the following things:
  1. Orientation of the two antennas of AR670W: On one position I found the signal quality of Intel 5100 was improved to 34%. 
  2. Manually set the channel number: After doing a site survey, I found the least crowded channel was not the one being picked up by DD-WRT. So I changed the channel number and the signal quality of Intel 5100 was improved to 40%

    Then I tested the throughput again, and no surprise it's now ~80Mbits/s. Even if I further increase the TCP windows size of iperf from 64k to 10M or reduce the Tx power to half (126mW), the throughput remains at ~80Mbits/s (wired to wireless). Later I had to enable the N-only wireless mode on a D-link DIR-655 router to maximize the throughput of another Intel 5100.

Friday, November 20, 2009

Samsung SGH-A887 (solstice)

  1. QUALCOM USB mode of Samsung 3G phones:


    • Dial *#782872# and confirm after 2 seconds to activate the mode
    • Connect phone to PC USB port with USB cable
    • After the drivers are installed, the following two were found under Ports
      • PHD HS-USB diagnostics 9002
      • PHD HS-USB NMEA 9002
    • PHD HS-USB Modem 9002 was installed under Modems
    • Two USB Composite Devices were installed under Universal Serial Bus Controllers
    • To exit QUALCOM mode, dial *#726872# and confirm after 2 seconds


  2. Firmware downloader mode:



    • Power off the phone
    • Remove any memory card you may have and then remove the SIM card
    • Hold down the 'Volume down' key (The bottom rocker button on the left side of your phone) and the camera button and press the power on button. 
    • A887 should start up into a screen with these on the top: DEMSBL BOOT loader for MSM6290 More than Downloader V5.43
    • Get MultiLoader V5.56 here to download the firmware for MSM6290









Sunday, November 8, 2009

Asterisk (PBX) and PAP2T

  1. hasexten=yes|no
    If the context for a peer sets hasexten=yes, Asterisk creates a hint for the user in the default context as shown below for a SIP peer 6000.
    CLI> dialplan show default
    [ Context 'default' created by 'pbx_config' ]
    '6000' => hint: SIP/6000 [pbx_config]
    1. Dial(${HINT}) [pbx_config]

    Therefore I can use Goto(default,6000,1) to ring it
  2. [general] user in users.conf
    It's set the default contexts for all other users. They can be overridden though. The following are in my [general] user (all my users are using SIP):
    fullname = My Name
    ;
    ; Starting point of allocation of extensions
    ;
    userbase = 6000
    ;
    ; Create SIP Peer
    ;
    hassip = yes
    ;
    ; Create IAX friend
    ;
    hasiax = no
    registeriax = no
    ;
    ; Create manager entry
    ;
    hasmanager = no
    callwaiting = yes
    threewaycalling = yes
    callwaitingcallerid = yes
    transfer = yes
    canpark = yes
    cancallforward = yes
    callreturn = yes
    call-limit = 100
    qualify = yes
    disallow = all
    allow = ulaw,alaw
    type = friend
  3. Asterisk directed call pickup
    I have two extensions: 6000 and 8888. Typically when there's a incoming call, only extension 6000 rings. I can pick up the call from extension 8888 by pressing the # key. Therefore I have the following in features.conf
    [general]
    pickupexten = #

    and the following in extensions.conf:
    [globals]
    voipbuster = SIP/voipbuster

    [CallingRule_pickup]
    exten = _#,1,Pickup(6000@default)
    exten = _#,n,Hangup()

    [DLPN_8888]
    include = CallingRule_pickup
    include = CallingRule_VBOut
    include = default

    [CallingRule_VBOut]
    exten = _00X.,1,Macro(trunkdial-failover-0.3,${voipbuster}/${EXTEN:0},,voipbuster,)

    I had to add the following to the Dial Plan of the line that will pickup the call in my PAP2T to pass # key directly to Asterisk: #S0
  4. Blind transfer
    I use the * key for Blind transfer. Therefore I have the following in features.conf
    [featuremap]
    blindxfer = *
    and the following in extensions.conf:
    [globals]
    DIALOPTIONS = tT

    [DLPN_6000]
    include = CallingRule_VBOut
    include = default
    include = parkedcalls
    include = conferences
    include = ringgroups
    include = voicemenus
    include = queues
    include = voicemailgroups
    include = directory
    include = pagegroups
    include = page_an_extension
    exten = _*,1,Transfer(8888)

    I had to add the following to the Dial Plan of the line that will initiate the transfer in my PAP2T to pass * key directly to Asterisk: *S0
  5. Connecting PAP2T to the telephone lines 1&2 in my house (T568A type socket): I cut one standard 2-wire RJ11 telephone cable assembly in half and connected them to Blue and Orange lines of the T568A. That will enable me to connect a phone onto the wall outlet at any room to my PAP2T.

Friday, October 30, 2009

Knowledgetree document management software

  • WebDAV:

    1. Don't rename the root folder. Otherwise access from WebDAV will be broken and the error says the folder is no longer available.
    2. No matter what name you give to the root folder, after turning on WebDAV Debug, the log shows KTWEBDAV [info] Root Folder is : Root Folder


  • Indexer Problem A: All documents are sitting in the quene to be indexed but none were indexed

    1. Change in config.ini to have loglevel=DEBUG
    2. Access forbidden error found in the log file at var/log after the following line
    3. DEBUG: call_page: calling http://dms/search2/indexing/bin/cronIndexer.php
    4. Modify the .htaccess file to allow access
    5. Enter the folder bin/luceneserver and edit KnowledgeTreeIndexer.properties to have the following contents:

      server.port=8875
      server.paranoid=true
      server.accept=127.0.0.1
      indexer.directory=../../var/indexes

    6. Indexer working


  •  Indexer problem B: File not indexed since it had the wrong extension
  1. Go to database dms table document_content_version
  2. Search for the known document_id that had indexing problem and write down its mime_id
  3. Search for this mime_id in the table mime_types: e.g. 167 has filetypes pptx but the file should have file type ppt (mime_id: 74)
  4. Update to the correct mime_id of the document in the table document_content_version
  • LDAP accounts import with uid set as default username
    Edit the file
    plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php
    locate the following line in functions _do_editUserFromSource() and _do_massCreateUsers()
    $sUserName = $aResults[$this->aAttributes[1]]
    change it to
    $sUserName = $aResults[$this->aAttributes[7]]
    Note the definition of the array aAttributes is
    var $aAttributes = array ('cn', 'samaccountname', 'givenname', 'sn', 'mail', 'mobile', 'userprincipalname', 'uid');

    In order to correct the behavior that Mass Import Search for users returns unwanted objectclasses, locate the following line in function searchUsers:
    $sFilter = !empty($sSearch) ? sprintf('(&(%s)(%s))', $sObjectClasses, $sSearchAttributes) : null;
    and change it to
    $sFilter = !empty($sSearch) ? sprintf('(&(%s)(%s))', $sObjectClasses, $sSearchAttributes) : '(objectClass=posixAccount)';
    Recently I found a need to customize the LDAP search filter, therefore now it looks like
    $sFilter = !empty($sSearch) ? sprintf('(&(%s)(%s)(!(employeeNumber=0)))', $sObjectClasses, $sSearchAttributes) : '(&(objectClass=posixAccount)(!(employeeNumber=0)))';
  • Increase Session Timeout:


    1. In Mandriva Linux, PHP Session Timeout is affected by the file /usr/lib/php/maxlifetime. Default is 1440 seconds (24 minutes). Updating the file /etc/php.d/47_session.ini to include the following: session.gc_maxlifetime = 30000 will increase the timeout to 500 minutes.
    2. The config_settings table is queryed and populated into the global variable $default in file lib/config/config.inc.php within function populateDefault()



Using the find command

  • In one case, I need to rename a bunch of files from upper case to title case (only the first letter of the file name is capitalized). For exmaple, AAA.C --> Aaa.c and ABC.C --> Abc.c

    This can be done with find and perl in the following manner:
    find . -maxdepth 1 -type f -execdir perl -e 'rename substr($_,2),ucfirst(lc(substr($_,2))) for @ARGV' '{}' \;

    Useful reference: How to rename to lowercase every file in a directory and its subdirectories?
  • How to check whether the contents of a directory is newer than 10-day old: I used the following command
    find /home/user -maxdepth 2 -mtime -10 -print -quit
    It will search the path /home/user and one level below that for anything that's newer than 10-day old and quit after a match is found.

Functions of MortScript

  1. Function to rename a directory/folder: just use Rename(oldDirName,newDirName,True) Although in the 4.1 manual it says Rename is for a file, it works for directories too.
  2. Function to enlarge the font size of Choice/ChoiceDefault: I use SetChoiceEntryFormat(45,36) when there are less than or equal to three choices to display on my 480x272 screen.

Sanyo NVM-4050 GPS

  1. Keep PNAShell.exe running for the Menu/Power button to work
  2. Kill MainPanel.exe before running Media player
  3. It can be wrapped in a MortScript to launch media player by the following command
    CallScript("MplayerLauncher.mscr", "\myflashdisk\programs\mediaplayer", "Player.exe")
    
    The content of the MplayerLauncher.mscr is shown below:
    ErrorLevel("warn")
    
    CWD = SystemPath("ScriptPath")
    
    appFolder = argv[1]
    appEXE = argv[2]
    
    If(FileExists(appFolder\appEXE))
    
    If(ProcExists("MainPanel.exe"))
    MainPanelRunning = "true"
    Kill("MainPanel.exe")
    EndIf
    
    RunWait(appFolder\appEXE)
    
    If(MainPanelRunning eq "true")
    Run("\ShellDisk\Shell\Communication\MainPanel.exe")
    Waitfor("MainPanel", 3)
    EndIf
    
    Else
    BigMessage(appFolder\appEXE&" was not found. Install the application to that path and try again.","Application not found")
    EndIf
    
  4. No native support by GAPI. Use emulator (GAPI to GDI wrapper) instead
  5. When a corrupted folder is detected in myflashdisk by the windows CE, open error checking from XP to check the flash drive
  6. CPU ARM920T S3C2443 (thanks to Checko), Windows CE 5.0 core, 480x272 screen
  7. Bootloader's menu (Sorry, not working yet)
    • Hold down the Menu button while powering it on or hard reset
    • Download the driver for SEC SOC USB Bulk IO Test Board Secbulk.* here
    • Connect the unit to PC via USB and install secbulk.inf
    • Download the USB/Serial Downloader DNW.exe here