Skip to content
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

SMS commands and notifications #106

Closed
Armagetron opened this issue Sep 2, 2014 · 30 comments
Closed

SMS commands and notifications #106

Armagetron opened this issue Sep 2, 2014 · 30 comments

Comments

@Armagetron
Copy link
Contributor

I have added SMS functionality to the traccar client. You can now receive position updates through SMS messages. These SMS are send to a configured number in the app. This feature can be toggled on or off. These updates are in addition to the normal logging via the internet connection.

This functionality is useful for users who live in remote locations where SMS is still working but the mobile internet is not.

The client can also be controlled via SMS. I have implemented the following commands (which are send via SMS to the device):

  • pos -> returns one answer containing the time of the position date, latitude, longitude, altitude, speed and remaining battery
  • enable -> enables the sms logging
  • disable -> disables the sms logging

Here are two screenshots. The first shows the additional menu items and the second one a log entry of a SMS. You can check out the changes in my forked repository. I would like to hear your thoughts!

screen01
screen02

@tananaev
Copy link
Member

tananaev commented Sep 2, 2014

I don't really believe in SMS, I think it will die sooner or later. Also, seems like this functionality is completely independent from original app, so it might as well be a separate application.

@Armagetron
Copy link
Contributor Author

As I already mentioned, SMS is in some areas more reliable and may work when you are using roaming. Maybe it dies in a couple of years but as of now, it is available everywhere. It is true, that new code had to be added for handling SMS but the entire logic is based upon and integrated in the TraccarService class. The original concept hasn't changed at all.

@tananaev
Copy link
Member

tananaev commented Sep 2, 2014

What I'm saying is that it doesn't actually interact with Traccar server.

@Armagetron
Copy link
Contributor Author

That is indeed true but fixable. The server has to be extended for SMS functionality and the SMS could contain a standard traccar message (NMEA sequence). I have never used "normal" Java for SMS sending/receiving. However smslib should be easily integrated into the server.

@tananaev
Copy link
Member

tananaev commented Sep 2, 2014

I have actually used smslib in the past, but I'm not convinced that SMS communication has any future.

@mhdyousif
Copy link

This is great news and I will definitely use that! Thanks.

SMS tracking might not be very useful but the thing that was really
missing from traccar is the possibility of configuration commands like
"SetServerAddress xxx.xx.xxx.xxx"
These commands are impossible to do now without having physical access
to the device which is not the case most of the time. (I'm using mobile
phones to track cars for example using traccar).

One thing I remember is when I needed to upgrade my traccar server
instance hosted on Amazon to another version of Linux 64bit thinking
that my elastic IP will not change but it didn't work like that because
I needed to create another different elastic IP to be able to assign it
to the new instance because of Amazon technical issues with different
instance types. Anyway, I upgraded and then I found out that I now have
no way to change the ServerAddress on the traccar clients other than
getting the cars to the garage and take the physical phones out!!!

I see it as a very important feature to change settings using SMS
(especially HostName and port!) because it's the only way possible even
if you have 100% 4G signal. It's simply useless if the client doesn't
know the IP to connect to!

Mohammad Yusuf

@tananaev
Copy link
Member

tananaev commented Sep 2, 2014

@mhdyousif, ideally you should be using domain name instead of IP address.

@mhdyousif
Copy link

That's not always possible because I don't even have a domain name and
is not as fast as connecting directly using the IP address (no need for
dns lookups) especially on slow connections even if the device has DNS
caching (which I doubt).

And what about the tracking interval for example? sometimes I need
instant updates (when the car is moving to an unsafe area for example)
and sometimes I need 1 update per hour (in the garage for example) to
save bandwidth and costs.

I also constantly get periods of time when I see no updates from one of
the clients but in the same time I can call the device and SMS it as
usual and that happens in populated areas too as the 3G network is not
always reliable.

It would be really useful in these cases to be able to SMS the device
and wait for an SMS location update in response.

On 02/09/2014 12:12 م, Anton Tananaev wrote:

@mhdyousif https://github.com/mhdyousif, ideally you should be using
domain name instead of IP address.


Reply to this email directly or view it on GitHub
#106 (comment).

Mohammad Yusuf

@Armagetron
Copy link
Contributor Author

Adding more commands is an easy task. Instant info is already there (pos command). But with the "update" feature, you could update the interval as needed. I will implement the needed features.

Question is: will they be merged into the client?

@mhdyousif
Copy link

And there is always the possibility of things going wrong. Amazon
elastic IPs should be really working like domain names in that aspect. I
wasn't expecting to need to ever change it as I already reserved it for
any of my instances but the need came nevertheless with an upgrade
unexpectedly.

On 02/09/2014 12:18 م, Mohammad Yusuf wrote:

That's not always possible because I don't even have a domain name and
is not as fast as connecting directly using the IP address (no need for
dns lookups) especially on slow connections even if the device has DNS
caching (which I doubt).

On 02/09/2014 12:12 م, Anton Tananaev wrote:

@mhdyousif https://github.com/mhdyousif, ideally you should be using
domain name instead of IP address.


Reply to this email directly or view it on GitHub
#106 (comment).

Mohammad Yusuf

@mhdyousif
Copy link

On 02/09/2014 12:20 م, Armagetron wrote:

Adding more commands is an easy task. Instant info is already there (pos
command). But with the "update" feature, you could update the interval
as needed. I will implement the needed features.

Great!

Question is: will they be merged into the client?

That is up to the author of course. He already did a wonderful job with
traccar and I'd like to take the opportunity to thank him for the number
one open source tracking platform.

You could, if it didn't get merged, as he suggested change its name and
distribute it as a new fork of traccar client and then merge that
changes from the main traccar client periodically. I actually do this
with my custom traccar client which has some changes that I believe
won't be useful to others (like rebooting the device if it couldn't
deliver position updates for 15 minutes, delivering temperature,
accuracy, voltage, charging status...etc)

Mohammad Yusuf

@Armagetron
Copy link
Contributor Author

@mhdyousif: You could use a DynDNS service like NO-IP to mask any IP address.

@mhdyousif
Copy link

Yes but Amazon elastic IPs are still more reliable.

@Armagetron
Copy link
Contributor Author

I added some more commands which allows more settings to be modified via sms. Doing this I encountered a problem. The data in the preference screen (the stuff displayed by TraccarActivity) does not get updated, when the settings change. Restarting the application however updates the information as they are fetched from the persistent storage.

Does anyone know how to fix this?

@tananaev
Copy link
Member

tananaev commented Sep 3, 2014

What data are you talking about?

@Armagetron
Copy link
Contributor Author

I use the SharedPreference class to update the configuration. This ensures a persistent change and the Listener is also signalled.
The TraccarActivity stores the configuration in its items. The problem is, that these values do not get updated, when the configuration changes. When I e.g. update the server port via SMS and then check the port number in the Activtiy I see the old value.

Question is: how do I update them?

@tananaev
Copy link
Member

tananaev commented Sep 4, 2014

I think they should be updated if you use SharedPreference correctly.

@aacable
Copy link

aacable commented Dec 16, 2014

Great FORK. I was hoping for it and its actually here :) I will give it a try and will update the article on my blog as well. Good work Guys :) 👍

@aacable
Copy link

aacable commented Dec 17, 2014

Can someone please give some directions howto to get the new traccar client (with sms support) package for Android? .apk file?

@Armagetron
Copy link
Contributor Author

Since there is still work to do on the SMS functionality or in other words I wish to add more features and I'm mostly doing this for myself there is no "official" package for this version.

However you can build it by yourself and install it manually on your device.

@aacable
Copy link

aacable commented Jan 6, 2015

any update on the sms feature?
can you please help how to add ADDRESS column in archive view and in map?

Regards,
SYED JAHANZAIB

@Armagetron
Copy link
Contributor Author

any update on the sms feature?

I haven't worked on the client but on other features related to it on my server.

can you please help how to add ADDRESS column in archive view and in map?

This is a completely different issue and has nothing to do with sms.

@redge76
Copy link
Contributor

redge76 commented Feb 7, 2015

Hi,
I also second this feature request. Where I live, data connection is quite bad. SMS is a lot more reliable. So It would be great to have such an option as "if position update by 3G not possible for 10 minutes, send location by SMS". I would like to install a cheap 3G USB key on my server with smstools3. When a SMS is received, it is analysed and a http request is sent to traccar to update position.
Regards,
Regis

@scietech9
Copy link

hello sir Armagetron,., can i ask something about your android., can i get your email address? thankyou

@Armagetron
Copy link
Contributor Author

I would like to invite everyone who is interested in sms support to discuss features in my fork.

@Armagetron
Copy link
Contributor Author

@redge76: I got something like that running on an Raspberry Pi. It uses an Huawei UMTS Stick which receives SMS from traccar, converts them to the traccar protocol (because I want the SMS to be human readable) and sends them to the tracking server. SMS handling is done using the gammu library and a piece of software that process the SMS.

For those of you who are still interested into it, I have currently updated the settings screen. Now I am redoing the UI. This will allow me to integrate other features using more screens/fragments.

@redge76
Copy link
Contributor

redge76 commented Apr 13, 2015

Sure I'm still interested...

@redge76
Copy link
Contributor

redge76 commented Jun 17, 2015

Any news about this client with SMS commands? Here is my use case:
My friend ride horses. She goes sometime alone in the woods. So I need a client that:

  • When data connection is available, the position is sent every 2/3 minutes and stored to be sent later if connection is not available. (this is already available with the current version of the client)
  • If data connection is not available for more than 10/15 minutes, a SMS is sent with the last GPS position. (or x last positions, but we only have 140 ..). This SMS can ether be sent to a human or to a 3g dongle attached to the traccar server. It could also be to a smartphone with an application able to translate the SMS to a traccar position update.
  • In the event she fall of her horse and is unable to call for help, I need to know the last position. So the application would react to a SMS by sending the last know position. (this seems to be available in the armagetron client)

Why SMS is so important ? because 3G if generally not available where she rides. It's too far in the country. It can be miles before she find a strong enough signal to send the position backlog.
If you use your client in a foreign country (an it's quite easy here in Europe where the countries are so small), you usually have cheap SMS service. But the data service is insanely expensive. So Usually you disable data when abroad and only leave voice/SMS.
It's even more important for me because I live 2 km away from the border and my phone sometime switch to a foreign network. So I loose data as long as the foreign network signal is stronger than my signal. An this situation can last miles/hours during a hike.

So maybe SMS is a technology from the past, but in very useful in such scenario.

Armagetron can you provide a compiled client for me to test ?

thanks,
Regis

@mattbk
Copy link

mattbk commented May 14, 2017

+1 for SMS delivery of positions to the server. I put on endurance events, some in remote locations, where data availability is spotty or nonexistent.

@tananaev
Copy link
Member

SMS notifications are already available. Server doesn't decode SMS positions, but it will show save any incoming SMS as events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants