Sunday, 25 October 2009

Using gphoto2 and Ubuntu to upload files to a phone

My aunt asked me to upload an mp3 (Satisfaction by the 'Stones) to her Nokia. The phone (Nokia 6300) has a USB mini connection so I plugged it into my netbook (Samsung NC10 running Ubuntu 9.04 netbook remix) using the charging cable from my PS3.

The phone mounted fine (appearing as a camera for some reason) and I could browse the folders but Ubuntu wouldn't let me paste the file over, throwing a -108 error 'file not found'.

After a bit of searching I found a program called gphoto2 which solved the problem...




I installed gphoto2 using the command line:

Code:
sudo apt-get install gphoto2

On connection the phone asks you to choose data or Nokia mode (which seems to allow tethering). Select data.

cd (change directory) to the folder which contains the file which you want to upload.

Code:
cd Desktop/

For uploading to a phone the only gphoto2 options you need are -l and -u.
Perform gphoto2 -l to see the directory structure of the phone.

Code:
gphoto2 -l

Which gave the following output:

There is 1 folder in folder '/'.
- store_00010001
There is 1 folder in folder '/store_00010001'.
- Gallery
There are 8 folders in folder '/store_00010001/Gallery'.
- Graphics
- Images
- Music files
- Received files
- Recordings
- Themes
- Tones
- Video clips
There are 4 folders in folder '/store_00010001/Gallery/Graphics'.
- Clip-art
- Frames
- Screen savers
- Wallpapers
There are 0 folders in folder '/store_00010001/Gallery/Graphics/Clip-art'.
There are 0 folders in folder '/store_00010001/Gallery/Graphics/Frames'.
There are 0 folders in folder '/store_00010001/Gallery/Graphics/Screen savers'.
There are 0 folders in folder '/store_00010001/Gallery/Graphics/Wallpapers'.
There are 0 folders in folder '/store_00010001/Gallery/Images'.
There are 0 folders in folder '/store_00010001/Gallery/Music files'.
There are 0 folders in folder '/store_00010001/Gallery/Received files'.
There are 0 folders in folder '/store_00010001/Gallery/Recordings'.
There are 0 folders in folder '/store_00010001/Gallery/Themes'.
There are 2 folders in folder '/store_00010001/Gallery/Tones'.
- Alert tones
- Ringing tones
There are 0 folders in folder '/store_00010001/Gallery/Tones/Alert tones'.
There are 0 folders in folder '/store_00010001/Gallery/Tones/Ringing tones'.
There are 0 folders in folder '/store_00010001/Gallery/Video clips'.


Choose where you want to upload the file to and then perform

Code:
gphoto2 -u Satisfaction.mp3 --folder '/store_00010001/Gallery/Music files/'


Unmount the phone using the gui and you're done!

No comments:

Post a Comment