Cannot sending sms with gammu

3.5k views Asked by At

i want to send sms with sintax like this:

 gammu-smsd-inject TEXT 08982242410 -text "hallo"

and output is success connection to database. but number 08982242410 is not receive sms. when i try smsdlog, is getting error like this:

  Mon 2014/11/24 04:31:08 gammu-smsd[11319]: Starting phone communication...
  Mon 2014/11/24 04:31:08 gammu-smsd[11319]: Error at init connection: Error opening device, it doesn't exist. (DEVICENOTEXIST[4])
  Mon 2014/11/24 04:31:08 gammu-smsd[11319]: Going to 30 seconds sleep because of too much connection errors

can you help me how solve this problem?

thank you.

1

There are 1 answers

0
raspayu On

I know I come a bit late, but...Are you sure you have setup your gammu to the correct USB GSM modem port? I mean... You have configured your gammu to a USB port. For example, check in your config file (usually /etc/gammurc ) the port that you have configured your modem:

[gammu]
device = /dev/ttyUSB2

That would mean, that your device should be configured in that port. Now the first thing you would have to check is if your device is connected. For checking the usb connected devices, lsusb will help you to find out what you have connected:

myuser@raspberrypi ~ $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 005: ID 12d1:1436 Huawei Technologies Co., Ltd.

As you see, my last device is my GSM USB modem (a Huawei USB stick).

Now that you know it is there, you have to check that your GSM modem is connected in the port you have told Gammu. Here is the funny part: USB port assignment is not always the same in Linux machine. That means that a USB stick that was one time on ttyUSB2, may be in the next reboot on ttyUSB5 if you have more than one USB port being used. To check it out, you should call dmesg:

myuser@raspberrypi ~ $ dmesg | grep tty
[    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=592 bcm2708_fb.fbheight=448 bcm2708.boardrev=0xd bcm2708.serial=0x6a843828 smsc95xx.macaddr=B8:27:EB:84:38:28 bcm2708_fb.fbswap=1 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait
[    0.001417] console [tty1] enabled
[    0.707212] dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83, base_baud = 0) is a PL011 rev3
[    1.098542] console [ttyAMA0] enabled
[    7.652112] usb 1-1.2.3: GSM modem (1-port) converter now attached to ttyUSB0
[    7.940183] usb 1-1.2.3: GSM modem (1-port) converter now attached to ttyUSB1
[    8.231542] usb 1-1.2.3: GSM modem (1-port) converter now attached to ttyUSB2

In my case, I have ONLY the GSM stick connected to a USB hub, so I am getting always the same ttyUSB2. If you have more than one thing connected, it may change from time to time. So you have to check that the device in your config file is the same as the one that you get using the dmesg command (with Huawei modems, it always works to take the highest one-> ttyUSB2 in my case).