Send notification if device lost signal

Help
Anonymous
2013-02-13
2013-06-12

  • Anonymous
    2013-02-13

    I have custom GPS tracker. It periodically send data to server via GSM. (for example twice/hour)
    There is a situation when GSM signal may be lost and device can't sent data to sever in correct time. In this situation server must send notification to email or SMS.

    I use OpenGTS.
    Any idea how to implement this?

     
  • Sandeep
    Sandeep
    2013-02-13

    Hello

    You can use Cron Job and Simple Unix Script. ( Only if u have shell access and using Linux OS)
    Scan all the devices from Device Table and check the last data received time.

    Thank you
    Regards,
    Sandeep

     

  • Anonymous
    2013-02-13

    Thank for idea. But I use Windows as server.

     

  • Anonymous
    2013-02-15

    I add some function to tk10x code.
    http://pastebin.com/F9LBPDjH
    and add two field to Device.java

        public static final String FLD_deviceLostSignal = "DeviceLostSignal";      //DeviceLostSignal
        public static final String FLD_notificationFlag      = "NotificationFlag";

           new DBField(FLD_deviceLostSignal     , Boolean.TYPE        , DBField.TYPE_BOOLEAN     , I18N.getString(Device.class,"Device.fld.deviceLostSignal"     , "DeviceLostSignal"            ), "edit=2"),
            new DBField(FLD_notificationFlag     , Boolean.TYPE        , DBField.TYPE_BOOLEAN     , I18N.getString(Device.class,"Device.fld.notificationFlag"     , "NotificationFlag"            ), "edit=2"),

    and get/set function http://pastebin.com/hw2q2J2f

    This is my test log
    http://pastebin.com/ZckHiNsT

    Thus must be set         device.setDeviceLostSignal(true); device.setNotificationFlag(false);
    But when I see a database via SQLyog I see DeviceLostSignal == 0 and NotificationFlag ==0.

    Where is my problem?

     
  • Sandeep
    Sandeep
    2013-02-15

    Hello

    In Device.sql Table there are 2 field. LAST latitude and longitude with time.

    So just use while loop in java program and check the last data received on server and If any value is matching with your requirement then send an email.

    Use schedule task to run the script or alternate way is make a bin file and start that file on boot up and add sleep timer in it.

    Thank you

     

  • Anonymous
    2013-02-15

    Thank you.
    I am trying to understand why my function (http://pastebin.com/F9LBPDjH) not update fields in DB.