0

I use gammu on a Raspberry PI 3, running Ubuntu 18.04.3 and a Huawei E303C 3G modem (in "/dev/ttyUSB0").

The program seems to work fine, but I always need to invoke "sudo" to complete the commands. Otherwise the following message is displayed: "Error opening device, you do not have the required permission.".

In Google searches and right here in Stackoverflow describri that you need to grant permissions on the device. I tried two different settings but none affected gammu behavior, it still requires sudo in all operations.

First I created the file "/etc/udev/rules.d/69-gammu-acl.rules" with the following content

ACTION!="add|change", GOTO="gammu_acl_rules_end"

KERNEL!="ttyUSB[0-9]*", GOTO="gammu_acl_rules_end"
SUBSYSTEM!="tty", GOTO="gammu_acl_rules_end"

ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1506", TAG+="uaccess"

LABEL="gammu_acl_rules_end"

Then I created the file "/etc/udev/rules.d/99-phone.rules" with the following content:

KERNEL=="ttyUSB[0-9]*", SUBSYSTEM="tty", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1506", NAME="phone", MODE="0666", SYMLINK+="phone"

The way is this really ?! Is something wrong with my settings ?! Could you help me?!

1 Answers1

1

Please try this:

First of all you should know what users you have, you can know with this command

  $ whoami
user_name

You must enter the name of the user in this command:

$ sudo usermod -a -G dialout user_name

You must restart the computer to be added to the new group.

Then you can use gammu without the sudo command, for example:

$ gammu sendsms TEXT +589999999999 -text "Halooo .."

This work for me.

Developer
  • 417
  • 2
  • 7
  • 17