Shaun Ahmadian

From CSL Wiki

Jump to: navigation, search

Contents

General Overview

CENS is the Center for Embedded Network Sensors. I started working 3 weeks (June 15 2005) ago for the Systems lab here at UCLA. The lab concentrates on building the appropriate framework (software and hardware) necessary for use by scientists out in the field.Now I am a graduate student working under Deborah Estrin.

My Site

Visit my site for more info on project and papers/demo:

LEAP: Multi-Tiered architecture

Cyclops project

Current

Notes

Interns

JR Deployment

Cyclops Testbed

System Docmuntation

Bugs/Issues

Inventory


IPSN

Readings

What we use

Platforms

These are the devices (with microcontrollers and flash memory) that we program. They come in various flavors here are a few that I have worked with:

  • Mica
  • Mica2
  • MicaZ
  • Cyclops (this is the platform I will be working with most of this summer)
  • Stargate (this platform is highly tied-in with Emstar )

Intro to Hardware: http://acm.cs.ucla.edu/CENS/mobisys-tutorial-hardware.pdf

TinyOS

Is the "OS" that we use to run our applications on the motes/cyclops. Here are some links I found useful while I tried to familiarize myself with the environment.

General TinyOS architecture: http://ttdp.org/tpg/html/book/x586.htm

Good TinyOS presentation by CrossBow" (the manufacturer of the motes) http://acm.cs.ucla.edu/CENS/tinyos_intro.pdf


EMSTAR

Environment

LECS Computer Setup

  • CSL Workstation
  • TinyOS (LECS)
    • If using NSF mount, you do NOT need to install all the packages listed below.
      • REQUIRED: tinyos-tools_1.1.0-2_i386.deb (for uisp)
      • RECOMMENDED:avr-binutils_2.13.2.1-2_i386.deb (for objdump, but you will have to create a simlink between avr-objdump and objdump)
    • Edit your ~/.bashrc to:
      • export TOSDIR=/full/path/to tinyos-1.x/tos
      • export MIB510=/dev/ttyS0 (or other)
      • export PATH=$PATH:/usr/local/lecs/nesc/bin
      • export PATH=$PATH:/usr/local/lecs/avr/bin

TinyOS (Personal PC)

See above if you are using NSF mounted directories.

Tools and compilers for tinyOS @ Debian packages.

An alternative source Debian+MSP+Java all-in-one

Install using: dpkg -i [name].deb. Order in which to install (tested on Debian 3.1 Sarge):

  • avr-binutils_2.13.2.1-2_i386.deb
  • avr-libc_20030512cvs-2_i386.deb
  • avr-gcc_3.3tinyos-2_i386.deb
  • nesc_1.1.2a-2_i386.deb
  • tinyos-tools_1.1.0-2_i386.deb

Then download tinyos-1.x from Sourceforge using:

  $ cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co -P tinyos-1.x
  • Edit your ~/.bashrc to:
    • export TOSDIR=/full/path/to tinyos-1.x/tos
    • export MIB510=/dev/ttyS0 (or other)

Problems:

LaTex

Packages to obtain:

tetex-base
tetex-extra

Using Latex

Basic commands to compile and view latex documents can be found here

Adding custom package/style files

From Latex Tips you should setup the following environment:

  • Place document class files (extension .cls), packages and any other custom style files for use by LaTeX (extensions .sty or .tex) into this directory.
 $HOME/texmf/tex/latex/
  • If custom bibtex style files (extension .bst) have been provided, place these into a similar tree of the form
 $HOME/texmf/bibtex/bst/ 
  • Run the "texhash" program at the command prompt.

CVS

Useful site for typical CVS commands: http://bioperl.org/UserInfo/CVSdoc/commands.html

Typically you want to set the environment variable CVSROOT:

  export CVSROOT=[username]@cvs.cens.ucla.edu:/home/cvs/cvsroot

To do update (a complete update with directories created if not already present):

 cvs update -APd

Then you can perform the operations that you want within your current working directories.

Tagged Version Checkout

Assuming you have exported CVSROOT use the following command to checkout tagged version:

  $ cvs checkout -r Cyclops_Release_0_9 tos-contrib/cyclops

JAVA

  1. JNI in Emstar
  2. Java GUI
  3. Java Almanac
  4. Pixel Manipulations
  5. JAI
  6. mySQL
  7. Java and MySQL

X-SESSION

TightVNC Download/Info Page

To install the VNC server use:

 $ apt-get install tightvncserver
 $ vncserver
   New 'X' desktop is Under:1
   Starting applications specified in /home/shaun/.vnc/xstartup
   Log file is /home/shaun/.vnc/Under:1.log

To connect to the same desktop session as the server (note "Under" is the server address):

 $ xvncviewer Under:1

To kill the server type:

 $ vncserver -kill :1  

You can cause applications to use a VNC server rather than the normal X display them by setting the DISPLAY environment variable to the VNC server you want, or by starting the application with the -display option. For example:

  $ emacs xstartup -display Under:1 &

MYSQL Server

1. To install mysql server on your machine you want to run the following

  $ apt-get install mysql-server mysql-client libmysqlclient10-dev
   <- No
   <- Yes
  $ mysqladmin -u root password yourrootsqlpassword

2. In /etc/mysql/my.cnf comment out the following line: skip-networking
3. Run in bash:

  $ sudo mysqld_safe --port=3306 &

4. To login from another computer:

  $ mysql -h 133.179.3.3 -u (your username) -p

LINKs: mySQL COMMANDS


VMware on Linux

Thanks to Tuxme and Ubuntu Forum

  1. Download and register a version of VMware Server
  2. Make sure you have kernel headers installed and some version of gcc 3.x or 4.x
  3. Untar the file and do the following:
  $ cd vmware-server-distrib/
  $ sudo ./vmware-install.pl
  1. After installation (perhaps some compilation) then run vmware:
  $ vmware


Recording video Stream

Thanks to [1] the following can be used to record streaming video/audio:

mplayer -noframedrop -dumpfile out.rm -dumpstream rtsp://url/to/file.rm

and then replayed back by "mplayer out.rm" or "xine out.rm"

Youtube vido to Mobile Phone

Free Online conversion: AVI to 3gp/mpg4

Manual conversion:

  • Download youtube-dl
  • Download amrnb source (for proper audio encoding)
  • Download ffmpeg source (for

Convert from MPG to 3GP

 ffmpeg -i video_clip.mpg -s qcif -vcodec h263 -acodec mp3 -ac 1 -ar 8000 -ab 32 -y clip.3gp

Convert from AVI to 3GP

 ffmpeg -i video_clip.avi-s qcif -vcodec h263 -acodec mp3 -ac 1 -ar 8000 -r 25 -ab 32 -y clip.3gp

Convert from 3GP to AVI

 ffmpeg -i clip.3gp -f avi -vcodec xvid -acodec mp3 -ar 22050 file.avi

Creating audio CD compilations on Linux

Thanks to Tectonic

Tools Needed:

  • mpg321
  • ogg123 (included in the vorbis-tools package)
  • normalize-audio
  • sox
  • cdrecord.
  • Apt-get the above tools
  • Convert the mp3 (ogg) files to .wav:
 for i in *.mp3; do mpg321 --rate 44100 --stereo --buffer 3072 --resync -w
 `basename $i .mp3`.wav $i; done
  • Normalize the audio in the directory of wav files:
 normalize-audio -m *.wav
  • Make sure all files are 16bit, stereo 44100Hz. Use this command to fix the problem
 sox track01.wav -r 44100 track01-new.wav resample
  • Record onto blank CD
 cdrecord dev=ATAPI:/dev/hdc -eject -pad -audio *.wav
   or OLDER VERSION
 cdrecord dev=1,1,0 -eject speed=2 -pad -audio *.wav

Bluetooth Syncing

One of the better bluetooth management tools is provided through KDE. KBluetooth

The package is called kdebluetooth, the latest Beta release did not work for me.

  1. apt-get install kdebluetooth
  2. start up the daemon: kbluetoothd
  3. In konqueror type: "bluetooth:/", and a list of devices will be shown

Pairing with device (thanks to Hillenius

  • First, create a file, for example, /etc/bluetooth/passkeys/phone like this
     echo -n "echo PIN:1234" > /etc/bluetooth/passkeys/phone
  • Edite permissions of file:
     chmod 777 /etc/bluetooth/passkeys/phone
  • Run passkey-agent
     passkey-agent /etc/bluetooth/passkeys/phone 00:17:11:1E:31:41
     where the 00:17:11:1E:31:41 is the hardware address of the device.
  • Click on the device icon
  • Request for pin to be entered in phone, enter "1234"
  • ...and you're good to go.
  • Now you can do things like:
     obexftp -v -b 00:17:11:1E:31:41 -list
     obexftp -b 01:77:01:4E:21:49 -B 9 -p greatringtone.mp3 ringtone.mp3
Personal tools