Friday 25 May 2012

Hyperterminal Equivalent in Linux to communicate with other device

I am using minicom (like hyperterminal in windows) on my Ubuntu 11.10

Step 1  install minicom (easy go ubuntu software center and search minicom) install minicom.

Step 2 Connect your serial port to the other device to whom you want to communicate.

Step 3   on command line type
                    $dmesg |grep tty
Output : [    0.000000] console [tty0] enabled
 and output also consist of other devices connected to the ports of your computer

the output of the above command will show that on which specific port you are connected with the other device, if it is not able to show the port in the output that means your machine is not able to detect the other device. 

if it is showing the connected port then it's fine.

Step 4 Now on command line type
                     $minicom
and the minicom terminal will appear here you can set the properties of the specific port that is connected to the device (to whom you want to communicate) properties like baud rate, parity bits, stopping bits and etc.
According to the connected device support for example how much baud rate it can support upto, we will set those properties for the communication.

Hence this is at one side, i mean you have configured @ PC side port for the communication with the other device. But still if you want to test that whether or whatever you are sending on the port is able to go onto the other device, for this you have to write program on other device (consider other device is some micro controller) will do some processing on the data received from the sender, and can again send processed data to the PC and we can see the output on the terminal.
 

Wednesday 23 May 2012

Ubuntu Struggle

Unable to open Ubuntu Software Centre

 
Try out the following commands in terminal  

sudo rm -f /var/lib/apt/lists/*
sudo apt-get update
 
This is for upgrade  
sudo apt-get update && sudo apt-get upgrade 
 

Virtual Box (After Update of Kernel) 

After Updation of the kernel you will probably see that you are not able to open you operating system in virtual box, this is because you have to compile your virtual box driver again for the new kernel 

try the following steps- 
1. Removing 
sudo apt-get remove virtualbox-dkms

2. Installing it again 
sudo apt-get install virtualbox-dkms

3.sudo modprobe vboxdrv 

After trying out the above commands you will be able to use your operating in virtual box 
The other alternative is you can install virtual box software from ubuntu software center again. 



Friday 18 May 2012

"Start of Project - PHASES Description"

Briefly i have described about the project and the capabilities of P3DX and what we gonna do.
The way we started is something like that. The first thing that we decided to use microcontroller from NXP LPC 1768 having arm cortex m3 processor embedded on it. Why we have used this microcontroller? I don't have  concrete reason except it was cheap :) and cortex m series processor was sufficient to accomplish our tasks.
 The programmer or the JTAG that we have used was Emlink for programming the board.
The first thing was to prepare the high level design (hld) that was the structure that how we gonna progress, and aakash did this job. He guided me and showed that how we can complete our project in the steps.
Divided the whole model into the tasks and identified the tasks. Identified that which are the tasks our robot should perform. It was simply like
robot should perform
1. serial communication task (sct.c) - this c code will handle the serial port where the serial port will continuously here the messages from the onboard computer or the pc connected to the laptop and process those messages accordingly and send them to the other tasks

2. Ded reckoning Task - this is mainly the task which is controlling the motor
 3. Buzzer Task
 4. Health and diagnostic task
 5. Sonar Task
6. TFT task - task handling the display 
As from the name it is clear that what are the functionalities of these tasks.

This is what the high level design of the bot.
And the stages in which we will complete our work is something like that

 STAGE 1.  The first task was to set up the toolchain because we will write the code in c language and that can only be compiled on our laptops or desktop we can not compile the code on the microcontroller itself simply we gonna only give binary to the board so the first task was to find out a complete toolchain that can be used to compile the code that will generate the binary compatible to the arm cortex m3 board. (Talking about Cross Compilation).
I have searched lots of toolchains and gained a good knowledge and finally i decided to use Code Sourcery G++ lite toolchain it was pretty much good toolchain and good support and nice online help was available "How to use the toolchain" i  will come up with the separate tutorial on toolchains and also how to install  toolchain i mean how you can use this toolchain on your linux machine.

STAGE2- stage 1 was accomplished and we decided to use code sourcery g++ lite and the way we can compile our program using g++ lite is simply
$arm-none-eabi-gcc options and -o target.

STAGE 3- The next tasks was to make the board in running state. Here i have used the demo available on internet and made a Makefile to compile the code systematically and used keil to port my .elf on the board.  The step was successful and we made it in running state and this much work we complete very
fast.

STAGE 4- The above step was to just test the board the main thing is to use a real time operating system and here aakash suggested to use FreeRTOS. So the next task was to read about FreeRTOS and read about the API'S of the FreeRTOS. Because ultimately all the tasks that we have divided above like sct.c buzzer.c etc all we gonna write using the API's of FreeRTOS.

STAGE 5- Porting of FreeRTOS on the evaluation board. Here we have tried alot and i wasted almost my 1 month to try it, but finally i was able to port FreeRTOS on this board and this i have already described in my other post.

lot of work to do now we have to write all the tasks using api's of FreeRTOS this is almost the longest work that we have to do, but i think not much difficult we can do it.. Aakash is great guy he would guide me and i will do it really fun to work with him and after FreeRTOS porting i am very enthusiastic and motivated  to complete it, without his help this would not be possible to reach upto here ...

concrete description of the stages will be followed in other posts. .
Cheers .... . 


"FreeRTOS port on NXP LPC1768 GCC Compiler"

Cheers!!! Long time after Feeling this kind of pleasure because what i thought i did that ... because of the grace of god and obviously some human beings are also responsible they came in the form of God.
As i was talking about the P 3DX robots and we gonna make prototype of P3DX robots (robots same like P3 DX ) with more functionality and power than present P3DX has and the important thing is that we gonna make right from the physical structure of the robot to all the softwares required to make our bot working.  In totality the robot is fully made by us only.
   Actually P3DX provide development environment for the robots which are used for the mission critical purposes. I mean they are very basic and more complex robots can be developed using these bots by extending them like attaching more number of peripherals to them and etc.
From past 2 weeks i was having great stress on me those were very anguishing days for me because we were not able to get progress on our project and we just stuck at one point. Aakash was busy with his product and all the way i was the only who was trying to make it work. The task was to port FreeRTOS on the board NXP LPC1768 that we bought for our project. Everything we have done correctly but the board was not responding, we were not able to port correctly. I thought that i will port before Aakash and this problem i will solve before aakash but as time was progressing and i was not able to catch the bug i was frustrated, at last one night i decided i will port FreeRTOS today at any price,  i tried very hard i was tracing the code (In between i faced lot of problems because i was running my windows in Virtual Box and also i formatted my laptop once just leave those intricacies those are painful) and the night was 15 May night, I was struggling with my code, for debugging purpose i used a LED of the board and i was playing with the led inserting the instructions for led on off in between the code same like inserting printf statement (used in C) for debugging the program i think the best way to grab the bug (Thanks to aakash he suggested the way). The program was simply blink the three led's of the board with different- different frequencies.
FreeRTOS was managing the three tasks, where each task was responsible for one led.

I was at the last stage of debugging my program and here i got that where is tick interrupt handler.........  i was continuously thinking that where this tick handler is. I just opened the startup.c and found that the handler is systickhandler  and where is the code of the tick handler ? And i found no where that means it is going into the default handler which is nothing but a infinite loop it means i have to give port specific handler to my startup.c and i thought probably this is the only error that has not been traced yet,  what i did is i gave the names of the port handlers in the startup.c .. the names were there in port.c and xportsystickhandler, and two more handlers i just gave those name in the startup.c.. Compiled the program and ported my .elf on the LPC 1768 board and code is up for running the great part is all the three led's were flashing with different frequencies yes yes yes ... i did it  Led's are flashing.
 And yes I did it. The pleasure i am feeling today, i did not feel something like this from past 6 months. I was able to do it probably because Aakash was involved in some other stuff otherwise probably he would be able to do it before me, and also Credit goes to Shreya Ghoshal as i was hearing her songs when i was debugging the program and in the meantime i watched her interview too. Thanks Shreya i love you, you constantly and continuously inspire me don't know how but you do it somehow.
 I will come up with more finer details about the project in my next posts.

Tuesday 15 May 2012

"P 3DX Decoded"

Introducing P3DX robots. Robot on which i am working.
 The base Pioneer 3 DX platform arrives fully assembled with motors with 500-tick encoders (controlling motor), 19cm wheels, tough aluminum body, 8 forward-facing ultrasonic (sonar) sensors, 8 optional rear-facing sonar, 1, 2 or 3 hot-swappable batteries, and  complete software development kit. Add an optional internal computer or your own laptop and the robot is ready to go.
 Typically P3 DX uses Hitachi H8S based microcontroller.

The Pioneer 3 DX is an all-purpose base, used for research and applications involving:
  • mapping
  • teleoperation
  • localization
  • monitoring
  • reconnaissance (french word for recognition) military use reconnaissance to track their enemies
  • vision
  • manipulation
  • autonomous navigation
  • multi-robot cooperation and other behaviors     
Pioneer 3 DX runs best on hard surfaces. It can traverse low sills and household power cords and climb most wheelchair ramps. It can reach upto 1.6 m/s and have 23 kg payload capacity.
P3 DX has all of the basic components for sensing and navigation in a real world environment.

All the things are managed by onboard microcontroller and mobile robot server software running on this onboard microcontroller. 
On board microcontroller have open systems robot control software running on it(mobile server), and the other is robot also come with Pioneer SDK, a complete set of robot control client software applications and applications development environments also.
Hence essentially robot consist of
         1. Micro controller for acquiring sensors readings, motor control, managing attached accessories like gripper
         2. Mobile server software runs on micro controller so our microcontroller behave like a server
         3. For the completion of client server architecture, a client software run on onboard computer or a laptop(connected with the robots microcontroller via a HOST serial link) provides high level intelligent robot control, including obstacle detection, path planning, features recognition, localization, navigation

Pioneer SDK  is a collection of libraries and applications that come with very pioneer mobile robot so ofcourse with P3 DX also it includes
    (a) open source ARIA ArNetworking
    (b) Mobile eyes
    (c) 3 Basic Network GUI applications
    (d) SonARNL
    (e) MobileSim

(a)  ARIA- Provides interface and framework for controlling and receiving data from all pioneers its simply extensible framework for client server network programming

(b) MoblileSim- It is a GUI application for configuration

(c) SonARNL  used for the sonars 

Modes of Operation-
1. Server- easy access to robot's functionality
2.Maintenance and standalone- This mode is generally used to upgrade the ARCOS software on the microcontroller
3. Joydrive- In this mode you can control your robot using joystick with client server implementation.


Thursday 3 May 2012

Where is my Enthu?


         The day i entered in IIT. The only aim of mine was to learn and learn as much as you can. The only thought in my mind was learn with limitless boundaries and i have enjoyed the consequences of it but all of sudden the aim was shifting from learning to making marks and i was hanging between the two sides of the rope where one side is learning and another side marks. I started blogging and took some good initiatives but in the mean time i feel that i have not done proper justice with what i thought and what i did. Initial days were very satisfying and they were increasing my self belief. I could not maintain  my persistence and discipline.
   I don't know but, I am distracting from my goal. Why i am going like very passive. You should be proactive saurabh. Really I Need motivation.
For What and why i get distracted, i don't know but god please help me to get the same enthusiasm and zeal as i was having before. How can some one distract me.... One reason of my distraction is, my very bad and worthy less investment of time on Internet. I just over utilizing the Internet and getting under utilized performance.
              I think i have to take the initiative and i have to create the environment that is beneficial for all. (Random thought came in my mind and wrote it ..)
         One problem also, that sometimes i don't deliver "gyaan" which i have with me to others... and here techbuddy's concept "read" "write" and "speak" i am not applying.
Facebook, orkut all social networking sites are just useless fellows, why i have wasted my lot of time on them.
Hey one thing you should know how to use these resources (Facebook, gmail, and internet......). I should make them my slave not like they make me slave.
      Today Someone inspired me. The name of the guy is Aakash and this post is dedicated to him only. What a worthy guy he is. I always love to talk with him. I like his attitude towards life, great great really. He is really true motivation for me. Aakash you really motivated me today.  I read about several personalities, all have done great and inspirational work in their respective domains but i never communicated with them.
Last book i have read was describing the personalities of several corporate Tycoons like
Ashank desai, Ashok Wadhwa, Dilip Chabaria, Zia Moody, Suresh Talwar, Atul Nishar, and so many but did not communicated with them ever in my life.
There are lot who motivated me, one of them is my father, Aakash is also there in the list. The real thing is that i can make conversation with them and sort out my problems.
Last two or three para i am saying about aakash but i know you are bit irritated that who is this guy and what does he do ?
             He is an entrepreneur by profession having his own company "MindField Technologies" and doing whatever is his passion. There are also some of the characteristics he is sharing with the big tycoons. Like his simple and jolly nature, always happy, enthusiastic (I am lacking with that but he made me that if i can do it you can also do it.), he don't underestimate others, and helping (this is the biggest characteristic and very common among entrepreneurs) and also sound technical skills.  ( I also want to share these characteristics).
             One of the latest achievement of MindField that they made 3d printer. We are very less aware about 3d printer, When I got to know that they made 3d printer i thought what is 3d printer it prints 3d objects or what, i mean what it does? If you don't know just search 3d printer on YOU TUBE and you will get to know about it....

In some sense i am publicizing their company but  i know they deserve  it.
Even he has small company but motivating and accessible to me :).

hey saurabh you can also do it. If anytime and at any point you feel distracted saurabh just open this post and read it.
This time i am again recollecting  my strengths i think i will make best out of me.
                                   Appreciation is the key ...