Sunday, November 20, 2011

Running mesh with OLSR with Openwrt (backfire)

1. checkout the svn source codes from official SVN repo.

2.update software packages and install them
 ./scripts/feeds update
 ./scripts/feeds install -a -p luci
 ./scripts/feeds install -a -p olsrd

3. compile the Openwrt system with Luci image

4. under Network/Interface, add new interface

5. configure the new created interface

6. configure wifi under Network/Wifi

7. ssh into the node, and edit /etc/config/olsrd, must set 'interface' to 'wl0' as we configure the wifi interface in previous step.
 config  'Interface'
              list 'interface' 'wl0'     
                                                                                                         
8. then start the olsrd, by /etc/init.d/olsrd start

Tuesday, October 25, 2011

things need to change to enable multiple hop routing

#!/bin/ash

# needed for static multihop routing
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects
echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects
echo 0 > /proc/sys/net/ipv4/conf/ath0/send_redirects
echo 0 > /proc/sys/net/ipv4/conf/ath0/accept_redirects
echo 0 > /proc/sys/net/ipv4/conf/ath1/send_redirects
echo 0 > /proc/sys/net/ipv4/conf/ath1/accept_redirects
echo 0 > /proc/sys/net/ipv4/conf/ath2/send_redirects
echo 0 > /proc/sys/net/ipv4/conf/ath2/accept_redirects

embedded linux tools for android

Busybox
http://www.androidfanatic.com/community-forums.html?func=view&id=228&catid=9

Iperf
http://www.magicandroidapps.com/wiki//index.php?title=Using_iPerf_for_Android

Rooting Galaxy S2
http://samsunggalaxys2review.org/root-your-samsung-galaxy-s2-heres-how/

enable multi-hop routing
http://thindot.blogspot.com/2011/10/things-need-to-change-to-enable.html

Thursday, September 29, 2011

Discontinuation of libhid library in Ubuntu 10.10 causes problems

root@router39:~/mesh-svn-repo/LabBrick-Control# ./LabBrickControl
./LabBrickControl: error while loading shared libraries: libhid.so.0: cannot open shared object file: No such file or directory

all you need to do is to copy /usr/local/lib/libhid.so.0 to the node that needs it.

Tuesday, September 20, 2011

How to disable GRUB 2 menu, even after crash.

Just wanted to share this with anyone wanting to know.
If your headless server crashes, GRUB2 (at least on Ubuntu Server) is designed to force the GRUB menu to load up next time it starts up, which means you are locked out of SSH until someone physically makes a kernel selection on the PC.

To prevent this do the following change to your grub.cfg file.

#nano /boot/grub/grub.cfg

You want to find this line and change it:
Code:
if [ ${recordfail} = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
And change to:
Code:
if [ ${recordfail} = 1 ]; then
  set timeout=3
else
  set timeout=10
fi
Or a number other than -1.

when install new kernel image, the system will update this grub.cfg file. Therefore, you also need to change the /etc/grub.d/00_header, find the following function:


Code:
make_timeout ()
{
    cat << EOF
if [ "\${recordfail}" = 1 ]; then
  set timeout=1
else
  set timeout=${2}
fi
EOF
}
So we need to change "set timeout=-1" to "set timeout=1" as well.

Also, please enable the "auto answering feature" for fsck:
/etc/default/rcS

Quote:
cat /etc/default/rcS
#
# /etc/default/rcS
#
# Default settings for the scripts in /etc/rcS.d/
#
# For information about these variables see the rcS(5) manual page.
#
# This file belongs to the "initscripts" package.

TMPTIME=0
SULOGIN=no
DELAYLOGIN=no
UTC=yes
VERBOSE=no
FSCKFIX=no
it is enough to change FSCKFIX=no => FSCKFIX=yes

Thursday, September 15, 2011

在Modoer2.0中更换为Google地图后修复“地图坐标不正确” 问题

在./data/cachefiles/item_field_1.php里,找“地图坐标不正确”

 4 =>
  array (
    'fieldid' => '5',
    'modelid' => '1',
    'tablename' => 'subject',
    'fieldname' => 'mappoint',
    'title' => '地图坐标',
    'unit' => '',
    'style' => '',
    'template' => '',
    'note' => '',
    'type' => 'mappoint',
    'listorder' => '4',
    'allownull' => '0',
    'enablesearch' => '0',
    'iscore' => '1',
    'isadminfield' => '0',
    'show_list' => '0',
    'show_detail' => '1',
    'regular' => '/[0-9a-z]+,[0-9a-z]+/i',
    'errmsg' => '地图坐标不正确',
    'datatype' => 'varchar(60)',
    'config' =>
    array (
      'default' => '',
      'size' => '30',
    ),
    'disable' => '0',
  ),



'regular' => '/[0-9a-z]+,[0-9a-z]+/i',
改成
'regular' => '/[\-\.0-9a-z]+,[\-\.0-9a-z]+/i',

Wednesday, August 24, 2011

gcc-linaro not found on OpenWRT

--2011-03-29 19:34:17--  http://downloads.openwrt.org/sources/gcc-linaro.tar.bz2
Resolving downloads.openwrt.org... 78.24.191.177
Connecting to downloads.openwrt.org|78.24.191.177|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2011-03-29 19:34:17 ERROR 404: Not Found.

Download failed.
similar to this
https://forum.openwrt.org/viewtopic.php?id=29329 
 
The reason is OpenWRT build system don't know what version of gcc linaro to use. 
Solve that by going into "make menuconfig" and enabling the following option:
[*] Advanced configuration options (for developers)--->
[*]   Toolchain Options  --->  
GCC compiler Version (gcc 4.5.x with Linaro enhancements)  --->
(X) gcc 4.5.x with Linaro enhancements 
 
 
 

Thursday, July 7, 2011

中国银行网上银行不能输入密码, 解决方法

进入中国银行网站后点击地址栏右边的兼容性视图按钮,再登录网上银行即可。
对于安装64位IE9的机器,在使用网上银行时要启动32位的IE9,因为有些银行(包括中国银行的安全插件是不支持64位的)。启动32位IE9 的方法是在“开始菜单/所有程序”里找。有两上IE,其中一个是Internet Explorer (64位), 另外一个没有注明64位的,即为32位IE9。

Wednesday, April 13, 2011

sorting files according to their names with number

To sort the files in a directory, such as

file_2.txt
file_12.txt
file_43.txt
file_1.txt

ls command will get you, this
file_1.txt
file_12.txt
file_2.txt
file_43.txt

if you want the sorted list to look like
file_1.txt
file_2.txt
file_12.txt
file_43.txt
according to the numeric order, then you need to sort command

ls *.txt | sort -t_ -k2 -n

-t specifies the separator
-k specifies the field id
-n indicates numeric sorting

Wednesday, April 6, 2011

Ubuntu: update-initramfs failed to pass e2fsck check

Error:
update-initramfs: Generating /boot/initrd.img-2.6.32-30-generic-pae
E: /etc/initramfs-tools/hooks/e2fsck failed with return 1.
update-initramfs: failed for /boot/initrd.img-2.6.32-30-generic-pae

Cause:
Missing configuration file for e2fsck in /etc/

Solution:
create a file in /etc/e2fsck.conf with the following content

[options]

Thursday, February 17, 2011

OpenWRT: run command on startup

/etc/rc.local


# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

logger -t 'rc.local' "Test for /etc/rc.local..."

exit 0

Thursday, January 20, 2011

howto install Ubuntu on CF card for Alix3d2 (PCengine)

Prepare the CF card 
mke2fs -L root /dev/sdb1
mkdir /mnt/alix
mount /dev/sdb1 /mnt/alix
Download the file system 
debootstrap --arch i386 lucid /mnt/alix http://mirror.aarnet.edu.au/pub/ubuntu/archive/
 
Binding all directories to the CF card
mount -o bind /dev /mnt/alix/dev
mount -o bind /sys /mnt/alix/sys
mount -o bind /proc /mnt/alix/proc
chroot /mnt/alix /bin/bash

echo alix-router > /etc/hostname
add hostname in /etc/hosts
127.0.0.1  localhost
127.0.1.1  alix-router.example.com alix-router
The following lines are desirable for IPv6 capable hosts
/etc/fstab
# /etc/fstab: static file system information.
#
# <file system>                 <mount point>   <type>  <options>                       <dump>  <pass>
proc                            /proc           proc    defaults                        0       0
# /dev/sda1
LABEL=root                      /               ext2    noatime,errors=remount-ro       0       1
tmpfs                           /tmp            tmpfs   defaults,noatime                0       0
tmpfs                           /var/tmp        tmpfs   defaults,noatime                0       0

add following to /etc/sysctrl.conf
vm.dirty_writeback_centisecs = 1500
to /etc/default/rcS
RAMRUN=yes
RAMLOCK=yes

change network setting in /etc/network/interfaces accordingly


Then finally
exit
umount /mnt/alix/proc
umount /mnt/alix/sys
umount /mnt/alix/dev
umount /mnt/alix
 
After you can login to the 10.04 system, you can use the normal ubuntu tool "do-release-upgrade" to upgrade to 10.10

Change OpenWRT default kernel version

Tweak the LINUX_VERSION variable in target/linux/ar71xx/Makefile.
Supported Kernels are listed in include/kernel-version.mk

Flash new OpenWRT image to RouterStation or RouterStationPro

make menuconfig
 *** Must enable "hotplug2" module, otherwise kernel panic


tftp 192.168.1.20
binary
timeout 60
put openwrt-ar71xx-generic-ubnt-rspro-squashfs-factory.bin
Output messages when flashing is successful
AR8316 PHY found on
MAC0AR8316 PHY found on
MAC1Ethernet eth0: MAC address 00:15:6d:c1:c6:e5
IP: 192.168.1.20/255.255.255.0, Gateway: 0.0.0.0Default server: 0.0.0.0
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Ubiquiti Networks certified release, 
version 0.9.00318M.0905121200 - built 12:01:38, May 12 2009
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: Ubiquiti RouterStation PRO Arch: ar7100pro 
RAM: 0x80000000-0x88000000, [0x00000000-0x00000000] available
Flash: 0xbf000000-0xc0000000, in 256 blocks of 0x00010000 bytes each
RESET button pressed, starting rescue mode...
TFTPD initialized on 192.168.1.20/255.255.255.0 port: 69 (Memory: [0x8006e000-0x87fe1000])
TFTPD: waiting for connection...
TFTPD: waiting for connection...
TFTPD: waiting for connection...
TFTPD: waiting for connection...
TFTPD: waiting for connection...
TFTPD: waiting for connection...
TFTPD: waiting for connection...
TFTPD: waiting for connection...
TFTPD: waiting for connection...
TFTPD: Incoming connection from 192.168.1.3:50534
Received:  2294168 bytes
Firmware Version: RSPRO.ar7100pro.OpenWrt.r23933
Initializing default partitions for 16M flash size.
Created 'kernel' - base: 0xBF030000, mem base; 0x80060000, entry: 0x80060000, size: 0x000D0000
Created 'rootfs' - base: 0xBF100000, mem base; 0xBF170000, entry: 0x00000000, size: 0x00A30000

Updating FIS directory!
...Erase from 0xbfff0000-0xc0000000: .
...Program from 0x87ff0000-0x88000000 at 0xbfff0000: .

Flashing partition 'kernel' (size: 0x000D0000, actual data: 0x000D0000)
...Erase from 0xbf030000-0xbf100000: .............
...Program from 0x8006e144-0x8013e144 at 0xbf030000: .............

Flashing partition 'rootfs' (size: 0x00A30000, actual data: 0x00160000)
...Erase from 0xbf100000-0xbfb30000: ........................................

Relevant links:
http://www.ubnt.com/wiki/RouterStation_Pro
http://blueheaven.ws/2010/05/10/routerstation-pro-openwrt-upgrade/

Sunday, January 9, 2011

SPA 3102 VOIP issues

If you have ever experienced VOIP problems with the SPA, here is a list of Q&A:

- Incoming calls work fine, but other party can't hear me in outgoing call.
'Line 1' Pref codec are in the following order: G729a, G711a, G711u
Not forcing use of pref codecs, basically, "Use Pref Codec Only" set to no.

Also someone suggested to change FXS Port Impedance to 220+820||120NF in Advanced/Regional/

RISC-v emulator

Changes are based on https://risc-v-getting-started-guide.readthedocs.io/en/latest/linux-qemu.html For Ubuntu/Debian, in addition to sud...