Daily Archives: February 10, 2014

EECE 380 L2B5 Third Weekly Memo

MEMORANDUM

FROM: EECE 380 Lab Group L2B5

TO: Dr. Michelson and Lab TAs

DATE: February 9, 2014

SUBJECT: Third Week Summary

 

In this week, we primarily worked the lab from last week, which is using FFS to send data generated from the orbcomm modem. We found this lab to be a bit challenging because we encountered a couple of issues. The first problem is Position_Fix (gets GPS information) is never successful; in other words, it moved update GPS Crumbs to timer_0 case. The other issue is that we had to change many things to un-related/un-depend if from the GPS incoming data.

  • fixtimeJs from GPS.get PosData to 12
  • array is now only a counter

With our effort and the help from the TA, we were finally able to get DemoFFS successfully working.

Shell scripting.

This part of the memo documents the process of shell scripting using linux server provided by ECE department of  UBC. The objective is to create an automatic system which receives the data from the orbcomm modem and output it to a text file. The difficulty of this lab is to learn and understand linux’s shell scripting from zero in CLI. First, we need to open a session using putty in ssh mode. The Host name in this case is username@ssh.ece.ubc.ca and followed by password. We need several Linux commads in order to modify and navigate inside the linux system. The command used in this lab includes:

  1. ls –a               display what files is in the current folder.
  2. cd xx              open a directory in the folder.
  3. cd $home      return to the home directory.
  4. vi xx               open the file in text editor.
  5. sh xx.sh         run the .sh script
  6. crontab –e    edit crontab to schedule automatic commands
  7. crontab –l      display crontab file
  8. rm xx              delete file
  9. cat xx               create file
  10. tab key            to auto fill the name
  11. in text editor

a)      i                  to insert. To edit text

b)      esc key      to exit insert mode

c)      :q                to quit text editor

d)     :wq             to save and quit text editor

e)      :q!               to quit without saving

The orbcomm modem sends emails containing data gathered from sensors to our group gmail account. And using the filter settings in gmail, it will forward all emails with the subject line of “ L2B5 Group” to z2l8+orb@ece.ubc.ca, which is an orb folder we created in our email client using .forward+orb file containing:

~/Maildir/.orb/

We then aggregate mail using bourne shell by creating myscript.sh script file under the home directory. When the script is run, it takes emails (with .plover extension) from /Maildir/.orb/new folder, and outputs the emails into orb.txt file in the home directory.

The next step is to schedule myscript.sh to run automatically without user prompting it. This is done using the built in crontab function inside the linux server. We type       crontab –e command to open and edit crontab. The command to run the script every minute is:

* * * * * sh myscript.sh

The first five input mean the repition time between consecutive commands. In this case * means  all legal value, and Since the smallest time precission allowed is minute. five asterik is used before the command meaning every minute.

Summary

The above procedures create a bridge between the orbcomm modem and our computer. This way we are be able to access the data collected from the orbcom modem from a distant location and process it. In the project the email message saved in to orb.txt  will be used in the actuator of our project.

Sincerely,

EECE 380 L2B5