Gammu cannot open device (DEVICEOPENERROR[2])

Mubin Icyer picture Mubin Icyer · Mar 9, 2016 · Viewed 7.1k times · Source

I am using gammu-smsd 1.31.90, I made a udev rule for my USB 3g dongle but gammu-smsd can not connect to device. It says DEVICEOPENERROR[2]. How can I fix it?

udev-rule in /etc/udev/rules.d/10-rules.local

SUBSYSTEMS=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1001", SYMLINK+="phone", GROUP="dialout"

Gammu log:

Wed 2016/03/09 15:57:58 gammu-smsd[2466]: Starting phone communication...
Wed 2016/03/09 15:57:58 gammu-smsd[2466]: gammu: [Gammu 1.31.90 built 08:54:06 May 23 2012 using GCC 4.6]
Wed 2016/03/09 15:57:58 gammu-smsd[2466]: gammu: [Connection       - "at"]
Wed 2016/03/09 15:57:58 gammu-smsd[2466]: gammu: [Connection index - 0]
Wed 2016/03/09 15:57:58 gammu-smsd[2466]: gammu: [Model type  - ""]
Wed 2016/03/09 15:57:58 gammu-smsd[2466]: gammu: [Device  - "/dev/phone"]
Wed 2016/03/09 15:57:58 gammu-smsd[2466]: gammu: [Running on  - Linux, kernel 3.4.103 (#4 SMP PREEMPT Thu Dec 18 12:55:58 CST 2014)]
Wed 2016/03/09 15:57:58 gammu-smsd[2466]: gammu: [System error - tcgetattr in serial_open, 25, "Inappropriate ioctl for device"]
Wed 2016/03/09 15:57:58 gammu-smsd[2466]: gammu: Init:GSM_TryGetModel failed with error DEVICEOPENERROR[2]: Error opening device. Unknown, busy or no permissions.
Wed 2016/03/09 15:57:58 gammu-smsd[2466]: Can't open device: Error opening device. Unknown, busy or no permissions. (DEVICEOPENERROR[2])

Answer

Sepehr roosta picture Sepehr roosta · Dec 11, 2017

You Have to config 2 files and edite 'port' and 'Connection' fields.

gammu-config

This config file is in '/home/$YOUR_USER_NAME/.gammurc' and config this one too:

nano /etc/gammu-smsdrc

set your connection field to 'at' and port field to 'ttyUSBx' which appear your system. Restart your gammu-smsd service, and if it's active it should work.

service gammu-smsd restart
service gammu-smsd status

● gammu-smsd.service - SMS daemon for Gammu Loaded: loaded (/lib/systemd/system/gammu-smsd.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2017-12-11 00:02:06 IRST; 10h ago Docs: man:gammu-smsd(1) Main PID: 650 (gammu-smsd) Memory: 1.8M CPU: 3min 8.684s CGroup: /system.slice/gammu-smsd.service └─650 /usr/bin/gammu-smsd --pid=/var/run/gammu-smsd.pid --daemon

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.