Monday, September 3, 2012

Installing Contiki 2.6 and Cooja Simulator in Ubuntu 12.04


Are you working with WSN or IoT? Probably you have heard about Contiki. Since a while I'm interested in using Contiki like operative system for a wireless sensor network. In this post I'm going to explain you how to install it in Ubuntu. Please read more about in the contiki page project http://www.contiki-os.org. In that page you can download "Instant Contiki", which is an virtual image disk where is ubuntu installed and all the contiki related things (cooja,contiki os, eclipse IDE for programming) configured, ready to use. But if you'd rather install it by your own, follow the next steps

1) Download contiki source from here.

2) Unzip the contiki-2.6.zip file

3) Try if Contiki works running an example from directory "examples". To compile the hello-world example,


cd contiki-2.6/examples/hello-world 
make TARGET=native
./hello-world.native

You should see the following output

Contiki 2.6 started
Rime started with address 2.1
MAC nullmac RDC nullrdc NETWORK Rime
Hello, world


After testing that hello world example you can clean the temporary files created during the compilation,

make clean


4) Procede installing java, because the cooja is a java based simulator,

sudo apt-get install openjdk-6-jdk

5) To compile cooja, install ant which is a compile tool,

sudo apt-get install ant


6) To compile and start cooja I gave the commands,cd tools/cooja

ant run

To remove all the temporary files created during the compilation, use ant clean 

7) If you're a begginer with Contiki OS I strongly recommend you to read the Getting started section step 3 for running Contiki on Cooja simulator.

Enjoy it!! :)





Installing player with stage

 I took a mobile robotic course and I have to do some homework with player/stage. Here I share some usefull links & tips that I found. Sorry for my short post!

How to install player stage

Usefull tutorial in http://wiki.tekkotsu.org/index.php/Player/Stage_install_instructions
  
How to solve install error fx.run()

http://old.nabble.com/Stage-install-error-td32665566.html

changing in CMake
 //Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING=-Wl,--no-as-needed

Error can't load plugin

Uninstall player, delete build folder and try all again



Enjoy robotic :)!! 

Wednesday, July 11, 2012

Problem to install mysqlworkbech

 I found some problems trying to install mysqlworkbech which is a GUI tool to manage Mysql databases. The dependence libmysqlclient16(>= 5.1.21-1) was requiered.

1) Install the package libmysqlclient16. Look at 
http://packages.ubuntu.com/oneiric/libmysqlclient16
2) Install the package libzip1, http://packages.ubuntu.com/oneiric/libzip1
3) Install other dependencies


sudo apt-get install python-paramiko python-pysqlite2 libctemplate0 libgtkmm-2.4-1c2a

4) Install workbench.
If you have not yet download can you use the next link  http://dev.mysql.com/downloads/workbench/ Please, check if your architecture is 32 bit or 64 bit before you install it.

Enjoy querying :)!!

Unable to log to session: unity problem

I was surprised after I've updated my Ubuntu 12.04 finding with the following error
"Failed to load session "ubuntu-2d" when trying to log into my laptop. I checked the log in .xsession-errors and there was a warning: xsession-errors unable to find default provider metacity
Let me tell you how I solve it.First I run the following:

sudo apt-get clean

sudo apt-get install --reinstall metacity

sudo shutdown -r now


After rebooting my desktop look a little tricky without unity. So I did
unity --reset

but result in No command found :S, so I installed with
sudo apt-get install unity
and then reboot my laptop for trying again. It worked! :)

My lesson was: if you're in trouble with a process first try to reinit it, if anything else works then try to reinstall it.

Did you have problem trying to boot with Unity? Would you like to share it?

Wednesday, May 23, 2012

.bashrc

Sometimes we need to change configurations, for example add a path for a application which I have recently intalled. I used to have a problem trying to find the .bashrc file.

By default you can find your .bashrc or .bash_profile file in your home folder which is

$ echo $HOME

Remember this file is hidden, to see it try with the 

$ ls -l 

option in your terminal. If you want to edit it:
$ sudo nano ~/.bashrc

if you are in your home folder. If not, try the next:

$ sudo nano $HOME/.bashrc

But if you don't find there, try in the next folder /etc/skel


Monday, April 2, 2012

Managing columns files with linux commands

Recently I have to manipulate a huge text file (myfile.text), with 2000 columns. I only wanted to delete one column with the title "user1_comments", but I didn't know which column number was to use some command like cut.


awk 'END { if (!f++) print "pattern not found" }/^firstWordInTheLine/{ for(i=1;i<=NF;i++){if ($i ~ "user1_comments"){print "[line="NR,"column="i-1"]", f++} }}' myfile.text


The output was [line=3 column=1209] 0

So, I found the column number (1209) which "user1_comments" has. For deleting I used nawk.

nawk '{for(i=1;i<=NF;i++) line=(i==1)?$i:((i==1209)?line:line OFS $i);print line}' myfile.text -> newfile.text

Did you tried with cut? How did you make it? :)

Cheers!