Monday, February 2, 2009

[>30] Mounting my N80 mobile on Ubuntu Machine

This shall be the first episode in my long series called ">30" which simply means that it took more than 30 minutes. I am collecting here some of the problems that i fought with for more than 30 minutes in order not even solve it but finding a resource on the internet that can relief me from such a pain.

The first episode of this series is talking about how to mount your Bluetooth device on your Ubuntu machine. I will explain such a thing on my N80 mobile and Ubuntu machine but i think anyone can use such points on any other devices and Linux machines.

Before getting into the main point, i would like to state that this post might get you the solution or not. I am writing it while doing such a task and while i am writing such introduction, i actually reach to the steps needed to get out of such misery journey. But, anyone whether we reach a solution together or not, i think this post will put you on a track to continue from so you won't lose your time reading it.

Note: points highlighted in bold style are points related to my case so it should change from one case to another.

The journey starts in this post Mounting a Nokia Phone a Little Bit Easier which is really a nice point to start with. It states these points
  • Find out your phone’s Bluetooth MAC address if you don’t know it already:
    hcitool scan
  • Find out the OBEX FTP channel it uses
    sdptool search FTP
  • Load the fuse kernel module:
    sudo modprobe fuse
  • Make a suitable mount point for your phone:
    mkdir /media/n80
  • Mount
    obexfs -bXX:XX:XX:XX:XX:XX -BYY /media/n80
    (where XX:XX:XX:XX:XX:XX is your phone’s MAC and YY is the OBEX channel)
  • Unmount when you’re done with your file transfers:
    fusermount -u ~/Phone
the above steps depends on having some libraries installed on your pc which are obexfs and obexfs. i got them easily using apt-get. If after doing the above steps everything went well then you are done. Yes that easy but if not then continue with me to know what i did after this step.

For me, i was capable of entering the mounted folder and even list files and not only this i removed a file. i thought it is time now to copy some files from my pc to the device. after using the cp command, i took no time at all and then it finished. I was sure something went wrong because i am connecting using bluetooth and things shouldn't end that fast. I used ls command to check that it was added but then it hanged for some time and stated that the folder i am inside isn't a valid one. Simple, mounting failed. I went out and entered again and ran ls command but nothing was listed. I unmounted and remounted but it sometimes shows everything or simply nothing

In some cases, i run "hcitool scan" again and can't find my device even. I disable my bluetooth on the device and enable it to start working again.

Anyway, it was time to search for a solution for such a problem. I found this can't add files to mounted volume, no free space sony Z610i ticket. I digged inside it and read for a while and knew that they have the problem of copying files since the mounted point is stating no free space on the mounted device. They stated this is a bug and pointed to its ticket here. It stated that current version of obexfs don't manage S60 3rd edition mobiles probably and found the ticked closed invalid. Looking at comments i found someone stating that this should be fixed if i used  "ObexFTP 0.22 / ObexFS 0.11" instead of the installed ones. These should be compiled as those got by apt-get are one step behind. Ok, no problem let's compile.

prepare an empty folder then wget these files one by one
  • http://downloads.sourceforge.net/openobex/obexfs-0.11.tar.gz?modtime=1213568386&big_mirror=0
  • http://downloads.sourceforge.net/openobex/obexftp-0.22.tar.bz2?modtime=1213568417&big_mirror=0
  • http://downloads.sourceforge.net/openobex/openobex-1.3.tar.gz?modtime=1150294112&big_mirror=0
tar these files using tar -xzf for .gz files and -xjf for .bz2 files. Now lets install them in this order openobex then obexftp and obexfs. This order is important because each one depends on the previous one. But, before doing so, these are some libraries i needed while compiling so make sure you have them installed
  • python-dev
  • libfuse-dev
  • libusb-dev
  • tcl8.4-dev
  • tcl-dev
now in each folder. run "./configure" then "make" then make "install" and you should be ready to redo the steps stated above which i wrote them at the beginning of my journey.

I did so but i am sorry to say that all this was useless for me. If everything went ok with you at this step then you are ready to have fun. If not then continue with me, i still have some points to state.

I reached this link now http://www.thinkwiki.org/wiki/How_to_setup_Bluetooth, i noticed that there is a section for symbian mobiles that is different from other mobiles. seems that i have to continue searching but i think enough for me this night. maybe tomorrow. If you still have problems till tomorrow then wait for my next post that i wish will settle things and put an end to this misery
Blogged with the Flock Browser

Monday, December 15, 2008

Try Wine

Wine is a very nice thing, it is a program you can use in order to run applications dedicated for certain platforms on any other one

for example i use it to run some windows application i get to use them on my linux machine, although Wine isn't fully mature yet but a large number of applications run nice on it

Friday, December 12, 2008

Personal Area Network (PAN)

Personal Area Network or shortly (PAN) is a communication network between a group of bluetooth-enabled devices (supporting PAN)

this network can be used between these devices in the same manner as local area connection i.e you can use it to transfer files between two devices or even more you can use it in a twisted way to enable one device to use other device internet connection after configuring a bridge between it and WLAN network

anyway it is a nice technique of communication, i liked it so much and tried to use it but i couldn't because my N80 doesn't support it. i suggest everyone to make use of this powerful facility

Sunday, October 5, 2008

How to name your command line windows??

if you are one of the people that use to open so many command line windows while working then you may have faced the problem knowing which one is opened on which task

for example, suppose you have a windows doing task X and another doing Y and another doing Z and so on. all have same default name added by windows when you open a command line window. Due to these similarities you always get lost getting to the window you want in one step

to get rid of this problem, use this small tip and name them with significant names using 'TITLE' command as follows

TITLE {{desired-name}}


that's it, now you can know which windows you have and select the one you desire in a fast way

Tuesday, September 23, 2008

Rails Console Tips & Tricks II

This is my second rails console tips & tricks. if you interested in reading previous tips and tricks read my first blog post regarding that matter.

This second part is about one command called "load" that is available in your Rails console. you can use this command to do many things as

1. to reload any file that was loaded when starting console and don't get reloaded when using "reload!" command such as files in your lib folder. to reload any file just write

load "#{RAILS_ROOT}/lib/{{file_name}}"


2. if you faced a problem such as "MySQL has gone away" just reload environment.rb once again as follows

load "#{RAILS_ROOT}/config/environment.rb"


3. also if you want to test a bunch of code in your console not just a single line of code, and want to be able to change part in it and rerun it once again then doing so in console is very time consuming and annoying so rather than doing so, you can write this code in a file and then

load "{{your-ruby-file}}"

Monday, September 8, 2008

Ruby Make Problem

Still in my early days using Linux and trying to compile ruby 1.9 on my machine in order to move my working environment to Linux

I downloaded ruby 1.9 source from ftp.ruby-lang.org and as stated in readMe file, i ran

./configure --prefix={{any-desired-path}}

successfully then ran

make

it took some time then i was faced with that error

executable host ruby is required. use --with-baseruby option.

What is that error? and what ruby?? i am compiling ruby how come i need it.


Anyway, i began searching for an explanation. i reached to a comment in one of the forums stating that this error can occur in these two cases

1. ruby isn't in the default path
2. ruby isn't installed

More investigation showed that i should have any previous version of ruby installed in order to use it with that make file as follows

./configure --prefix={{any-desired-path}} --with_baseruby={{full-path-to-ruby-executable}}

then run make command once again. And it worked finally

What a nice recursive world, "ruby is needed to compile ruby"

Thursday, September 4, 2008

configure: error: C compiler cannot create executables

In my first start to use ubuntu, i wanted to compile ruby on my machine

i downloaded ruby source and executed configure file to generate make file

./configure

i got this error

C compiler cannot create executables

although i have gcc latest version installed



after investigating this error i found that the solution was

sudo apt-get install build-essential


after doing so, everything worked fine