New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E220 stops responding after a few hours #400

Open
john-38787364 opened this Issue Apr 9, 2018 · 7 comments

Comments

Projects
None yet
3 participants
@john-38787364

john-38787364 commented Apr 9, 2018

Hi - I've got a raspberry pi connected to a Huwai E220. On reboot or restart of gammu-smsd messages send OK but after an hour or so the daemon stops communicating with the modem. This is with the stock stretch raspbian and with the latest version. I've changed the pi and the power supply with no improvement. If I kill the daemon I get

Log filename is "/var/log/gammu.log"
gammu-smsd[5774]: Can't open device: Error opening device. Unknown, busy or no permissions. (DEVICEOPENERROR[2])
Failed to run SMSD: Error opening device. Unknown, busy or no permissions.

I'm on
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.1 (stretch)
Release: 9.1
Codename: stretch

Running Gammu-smsd version 1.39.0

lsusb:
Bus 001 Device 005: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem

udev rule:

SUBSYSTEMS=="usb", ENV{.LOCAL_ifNum}="$attr{bInterfaceNumber}"
SUBSYSTEM=="tty", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003", SYMLINK+="smsmodem_%E{.LOCAL_ifNum}"

Config file:

[gammu]
connection = at
Device = /dev/smsmodem_01

[smsd]
logfile = syslog
debuglevel = 255
runonreceive = /home/pi/sendtext.py
logfile = /var/log/gammu.log
commtimeout = 10
sendtimeout = 20
phoneid = mdsms
transmitformat = auto
MaxRetries=2
DeliveryReport=no

# Storage - MySQL
service = SQL
driver = native_mysql
database = smsd
user = smsd
password = XXXXXXX
Host = localhost

Log file attached
out.log

@john-38787364

This comment has been minimized.

john-38787364 commented Apr 11, 2018

Compiling and downgrading to 1.34.0 has resolved the issue

@abadger1406

This comment has been minimized.

abadger1406 commented Jul 6, 2018

I have same issue using gammu 1.39.0 on Ubuntu 18.04, gammu will work for many hours then stop connection to the device, e.g:-

dave@study:/home/ve/scripts/texts$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04 LTS
Release:	18.04
Codename:	bionic
dave@study:/home/ve/scripts/texts$ gammu --identify
Error opening device. Unknown, busy or no permissions.
dave@study:/home/ve/scripts/texts$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 8087:0a2a Intel Corp. 
Bus 001 Device 004: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 005: ID 05ac:0250 Apple, Inc. Aluminium Keyboard (ISO)
Bus 001 Device 003: ID 05ac:1006 Apple, Inc. Hub in Aluminum Keyboard
Bus 001 Device 002: ID 15d9:0a4f Trust International B.V. Optical Mouse
Bus 001 Device 012: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
dave@study:/home/ve/scripts/texts$ ls -l /dev/ttyU*
crw-rw---- 1 root dialout 188, 0 Jun 26 23:44 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 Jun 26 23:44 /dev/ttyUSB1
crw-rw---- 1 root dialout 188, 3 Jun 27 13:58 /dev/ttyUSB3
dave@study:/home/ve/scripts/texts$ more /etc/gammurc 
# Gammu library configuration, see gammurc(5)
[gammu]
# Please configure this!
#port = /dev/gammu_device
#port = /dev/ttyUSB2
port = /dev/ttyUSB3
connection = at


If I run strace -f gammu --identify you see....

...
...
lseek(3, 2694, SEEK_SET)                = 2694
munmap(0x7f642eb23000, 2694)            = 0
close(3)                                = 0
openat(AT_FDCWD, "/root/.gammurc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/gammurc", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=264, ...}) = 0
read(3, "# Gammu library configuration, s"..., 4096) = 264
read(3, "", 4096)                       = 0
read(3, "", 4096)                       = 0
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=3004224, ...}) = 0
mmap(NULL, 3004224, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6426f2f000
close(3)                                = 0
mmap(NULL, 5971968, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f642697d000
socket(AF_INET6, SOCK_DGRAM, IPPROTO_IP) = 3
close(3)                                = 0
uname({sysname="Linux", nodename="study", ...}) = 0
openat(AT_FDCWD, "/dev/ttyUSB3", O_RDWR|O_NOCTTY|O_NONBLOCK) = 3
ioctl(3, TIOCEXCL)                      = 0
ioctl(3, CDROMEJECT, 0)                 = -1 ENOTTY (Inappropriate ioctl for device)
flock(3, LOCK_EX|LOCK_NB)               = -1 EAGAIN (Resource temporarily unavailable)
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=2995, ...}) = 0
read(4, "# Locale name alias data base.\n#"..., 4096) = 2995
read(4, "", 4096)                       = 0
close(4)                                = 0
openat(AT_FDCWD, "/usr/share/locale/en_GB/LC_MESSAGES/libgammu.mo", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=8557, ...}) = 0
mmap(NULL, 8557, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7f642eb21000
close(4)                                = 0
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=26376, ...}) = 0
mmap(NULL, 26376, PROT_READ, MAP_SHARED, 4, 0) = 0x7f642eb1a000
close(4)                                = 0
futex(0x7f642e0eba08, FUTEX_WAKE_PRIVATE, 2147483647) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
write(1, "Error opening device. Unknown, b"..., 55Error opening device. Unknown, busy or no permissions.
) = 55
munmap(0x7f642697d000, 5971968)         = 0
exit_group(102)                         = ?
+++ exited with 102 +++
@abadger1406

This comment has been minimized.

abadger1406 commented Jul 6, 2018

Want to see if downgrading to 1.34.0 fixes issue.

How can I compile version 1.34.0 on Ubuntu 18.04, I download gammu, checkout tags/1.34.0 then run compile, get following error.

...
...
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
MYSQL_LIBRARIES_atomic
    linked by target "gsmsd" in directory /home/dave/gammu-src/gammu/smsd
    linked by target "sqlreply" in directory /home/dave/gammu-src/gammu/contrib/sqlreply

-- Configuring incomplete, errors occurred!
See also "/home/dave/gammu-src/gammu/build-configure/CMakeFiles/CMakeOutput.log".
See also "/home/dave/gammu-src/gammu/build-configure/CMakeFiles/CMakeError.log".

have install mysql etc,

@abadger1406

This comment has been minimized.

abadger1406 commented Jul 6, 2018

More debug info...If I remove the usb modem, and plug back in it comes back on different device, edit gammurc to use this new /dev/ttyUSB2 device, and still get same error:-

openat(AT_FDCWD, "/etc/gammurc", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=264, ...}) = 0
read(3, "# Gammu library configuration, s"..., 4096) = 264
read(3, "", 4096)                       = 0
read(3, "", 4096)                       = 0
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=3004224, ...}) = 0
mmap(NULL, 3004224, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f07188c4000
close(3)                                = 0
mmap(NULL, 5971968, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0718312000
socket(AF_INET6, SOCK_DGRAM, IPPROTO_IP) = 3
close(3)                                = 0
uname({sysname="Linux", nodename="study", ...}) = 0
openat(AT_FDCWD, "/dev/ttyUSB2", O_RDWR|O_NOCTTY|O_NONBLOCK) = 3
ioctl(3, TIOCEXCL)                      = 0
ioctl(3, CDROMEJECT, 0)                 = -1 ENOTTY (Inappropriate ioctl for device)
flock(3, LOCK_EX|LOCK_NB)               = -1 EAGAIN (Resource temporarily unavailable)
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=2995, ...}) = 0
read(4, "# Locale name alias data base.\n#"..., 4096) = 2995
read(4, "", 4096)                       = 0
close(4)                                = 0
openat(AT_FDCWD, "/usr/share/locale/en_GB/LC_MESSAGES/libgammu.mo", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=8557, ...}) = 0
mmap(NULL, 8557, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7f07204b6000
close(4)                                = 0
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=26376, ...}) = 0
mmap(NULL, 26376, PROT_READ, MAP_SHARED, 4, 0) = 0x7f07204af000
close(4)                                = 0
futex(0x7f071fa80a08, FUTEX_WAKE_PRIVATE, 2147483647) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
write(1, "Error opening device. Unknown, b"..., 55Error opening device. Unknown, busy or no permissions.
) = 55
munmap(0x7f0718312000, 5971968)         = 0
exit_group(102)                         = ?
@abadger1406

This comment has been minimized.

abadger1406 commented Jul 6, 2018

My fix for now (as cannot get compile of 1.34.0 working yet) is to reboot machine.

@kenshinji

This comment has been minimized.

kenshinji commented Oct 1, 2018

Similar issue here. My device is Huawei E1750, Gammu version 1.38.1

pi@raspberrypi:~ $ lsusb
Bus 001 Device 008: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
Bus 001 Device 004: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~ $ gammu
Warning: No configuration file found!
[Gammu version 1.38.1]

Usage: gammu [parameters] <command> [options]

Parameters before command configure gammu behaviour:
-c / --config <filename> ... name of configuration file
-s / --section <confign> ... section of config file to use, eg. 42
-d / --debug <level> ... debug level (nothing|text|textall|textalldate|binary|errors)
-f / --debug-file <filename> ... file for logging debug messages

Commands can be specified with or without leading --.

For more details, call help on specific topic (gammu --help topic). Topics are:

       call - Calls
        sms - SMS and EMS
     memory - Memory (phonebooks and calls)
 filesystem - Filesystem
       logo - Logo and pictures
   ringtone - Ringtones
   calendar - Calendar notes
       todo - To do lists
       note - Notes
   datetime - Date, time and alarms
   category - Categories
     backup - Backing up and restoring
      nokia - Nokia specific
    siemens - Siemens specific
    network - Network
        wap - WAP settings and bookmarks
        mms - MMS and MMS settings
      tests - Phone tests
         fm - FM radio
       info - Phone information
   settings - Phone settings
      other - Functions that don't fit elsewhere
      gammu - Gammu information

Too few parameters!

After running gammu for a while, it will encounter following errors and need to re-plug my Huawei E1750 to RPi.

pi@raspberrypi:~ $ sudo systemctl status gammu-smsd.service
* gammu-smsd.service - SMS daemon for Gammu
   Loaded: loaded (/lib/systemd/system/gammu-smsd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-10-01 21:08:07 CST; 3min 2s ago
     Docs: man:gammu-smsd(1)
  Process: 1244 ExecStopPost=/bin/rm -f /var/run/gammu-smsd.pid (code=exited, status=0/SUCCESS)
  Process: 1322 ExecStart=/usr/bin/gammu-smsd --pid=/var/run/gammu-smsd.pid --daemon (code=exited, status=0/SUCCESS)
 Main PID: 1323 (gammu-smsd)
   CGroup: /system.slice/gammu-smsd.service
           `-1323 /usr/bin/gammu-smsd --pid=/var/run/gammu-smsd.pid --daemon

Oct 01 21:08:07 raspberrypi systemd[1]: Starting SMS daemon for Gammu...
Oct 01 21:08:07 raspberrypi gammu-smsd[1323]: Created POSIX RW shared memory at 0x76f5e000
Oct 01 21:08:07 raspberrypi gammu-smsd[1323]: Starting phone communication...
Oct 01 21:08:07 raspberrypi systemd[1]: Started SMS daemon for Gammu.
Oct 01 21:09:21 raspberrypi gammu-smsd[1323]: Error at init connection: No response in specified timeout. Probably phone not connected. (TIMEOUT[14])
Oct 01 21:09:21 raspberrypi gammu-smsd[1323]: Already hit 250 errors
Oct 01 21:09:21 raspberrypi gammu-smsd[1323]: Terminating communication: No response in specified timeout. Probably phone not connected. (TIMEOUT[14])
Oct 01 21:09:21 raspberrypi gammu-smsd[1323]: Starting phone communication...
pi@raspberrypi:~ $ gammu identify
Warning: No configuration file found!
Warning: No configuration read, using builtin defaults!
Error opening device. Unknown, busy or no permissions.

I'll try Gammu v1.34.0 later to see if it could be able to solve my issue.

@john-38787364

This comment has been minimized.

john-38787364 commented Oct 1, 2018

I edited MYSQL_LIBRARIES_atomic to FILEPATH=/usr/lib/x86_64-linux-gnu and it seemed to build OK on 18.04. I've made a package you can test here:
http://jshared.s3.amazonaws.com/build_1.34-1_amd64.deb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment