Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have Ubuntu Server 12.04 LTS and on it I have installed gammu. I use it to control my "Nokia 5310 Xpress music" cell phone.

Now when I run "gammu --identify" it does not work, says I dont have the right device permissions, but it works with sudo gammu --identify

Now my Nokia device is listed as ttyACM0 in my /dev/ directory... its permissions are rw for root and dialout... I tried to change these permissions so that I can use this device with gammu without sudo ... I did sudo chmod 777 /dev/ttyACM0 and it changed the permissions, but still it did not work...

I even went and added a file in /etc/udev/rules.d/ by the name of 40-41-descriptive-name.rules which contained the following line:

SUBSYSTEM=="usb", ATTR{idVendor}=="0421", ATTR{idProduct}=="006b", MODE="0600", OWNER="MyUserName"

and then restarted udev but still no luck...

I even did sudo chown myusername /dev/ttyACM0 and gave myself the ownership of the device but still I needed to use sudo to get things done...

btw if I do lsusb I get the following info:

BUS 002 Device 003: ID 0421:006b Nokia Mobile Phones

I tried all these ways to change the device permissions so that i could use "gammu --identify" instead of sudo gammu --identify but no luck.

How can i fix this dilemma?

share|improve this question
    
vMobile BroadBand is better than Wammu-Gammu –  Naveen Nov 4 '12 at 14:45
    
I Googled the term but apparently found nothing...Weird... –  ArslanW Nov 4 '12 at 17:24
    
Betavine connection manager supports sending/getting sms, reading phone book, and establishing an Internet connetion from the phone. Here is a screen shot:i.imgur.com/B9xXa.png If you like to give a try:forge.betavine.net/frs/?group_id=76 –  Naveen Nov 5 '12 at 2:36
add comment

2 Answers

up vote 2 down vote accepted

Taking help from fellow answers I found the solution to my problem...

In my gammu configuration file I changed the port to /dev/phone

Then I went to /etc/udev/rules/ directory and in it I created a file name 99-phone.rules, then in that file I wrote the following line:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0421", ATTRS{idProduct}=="006b", MODE="0666" , SYMLINK+="phone"

Then I rebooted my system and then when I connected my Nokia phone, I was able to run commands on it without using sudo!

Thanks Everyone especially @firusvg !!

share|improve this answer
add comment

To avoid potential problems with situation that phone gets recognized as /dev/ttyACM0, /dev/ttyACM1,... or /dev/ttyUSB0, /dev/ttyUSB1,... with subsequent connection/reconnection cycles, make symlink for phone to be like /dev/phone - make 99-phone.rules udev rule with:

KERNEL=="ttyUSB*", ATTRS{idVendor}=="0421", ATTRS{idProduct}=="006b", NAME="phone", MODE="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="0421", ATTRS{idProduct}=="006b", NAME="phone", MODE="0666"

and make change for port in .gammurc to be port=/dev/phone. Now, you'll be able to issue gammu commands without sudo.

Of course, remove previous rules in your 40-41-descriptive-name.rules

Please note that two lines in 99-phone.rules are there only to ensure that all possible cases for initial phone recognition are covered (also note MODE="0666" - that will give rw for all users/groups).

This is approach I'm using for my own SMS gateway (using three phones and based on gammu-smsd) and, so far, works well.

share|improve this answer
    
I used gammu, and I have now made the changes you advised, but the thing is I still have to use sudo, and the device still comes as ttyACM0 in my /dev/ directory –  ArslanW Nov 4 '12 at 17:22
    
ok I understand why the device is still listed as ttyACM0 but I still have to use sudo... I even restarted my system but still no go... –  ArslanW Nov 4 '12 at 18:23
    
Just to be sure - are you using (in yours gammu configuration) new port /dev/phone or still using /dev/ttyACM0 ? Does /dev/phone even exist after you plug-in phone? Look at my output, using same method I've explained (except I'm not using Nokia phone) it works - link administrator, in my case, is regular user, username may be misleading. Which version of gammu are you using? Who is owner (user/group) of /usr/bin/gammu? Is yours user also member of dialout group? Can you enable logging for gammu and put log output? –  firusvg Nov 5 '12 at 2:47
    
yeah I am using /dev/phone in my gammu configuration, and in my /dev/ directory my phone comes up as /dev/ttyACM0. Whn I run the command groups the dialout group does not appear (and Im also not a part of it), and the owner of /usr/bin/gammu is root... Oh I see... gammu is accessible only by root! Ill change its ownership and see if it works now... –  ArslanW Nov 5 '12 at 6:59
    
I changed the permissions of gammu and made the owner my user and gave him rwx permissions but I am still unable to run gammu without sudo... and my phone still comes as ttyACM0 but I can reference it as /dev/phone, but the permissions of ttyACM0 are given to root only when i run ls -l on it... –  ArslanW Nov 5 '12 at 7:04
show 6 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.