Page 1 of 1

Serial2USB device is not working reliable (or Gammu)

Posted: Thu Nov 15, 2018 2:49 pm
by HeAdLeSs
Hello together.

I habe a problem with USB since ages. Now I want to ask if someone knows the problem.
I need to send sms with my Pi. First I had an USB Stick from Huawei (E1750c) to do the job. But it was working badly. At some time it was working well. Then... at any random point (from minutes to days) later it just was not 'responding' anymore. The port /dev/ttyUSB0 was still there. But Gammu was always telling me "Error while opening device. Unknown, busy or no permission" (something like that). I had to reboot many times and somewhen it was working again... for some time.
After reading and reading I gave it it's own 3A power source. But nothing changed. Then I added 2 1000uf capacitors. No real change.

Now finally I changed it to an Sim800L Module. I added it today (via ftdi usb to serial adaptor). At first it was working like a charm and I had hope that the problem is solved now. But I just got the same error from Gammu.
But in the same time I have now a Python script to communicate with the Sim800. And there is some kind of communication possible. When I send "AT" I get - not always - an "Ok" back. Sometimes just nothing comes back.

I also have another serial2usb device attached to the Pi (/sev/ttyUSB0). And some other sensors.

Is there any known problem with long term usage of serial devices at the Pi? Or problems with several serial devices (connected via usb)? Or is it maybe related to Gammu? Or problems with GSM modules?
I really don't know anymore.

PS: Just found this in the log file of gammu:
[System error - failed to lock device, probably opened by other process, 11, "Die Ressource ist zur Zeit nicht verf├╝gbar ('recource is not available at the moment')"]
But there is no other process which is using this device. I am sure of that.

Re: Serial2USB device is not working reliable (or Gammu)

Posted: Thu Nov 15, 2018 3:13 pm
by topguy
I have some tips..

- check the output of "dmesg" for errors relatedt to USB or disconnects/reconnects.
- the command "lsof" ( from the package of the same name ) will list all open file-handlers and which process has it open. )

Example use:

Code: Select all

pi@raspberrypi:~$ sudo lsof | grep ttyAMA0
agetty      745           root    0u      CHR     204,64      0t0       1701 /dev/ttyAMA0
agetty      745           root    1u      CHR     204,64      0t0       1701 /dev/ttyAMA0
agetty      745           root    2u      CHR     204,64      0t0       1701 /dev/ttyAMA0

Re: Serial2USB device is not working reliable (or Gammu)

Posted: Thu Nov 15, 2018 5:23 pm
by HeAdLeSs
Thanks topguy.
Couldn't find any related error messages.

But I could solve one problem in the meantime.
Solution 1: Gammu and Gammu-SMSD is not working together. Means that if the Gammu-SMSD deamon is running, it is (usually) not possible to run a gammu command too. That could be the solution this time, as the deivce itself was always "there". With the Huawei stick it was a different problem. That time the whole device disappeared and was not able to reconnect to the Pi (first after some restarts).

I will keep an eye on it and come back if a problem is still there. If not... I am happy and will not come back to this subject :mrgreen: