SMS To Device

Hello,

Each device has a different phone number and for an event such as "Device is online" or "Device has entered geofence", I would like server to send an SMS.

Setup SMPP seems ok. User can send test SMS. I can also manually send SMS using the Custom Command for each device.

However, on "Device is online" and "Device has entered geofence" events, the device does not receive any SMS.

In tracker-server.log, I get following message

WARN: Throttling error - IllegalStateException (SmppClient:233 < *:245 < ...) 

Please could you point me in the right direction to resolve this issue?

abyss6 years ago

The error likely means that server is sending more messages per second that your operator is allowing.

Perhaps I should try to change the default settings for sms.smpp.reconnectionDelay but only one message seems to be sent at the same time.

I have enabled sms.smpp.logPdu and the destAddr is empty when there is the event but is is ok when I send a custom command.

FINEST|24452/0|Service traccar|18-03-13 19:40:45|[pool-8-thread-5] INFO com.cloudhopper.smpp.impl.DefaultSmppSession - sync send PDU: (submit_sm: 0x00000076 0x00000004 0x00000000 0x0000012A) (body: (serviceType [] sourceAddr [0x05 0x00 [33650086465]] destAddr [0x01 0x01 []] esmCls [0x00] regDlvry [0x00] dcs [0x00] message [42454C303031202B3333363530303836343635207265676C6573206475206A657520456E717565746520656E2076696C6C653A20687474703A2F2F6269742E6C792F32777131456A650A])) (opts: )

FINEST|24452/0|Service traccar|18-03-13 19:49:26|[qtp497786326-58] INFO com.cloudhopper.smpp.impl.DefaultSmppSession - sync send PDU: (submit_sm: 0x00000040 0x00000004 0x00000000 0x00000134) (body: (serviceType [] sourceAddr [0x05 0x00 [33650086465]] destAddr [0x01 0x01 [+33650086465]] esmCls [0x00] regDlvry [0x00] dcs [0x00] message [7465737420736D73])) (opts: )
abyss6 years ago

Event notifications server sends to users obviously, not to devices.
Have you filled Phone field of your user? https://www.traccar.org/documentation/notifications/

When I saw the field "Phone" one the Device form, I thought it could be used for notification (to the device) of events such as "Device is online" or "Device has entered geofence".

So the field "Phone" one the Device only works for Custom command. (You can see in the logs above.) The second line shows that the field phone had a value and furthermore, the device received the message.

Any reason why the field phone is not used or would not work for "Device is online" or "Device has entered geofence".?

Anton Tananaev6 years ago

Why you want to notify device itself about anything? Your SMS would simply be ignored. Notifications are for users.

Hello Anton, abyss,

for my project, Devices are Mobile phones. I have only one 'user' and it is the super/admin user.

Perhaps, I have found a way to solve the issue for my project.
"NotificationSms.java"

add the following line (line 23)

import org.traccar.model.Device;

change the following (line 36)

if (Context.getSmppManager() != null && user.getPhone() != null && device.getPhone() != null)

What do you think?

Anton Tananaev6 years ago

The right way to do it would be to create separate user entities.

Could you please explain further on this, because am having the same issue.
when you say create seperate user entities, what did you mean. Does it mean that i can create a device and have it linked to a specific user

did you ever get solution for this