2009년 6월 28일 일요일

Beginning on the stargate

I think there is a 2nd alternative to using java for sending andreceiving packets from the mote.
If you look at tinyos-1.x/tools/src/sf there are some C files that followthe serial framing protocol used by the motes to send TOS packets over theserial port.
I think this directory contains the implementation of theSerialForwarder is C.
I have only used the serialsource.c and seriallisten.c and compiled themtogether to produce a TinyOS packet dump of the serial port.
So do the following on your PC:

$ cd /tools/src/sf
$ gcc -o seriallisten serialsource.c seriallisten.c
$./seriallisten /dev/ttyUSB0 57600

is where you have installed tinyos (e.g /opt/tinyos-1.x).

- xbow -

2009년 6월 18일 목요일

moteiv boomerang 환경설정

# tinyos_boomerang.sh : Prepare environment for Boomerang
# Place this file in /etc/profile.d/

export MOTEIV_DIR=/opt/tinyos-1.x/contrib/boomerang
export TOSMAKE_PATH=$MOTEIV_DIR/tools/make

# help build files in $TOSDIR/../tools/java/net/tinyos
export MIGFLAGS="-target=telosb -I$TOSDIR/lib/CC2420Radio"
export SURGE_PLATFORM=telos

for a in $MOTEIV_DIR/tools/java/jars/* $MOTEIV_DIR/tools/java
do
if [ -f /bin/cygwin1.dll ]; then
export CLASSPATH="`cygpath -w "$a"`;$CLASSPATH"
else
export CLASSPATH="$a:$CLASSPATH"
fi
done

2009년 6월 17일 수요일

windows에 T1 & T2 설치.

windows에 t1과 t2를 설치, cygwin을 이용한 개발 환경을 구축하기 위해서는

1. Java SDK 설치
java 1.5 jdk -> http://java.sun.com/

2. cygwin 설치
http://www.cygwin.com/ or
http://www.tinyos.net/dist-1.2.0/tools/windows/cygwin-1.2a.tgz
setup - Install from Local Directory - Root Directory 설정 - Select Package All install로 모두 설정 - install

3. cygwin-x 설치
http://www.cygwin.com/setup.exe
setup - install from internet - directory 설정 - 다운로드 받을 임시 디렉토리 설정 - Use IE5 Settings - FTP site 설정 - X11 항목 install - install
설치 완료 후 startxwin.sh 를 실행하여 설치 확인

4. TI MSP430 Tools 설치
http://www.tinyos.net/dist-1.2.0/tools/windows/
설치 명령 : rpm -ivh --ignoreos --nodeps --force
-base-0.1
-python-tools-1.0-1
-binutils-2.16
-gcc-3.2.3
-libc

5. TinyOS Toolchain (nesC, tinyos-tools) 설치
http://www.tinyos.net/dist-1.2.0/tinyos/windows/
-nesc-1.2.8a-1
-tinyos-tools-1.2.3-1

6. Graphviz 설치
http://www.graphviz.org/

7. tinyos 1.x & 2.x & 2.x-contrib source tree 다운로드
$ cd /opt
$ cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login
$ cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co -P tinyos-1.x tinyos-2.x tinyos-2.x-contrib

8. 환경설정
$ vim ~/.bashrc
export TOSROOT=/opt/tinyos-2.x
export TOSDIR = $TOSROOT/tos
export CLASSPATH = `cygpath -w $TOSROOT/support/sdk/java/tinyos.jar`
export CLASSPATH = "$CLASSPATH;."
export MAKERULES = $TOSROOT/support/make/Makerules
export PATH = /opt/msp430/bin:$PATH
$ source ~/.bashrc

9. java tool 컴파일
$ tos-install-jni

10. 설치 후 검증
$ cd /opt/tinyos-1.x/tools/script
$ ./toscheck

2009년 6월 2일 화요일

컴파일 및 빌드 시 target name 변경

* opt/tinyos-1.x/tools/make 폴더 내에 target name.target 파일 생성.
-> telosb 계열의 경우 telosb.target의 내용을 복사해서 사용한다.
변경할 내용은 다음과 같다.
-------------------------------------------
...
PLATFORM ?= target name
...
$(call TOSMake_include_platform, msp)
target name : $(BUILD_DEPS)
...
-------------------------------------------

* opt/tinyos-1.x/tos/platform 폴더 내에 해당 target device 폴더 생성.
-> telosb 계열의 플랫폼일 경우 telosb 폴더를 복사해서 사용한다.
상위 target name 과 같은 플랫폼 이름을 적용해야 한다.