1

How to get Unit Last update date and time

(edited by trushal.shah 23/09/2020 12:58:42)

Topic: How to get Unit Last update date and time

Hello Team

How i can get the attached screenshot details from the item search API 

http://gps.tawasolmap.com/wialon/ajax.h … mp;params= {"id":20646,"flags":4611686018427387903}&sid=96d4c9e77d385ddf775f64d3c5dbd85b

As i have thought as per below please correct me if i am wrong

1) Name of the Unit                    items[0][nm]
2)Unit id                                      items[0][id]
3)Unit Latitude                            items[0][pos][x]
4)Unit Longtude                        items[0][pos][y]
) Speed of the Unit                     items[0][pos][s]
Date of last active
Engine status (On/Off)
Unit is in the parking or not
Last speed

How i can get from the above API if you

2

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

1) Last data information (unit name, speed, position, date/time) you can get via request search item (or search items ) with correspodings flags value.

2) Engine status , moving/parking status you can get via Events - trips and igntion 
To get live events the steps are the following

  • Then execute request events/check_updates, for example every 2-5 sec, to get response with online data

For example

1. First (after login) it needs to add required units to session via request  svc=events/update_units

https://hst-api.wialon.com/wialon/ajax.html?svc=events/update_units&params={"mode":"add","units":[{"id":2147,"detect":{"ignition":0,"trips":0}},{"id":2174,"detect":{"ignition":0,"trips":0}}]}&sid=023078baa1999df1ea0da05cd4cbc9a02cb

"units" - units array where  'id' - unit's id, 'detect' - required events types, in our case only "ignition":0 and trips "trips":0, 0 means all ignition sensors, if you know that unit has only 1 ignition sensor, you can set up '0'.
If there is several ignition sensors it's better to set up sensor's id. But sure it depends on appropriate business task. For trips is always 0 ("trips":0).
It needs to specify for each units 'id' each 'detect' type.

2. After required units has been added to session, we can monitor online ingtion state via request events/check_updates which can be executed for example every 2 sec or rarely , it depends on how often the device sends data to the server

https://hst-api.wialon.com/wialon/ajax.html?svc=events/check_updates&params={"detalization":3}&sid=023078baa1999df1ea0da05cd4cbc9a02cb

"detalization":3  means that server will return  JSON information for flags plus

Diana Cheley
Wialon Hosting Expert
Gurtam
3

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Thanks for your support

as I got below response with once I follow the above steps 1 and 2 and below response I got

I got ignition and trip array,

how I can get value under the unit image "11s"
Date and time with speed
All the movement of the unit on the selected date


"20317": [
  {
    "ignition": {
      "1": {
        "from": {
          "t": 1601453651,
          "y": 26.5767269135,
          "x": 50.0240821838
        },
        "to": {
          "t": 1601454262,
          "y": 26.5540847778,
          "x": 50.021686554
        },
        "m": 1601454262,
        "f": 0,
        "state": 13.635,
        "type": 1,
        "hours": 821580,
        "switches": 505,
        "value": 13.635
      }
    }
  },
  {
    "trips": {
      "from": {
        "t": 1601453652,
        "y": 26.5767288208,
        "x": 50.0240821838
      },
      "to": {
        "t": 1601454262,
        "y": 26.5540847778,
        "x": 50.021686554
      },
      "m": 1601454262,
      "f": 0,
      "state": 1,
      "max_speed": 74,
      "curr_speed": 43,
      "avg_speed": 32,
      "distance": 5486,
      "odometer": 10899730,
      "course": 177,
      "altitude": 2
    }
  }

4

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

You can get  "avg_speed" speed parameter, or "curr_speed": - current speed, parameter "m" shows the time of last message (Unix time UTC+0), the trip duration is calculated as difference between "from" and "to"

Diana Cheley
Wialon Hosting Expert
Gurtam
5

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Thanks for the solutions,

Last point that how I can get the movement of the units with start and [Between each] endpoint the day, or between dates

6

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

trushal.shah wrote:

Thanks for the solutions,

Last point that how I can get the movement of the units with start and [Between each] endpoint the day, or between dates

Hello!

To get history data of events (trips, ignition) you need to execute  events/load & events/get
First you load events for some period  - , then get  it
For example,

Get trips from Oct 1 - Oct 5 , unix time UTC+0

Load events

https://hst-api.wialon.com/wialon/ajax.html?svc=events/load&params={"ivalType":1,"itemId":214,"timeFrom":1601510400,"timeTo":1601942399,"detectors":[{"type":"trips","filter1":0}]}&sid=028384ac3f02f18c414208758685b320

Get result

https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"type":"trips","timeFrom":1601510400,"timeTo":1601942399,"detalization":3}}&sid=028384ac3f028758685b320
Diana Cheley
Wialon Hosting Expert
Gurtam
7

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hi, thanks for the update

If you can please help me to set the direction of the unit as i can see in the wialon app on the map each unit icon have a different direction, I am using google map to display unit

8

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

trushal.shah wrote:

Hi, thanks for the update

If you can please help me to set the direction of the unit as i can see in the wialon app on the map each unit icon have a different direction, I am using google map to display unit

Good day!

To display direction we use the parameter course which device can send.
If your device type sends this parameter, you can get it from messages.
For example, pos: {y: 53.9058786, x: 27.4569481, c: 38, z: 302.700012207, s: 0, sc: 11}, where parameter 'c' is course , integer (from 0 to 359 degrees, where 0 - means North)

Diana Cheley
Wialon Hosting Expert
Gurtam
9

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hi, thanks for the update

If you can please help me how i can get the report pdf file of the units same wialon App

1) Which API we can integrate to get all template to belong to the account
2) which API should help me to execute the report of the unit and in response get a pdf file with details of the movement with address 

Please check I have attached two files

10

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

1) To get all reports created in account via request search items or
search item by ID  with flags = 8193 ( base flag + 8192 reports data)
2) To execute report - please look example  https://sdk.wialon.com/wiki/en/sidebar/ … es/reports
3) After report executed you can export it to file - please look the request format here https://sdk.wialon.com/wiki/en/sidebar/ … ort_result

Diana Cheley
Wialon Hosting Expert
Gurtam
11

How to get Unit Last update date and time

(edited by trushal.shah 19/10/2020 16:30:18)

Re: How to get Unit Last update date and time

Thanks for the reply

i do execute each but in the last export report getting an error

http://gps.tawasolmap.com/wialon/ajax.html?svc=core/search_items&params={"spec":{"itemsType":"avl_resource","propName":"sys_user_creator","propValueMask":"*","sortType":"sys_name","propType":"creatortree"},"force":1,"flags":8192,"from":0,"to":1000}}],"flags":0}&sid=17c6be7cb59c41cdf2996f20b18ac2b7

Got success

http://gps.tawasolmap.com/wialon/ajax.html?svc=report/exec_report&params={"reportResourceId":55874,"reportTemplateId":10,"reportObjectId":20646,"reportObjectSecId":0,"interval":{"from":1601449803,"to":1601877534,"flags":0}}&sid=17c6be7cb59c41cdf2996f20b18ac2b7

Got success

http://gps.tawasolmap.com/wialon/ajax.html?svc=report/export_result&params={"format":2,"pageOrientation":portrait,"pageSize":a4,"pageWidth":0,"coding":utf8,"delimiter":semicolon,"headings":0,"compress":1,"attachMap":0,"extendBounds":0,"hideMapBasis":0,"outputFileName":"Online_report"}&sid=17c6be7cb59c41cdf2996f20b18ac2b7

getting error in last API

{
    "error": 4,
    "reason": "WRONG_PARAMS"
}

12

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

There is not quotes for text parameters, like "pageOrientation":portrait, "coding":utf8 and etc.

the correct params

{"format":2,"pageOrientation":"portrait","pageSize":"a4","pageWidth":0,"coding":"utf8","delimiter":"semicolon","headings":0,"compress":1,"attachMap":0,"extendBounds":0,"hideMapBasis":0,"outputFileName":"Online_report"}
Diana Cheley
Wialon Hosting Expert
Gurtam
13

How to get Unit Last update date and time

(edited by trushal.shah 21/10/2020 13:40:35)

Re: How to get Unit Last update date and time

Hello Thanks for the reply


As its works but still that i need to display in a PDF file to the user

Three Query I have on the sensor value, Execute unit command and get unit notifications next its details 


1) Which field we should take value of sensor i got this sensor list in the search_item api same as below response

"sens": 
                "1": {
                    "id": 1,
                    "n": "حالة المحرك",
                    "t": "engine operation",
                    "d": "",
                    "m": "On/Off",
                    "p": "adc3",
                    "f": 0,
                    "c": 
                "3": {
                    "id": 3,
                    "n": "حساس كفاءة المحرك (wizard)",
                    "t": "engine efficiency",
                    "d": "",
                    "m": "",
                    "p": "time:d",
                    "f": 0,
                    "c": 
                
                "4": {
                    "id": 4,
                    "n": "حساس كفاءة المحرك (wizard)",
                    "t": "engine efficiency",
                    "d": "",
                    "m": "",
                    "p": "(speed+#speed)/const2",
                    "f": 0,
                    "c": 

               
Please check the screenshot which value we should use to be display


2) Also we are getting a

command list 

"cmds": [
                {
                    "n": "إطفاء المحرك",
                    "a": 1,
                    "t": "tcp,vrt",
                    "c": "custom_msg",
                    "p": "Out 0,0"
                },
                {
                    "n": "تشغيل المحرك",
                    "a": 1,
                    "t": "tcp,vrt",
                    "c": "custom_msg",
                    "p": "Out 0,1"
                },
                {
                    "n": "Arnavi 2",
                    "a": 1,
                    "t": "tcp,vrt",
                    "c": "custom_msg",
                    "p": ""
                }

               
How I can execute these commands for example if there is commands like Engine start, Engine Off


3) How to get notifications of the units and it details..

14

How to get Unit Last update date and time

(edited by trushal.shah 23/10/2020 10:51:09)

Re: How to get Unit Last update date and time

Hello Gurtam team

I stuck with at below APi request that my client request to  notification send to login user users as their engine is on, engine off, speed limit and geozone

How i can set notification with specific units


like
1)Unit engine is on and get mobile notifications

2)Unit engine is Off and get mobile notifications

3) Unit is running more then set speed

next is get all notification of the units same as current attached screenshots

http://gps.tawasolmap.com/wialon/ajax.html?svc=resource/get_notification_data&params={"itemId":55874,"col":]}&sid=c59a1d9fe2a4927c94d540dd190b6956
15

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

As I understand you need to create the following notifications with required parameters:

1) Control engine is on, action  - get mobile notifications
If unit has Engine Ignition sensor, you can create notification to control sensor by type = Engine Ignition Sensor ("engine operation")
Use the following parameters:

{"n":"example engine On","ta":1603746000,"td":0,"tz":134228528,"la":"en","ma":0,"sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"ctrl_sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"un":[1326],"trg":{"t":"sensor_value","p":{"sensor_type":"engine operation","sensor_name_mask":"*","lower_bound":1,"upper_bound":1,"prev_msg_diff":0,"merge":1,"type":0}},"d":"","act":[{"t":"mobile_apps","p":{"apps":"{\"Wialon\":[1027]}"}}],"txt":" notification text","fl":0,"mast":0,"mpst":0,"cdt":0,"mmtd":3600,"cp":3600,"id":28,"itemId":930849,"callMode":"update"}

2) Control engine is Off, action  - get mobile notifications
The same parameters as above, just change value range to 0 - "lower_bound":0,"upper_bound":0

3) Speed limit (the action as above)

{"n":"example1","ta":1603746000,"td":0,"tz":134228528,"la":"en","ma":0,"sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"ctrl_sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"un":[826],"trg":{"t":"speed","p":{"sensor_type":"","sensor_name_mask":"","lower_bound":0,"upper_bound":0,"merge":0,"min_speed":0,"max_speed":60,"driver":0}},"d":"","act":[{"t":"mobile_apps","p":{"apps":"{\"Wialon\":[1427]}"}}],"txt":" notification text","fl":0,"mast":0,"mpst":0,"cdt":0,"mmtd":3600,"cp":3600,"id":28,"itemId":849,"callMode":"update"}

where "min_speed":0,"max_speed":60 is allowed range.

4) Geofences control - in geofence ("type":0)

{"n":"example geo","ta":1603746000,"td":0,"tz":134228528,"la":"en","ma":0,"sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"ctrl_sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"un":[1186],"trg":{"t":"geozone","p":{"sensor_type":"","sensor_name_mask":"","lower_bound":0,"upper_bound":0,"merge":0,"geozone_ids":"930849_40:1595402237","geozone_id":"930849_40:1595402237","type":0,"min_speed":0,"max_speed":0,"lo":"OR"}},"d":"","act":[{"t":"mobile_apps","p":{"apps":"{\"Wialon\":[1427]}"}}],"txt":"%UNIT% arrived to %ZONE%. At %POS_TIME% it moved with speed %SPEED% near '%LOCATION%'.","fl":0,"mast":0,"mpst":0,"cdt":0,"mmtd":3600,"cp":3600,"id":28,"itemId":949,"callMode":"update"}

5) To get all notification with their params
Use the request resource/get_notification_data , the empty "col":"" returns all notifications

Diana Cheley
Wialon Hosting Expert
Gurtam
16

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello, Team Thanks for the Replay,

Before I call this API, Which API should i need to call to set that this login customer would get push notifications, like that

like Customer ABCD login with the application after authentication success, there are three Units associate with customer

1. BMW
2. Audi
3. Toyota

Now customers want to set a notification on each unit start. stop and speed that I will use your example API,

But my query is how that customer will get push notification in his Device- the phone  is there an API call for that to get notification

17

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello Team,


How to delete a group of units

like I have created a new unit group with API

http://gps.tawasolmap.com/wialon/ajax.html?svc=core/create_unit_group&params={"creatorId":58415,"name":"Reddd","dataFlags":1}&sid=75bb13461791e60dabe4ff590d8aee4

e

Add Unit in the group

http://gps.tawasolmap.com/wialon/ajax.html?svc=unit_group/update_units&params={"itemId":62282,"units":[2751,20646]}&sid=5c2ce8bcaa3a2222f14cea9665f770b7

Now i want to delete this group name Reddd, which APi should i use

18

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

trushal.shah wrote:

Hello, Team Thanks for the Replay,

Before I call this API, Which API should i need to call to set that this login customer would get push notifications, like that

like Customer ABCD login with the application after authentication success, there are three Units associate with customer

1. BMW
2. Audi
3. Toyota

Now customers want to set a notification on each unit start. stop and speed that I will use your example API,

But my query is how that customer will get push notification in his Device- the phone  is there an API call for that to get notification

If you can please help in this also that how Notifications would work, like steps

19

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

To send mobile notification (push-notification) there is not API, because the action is executed from back-end side in Wialon.
For this it needs to activate the corresponding action in notifications settings - Send mobile notification

or you can don't use the our functional, but realize something on your side.

Diana Cheley
Wialon Hosting Expert
Gurtam
20

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

trushal.shah wrote:

Hello Team,


How to delete a group of units

like I have created a new unit group with API

http://gps.tawasolmap.com/wialon/ajax.html?svc=core/create_unit_group&params={"creatorId":58415,"name":"Reddd","dataFlags":1}&sid=75bb13461791e60dabe4ff590d8aee4

e

Add Unit in the group

http://gps.tawasolmap.com/wialon/ajax.html?svc=unit_group/update_units&params={"itemId":62282,"units":[2751,20646]}&sid=5c2ce8bcaa3a2222f14cea9665f770b7

Now i want to delete this group name Reddd, which APi should i use

Just use the request svc=item/delete_item where itemId is id of group.

Diana Cheley
Wialon Hosting Expert
Gurtam
21

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

chdi

Thanks delete group works for me.. thanks

22

How to get Unit Last update date and time

(edited by trushal.shah 06/11/2020 13:03:27)

Re: How to get Unit Last update date and time

chdi wrote:

Hello!

As I understand you need to create the following notifications with required parameters:

1) Control engine is on, action  - get mobile notifications
If unit has Engine Ignition sensor, you can create notification to control sensor by type = Engine Ignition Sensor ("engine operation")
Use the following parameters:

{"n":"example engine On","ta":1603746000,"td":0,"tz":134228528,"la":"en","ma":0,"sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"ctrl_sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"un":[1326],"trg":{"t":"sensor_value","p":{"sensor_type":"engine operation","sensor_name_mask":"*","lower_bound":1,"upper_bound":1,"prev_msg_diff":0,"merge":1,"type":0}},"d":"","act":[{"t":"mobile_apps","p":{"apps":"{\"Wialon\":[1027]}"}}],"txt":" notification text","fl":0,"mast":0,"mpst":0,"cdt":0,"mmtd":3600,"cp":3600,"id":28,"itemId":930849,"callMode":"update"}

2) Control engine is Off, action  - get mobile notifications
The same parameters as above, just change value range to 0 - "lower_bound":0,"upper_bound":0

3) Speed limit (the action as above)

{"n":"example1","ta":1603746000,"td":0,"tz":134228528,"la":"en","ma":0,"sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"ctrl_sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"un":[826],"trg":{"t":"speed","p":{"sensor_type":"","sensor_name_mask":"","lower_bound":0,"upper_bound":0,"merge":0,"min_speed":0,"max_speed":60,"driver":0}},"d":"","act":[{"t":"mobile_apps","p":{"apps":"{\"Wialon\":[1427]}"}}],"txt":" notification text","fl":0,"mast":0,"mpst":0,"cdt":0,"mmtd":3600,"cp":3600,"id":28,"itemId":849,"callMode":"update"}

where "min_speed":0,"max_speed":60 is allowed range.

4) Geofences control - in geofence ("type":0)

{"n":"example geo","ta":1603746000,"td":0,"tz":134228528,"la":"en","ma":0,"sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"ctrl_sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"un":[1186],"trg":{"t":"geozone","p":{"sensor_type":"","sensor_name_mask":"","lower_bound":0,"upper_bound":0,"merge":0,"geozone_ids":"930849_40:1595402237","geozone_id":"930849_40:1595402237","type":0,"min_speed":0,"max_speed":0,"lo":"OR"}},"d":"","act":[{"t":"mobile_apps","p":{"apps":"{\"Wialon\":[1427]}"}}],"txt":"%UNIT% arrived to %ZONE%. At %POS_TIME% it moved with speed %SPEED% near '%LOCATION%'.","fl":0,"mast":0,"mpst":0,"cdt":0,"mmtd":3600,"cp":3600,"id":28,"itemId":949,"callMode":"update"}

5) To get all notification with their params
Use the request resource/get_notification_data , the empty "col":"" returns all notifications



Push notification is not able to set as of with app, but as example I have set for the email and its works for the above example

for this simple text, i got a success message, but as i have set some dynamic as per that last example you have updated for the geozone same i have use for the engine status On 


http://gps.tawasolmap.com/wialon/ajax.html?svc=resource/update_notification&params={"n":"example engine On","ta":1603746000,"td":0,"tz":134228528,"la":"en","ma":0,"sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"ctrl_sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"un":[20646,55304,54533],"trg":{"t":"sensor_value","p":{"sensor_type":"engine operation","sensor_name_mask":"*","lower_bound":1,"upper_bound":1,"prev_msg_diff":0,"merge":1,"type":0}},"d":"","act":[{"t": "email","p":{"email_to":"trushal.shah@brainvire.com","html":1,"img_attach":1,"subj":"TawasolMap Notification"}}],"txt": "Name of the Unit %UNIT% . At %POS_TIME% near '%LOCATION%' Engine Status is ON","fl":0,"mast":0,"mpst":0,"cdt":0,"mmtd":3600,"cp":3600,"id":6,"itemId":55874,"callMode":"update"}&sid=662b6d5cd6dccfecc01266b7604690df

getting error

{
    "error": 4,
    "reason": "WRONG_PARAMS"
}

i have set below text from your last example

"txt": "Name of the Unit %UNIT% . At %POS_TIME% near '%LOCATION%' Engine Status is ON"

23

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello trushal.shah !

"txt": "Name of the Unit %UNIT% . At %POS_TIME% near '%LOCATION%' Engine Status is ON" - the special characters parameters, in this example %, should be URL-encoded - https://www.w3schools.com/tags/ref_urlencode.ASP
Please try to change % to  %25

PS. It's not advisable to provide sensitive real information like token, elements ID, session id. To check some your special case you can provide me this information via PM

Diana Cheley
Wialon Hosting Expert
Gurtam
24

How to get Unit Last update date and time

(edited by trushal.shah 09/11/2020 16:11:56)

Re: How to get Unit Last update date and time

Thanks for the update

Sure I will take care of this,

I just want to know  about engine status On/Off

Case1: Speed is greater then zero  then Engine is ON

Case 2" Speed is equal to zero then

Speed 0 then engine off but some time speed is zero but engine status looks ON in the wialon Application

so which field should i consider for the engine status

i have below details of ignition and trip


"20317": [
  {
    "ignition": {
      "1": {
        "from": {
          "t": 1601453651,
          "y": 26.5767269135,
          "x": 50.0240821838
        },
        "to": {
          "t": 1601454262,
          "y": 26.5540847778,
          "x": 50.021686554
        },
        "m": 1601454262,
        "f": 0,
        "state": 13.635,
        "type": 1,
        "hours": 821580,
        "switches": 505,
        "value": 13.635
      }
    }
  },
  {
    "trips": {
      "from": {
        "t": 1601453652,
        "y": 26.5767288208,
        "x": 50.0240821838
      },
      "to": {
        "t": 1601454262,
        "y": 26.5540847778,
        "x": 50.021686554
      },
      "m": 1601454262,
      "f": 0,
      "state": 1,
      "max_speed": 74,
      "curr_speed": 43,
      "avg_speed": 32,
      "distance": 5486,
      "odometer": 10899730,
      "course": 177,
      "altitude": 2
    }
  }
25

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello trushal.shah  !

You need to consider parameter "state"
"state" = 1 means ignition is ON when sensor is digital (so device sends 1 or 0 values, or ignition sensor has calculation table to get 1 or 0 values)
In your case I see the value  is , it means that Ignition is On (no zero value is ON also), but it's better to set up calculation table for sensor

Please note if we talk about history data (events/load/get) in this case the system always return intervals where Ignition is On ,parameter 'state' is not zero (like in report table Engine hours)

Diana Cheley
Wialon Hosting Expert
Gurtam
26

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello chdi,

Thanks for your last update, Need your more help to execute the report with the group 

to exexute report with single unit as its working fine,

http://gps.tawasolmap.com/wialon/ajax.html?svc=report/exec_report&params={"reportResourceId":55874,"reportTemplateId":10,"reportObjectId":20646,"reportObjectSecId":0,"interval":{"from":1601449803,"to":1601877534,"flags":0}}&sid=38e426df6995780573aad7a2ce59732f

but how i can report for the group of units


i have group id 63926 and list of units in the group

[20306,54533,55304]

params={
  "reportResourceId": 55874,
  "reportTemplateId": 10,
  "reportObjectId": 63926,
  "reportObjectSecId": 0,
  "reportObjectIdList":[20306,54533,55304],
  "interval": {
    "from": 1601449803,
    "to": 1601877534,
    "flags": 0
  }
}&sid=38e426df6995780573aad7a2ce59732f
27

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello, trushal.shah !

To execute group report first please make sure that report temlate is for group (check on interface or via request report/get_report_data - in resposne parameter "ct":"avl_unit_group")
Then you can pass group id ( 63926 ) in "reportObjectId" ("reportObjectId" always should have value), report will be executed for all unitns in this group.

Also you can pass list (items id) of additioal units or groups in parameter "reportObjectIdList".

It doesn't need to pass id of units from group in  "reportObjectId", the parameter "reportObjectIdList" is empty ("reportObjectIdList":[]) if you execute report only for one group.

Diana Cheley
Wialon Hosting Expert
Gurtam
28

How to get Unit Last update date and time

(edited by trushal.shah 19/11/2020 15:07:59)

Re: How to get Unit Last update date and time

chdi wrote:

Hello, trushal.shah !

To execute group report first please make sure that report temlate is for group (check on interface or via request report/get_report_data - in resposne parameter "ct":"avl_unit_group")
Then you can pass group id ( 63926 ) in "reportObjectId" ("reportObjectId" always should have value), report will be executed for all unitns in this group.

Also you can pass list (items id) of additioal units or groups in parameter "reportObjectIdList".

It doesn't need to pass id of units from group in  "reportObjectId", the parameter "reportObjectIdList" is empty ("reportObjectIdList":[]) if you execute report only for one group.


thanks for the response,

How i can get groups templates and unit template list which API should i call ?

http://gps.tawasolmap.com/wialon/ajax.html?svc=report/get_report_data&params={"itemId":55874,"col":[]}&sid=bc9c650e4b732d33ed2a04c91528df20

in response i am getting

[]

29

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

trushal.shah wrote:
chdi wrote:

Hello, trushal.shah !

To execute group report first please make sure that report temlate is for group (check on interface or via request report/get_report_data - in resposne parameter "ct":"avl_unit_group")
Then you can pass group id ( 63926 ) in "reportObjectId" ("reportObjectId" always should have value), report will be executed for all unitns in this group.

Also you can pass list (items id) of additioal units or groups in parameter "reportObjectIdList".

It doesn't need to pass id of units from group in  "reportObjectId", the parameter "reportObjectIdList" is empty ("reportObjectIdList":[]) if you execute report only for one group.


thanks for the response,

How i can get groups templates and unit template list which API should i call ?

http://gps.tawasolmap.com/wialon/ajax.html?svc=report/get_report_data&params={"itemId":55874,"col":[]}&sid=bc9c650e4b732d33ed2a04c91528df20

in response i am getting

[]

Hello !

you need to specify the report templates id in "col", like "col":[1,2,5,10] for example

Diana Cheley
Wialon Hosting Expert
Gurtam
30

How to get Unit Last update date and time

(edited by trushal.shah 23/11/2020 12:08:27)

Re: How to get Unit Last update date and time

chdi wrote:
trushal.shah wrote:
chdi wrote:

Hello, trushal.shah !

To execute group report first please make sure that report temlate is for group (check on interface or via request report/get_report_data - in resposne parameter "ct":"avl_unit_group")
Then you can pass group id ( 63926 ) in "reportObjectId" ("reportObjectId" always should have value), report will be executed for all unitns in this group.

Also you can pass list (items id) of additioal units or groups in parameter "reportObjectIdList".

It doesn't need to pass id of units from group in  "reportObjectId", the parameter "reportObjectIdList" is empty ("reportObjectIdList":[]) if you execute report only for one group.


thanks for the response,

How i can get groups templates and unit template list which API should i call ?

http://gps.tawasolmap.com/wialon/ajax.html?svc=report/get_report_data&params={"itemId":55874,"col":[]}&sid=bc9c650e4b732d33ed2a04c91528df20

in response i am getting

[]

Hello !

you need to specify the report templates id in "col", like "col":[1,2,5,10] for example


Thank you for your reply, that is my query how i can get that report templates ids like which template belong to units and which is for the unit groups

i need this for the report page

31

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello trushal.shah !

If the reports templates ids are already known, you can get report type (unit or unit group) via request report_get_report_data
If no, you can get report templates ids and  template type via request search item - you need to search required resource where reports created and get information about report (flag for reports templates data  - https://sdk.wialon.com/wiki/en/sidebar/ … templates)
For example,  search resource by its name, flag = 8192 will return information about report templates

https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items&sid=027326aeaef91fb9a10eed84d3b

params: {"spec":{"itemsType":"avl_resource","propName":"rel_is_account,sys_name","propValueMask":"1,*di*","sortType":"sys_name"},"force":1,"flags":5,"from":0,"to":19}

response

{"rep":{"1":{"id":1,"n":"Report WatchLock","ct":"avl_unit","c":57059},"2":{"id":2,"n":"Driver report","ct":"avl_driver","c":52959},"3":{"id":3,"n":"гео diand","ct":"avl_unit","c":44292}},"repmax":0},{"rep":{"1":{"id":1,"n":"Diana","ct":"avl_unit","c":31607},"2":{"id":2,"n":"Новый отчет","ct":"avl_unit","c":46749},"3":{"id":3,"n":"Month report","ct":"avl_unit_group","c":13735}},"repmax":-1}
Diana Cheley
Wialon Hosting Expert
Gurtam
32

How to get Unit Last update date and time

(edited by trushal.shah 24/11/2020 16:24:43)

Re: How to get Unit Last update date and time

chdi wrote:

Hello trushal.shah !

If the reports templates ids are already known, you can get report type (unit or unit group) via request report_get_report_data
If no, you can get report templates ids and  template type via request search item - you need to search required resource where reports created and get information about report (flag for reports templates data  - https://sdk.wialon.com/wiki/en/sidebar/ … templates)
For example,  search resource by its name, flag = 8192 will return information about report templates

https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items&sid=027326aeaef91fb9a10eed84d3b

params: {"spec":{"itemsType":"avl_resource","propName":"rel_is_account,sys_name","propValueMask":"1,*di*","sortType":"sys_name"},"force":1,"flags":5,"from":0,"to":19}

response

{"rep":{"1":{"id":1,"n":"Report WatchLock","ct":"avl_unit","c":57059},"2":{"id":2,"n":"Driver report","ct":"avl_driver","c":52959},"3":{"id":3,"n":"гео diand","ct":"avl_unit","c":44292}},"repmax":0},{"rep":{"1":{"id":1,"n":"Diana","ct":"avl_unit","c":31607},"2":{"id":2,"n":"Новый отчет","ct":"avl_unit","c":46749},"3":{"id":3,"n":"Month report","ct":"avl_unit_group","c":13735}},"repmax":-1}

Thanks for replay

how i can use this "propValueMask":"1,*di*"

because with this i am not able to get data but if I set only with "propValueMask":"*" getting data

but getting  44 records but i can see there is just a few templates associate with an account with wialon mobile applications

please check the attached screenshot, i have taken from wialon application tab report click

33

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

In "propValueMask" you can set up a full element name (mask), or part with * as mask, or leave :"*"  which means any name (any value).
For example, "propValueMask":"1,*di*"  means element with exact name '1' and elements' names contains 'di'
In my example above it's request to search element (resource) by 2 criteria ("propName":"rel_is_account,sys_name", "propValueMask":"1,*di*") : rel_is_account is 1 (account status) and sys_name (element name) contains 'di'

In your case you can apply full resource name in "propValueMask" - the system will search resource(account) by this name and return data about reports templates created in this resource.
Also you can search item only by 1 criteria (by name)

https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items&sid=026cba6349a502333fe462d&params={"spec":{"itemsType":"avl_resource","propName":"sys_name","propValueMask":"*res_name*","sortType":"sys_name"},"force":1,"flags":5,"from":0,"to":19}
Diana Cheley
Wialon Hosting Expert
Gurtam
34

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Thanks for all your message,

as your last update that we can not send a push notification with wialon API,

then how i can send any link or any  support that I can set in my application to get notification same as wialon does

also that how I can get a list of notification that user get on a set of notification

i have attached three screenshots that I need to integrate this flow in my current application how i can do that which APi should is use

1) get List of notifications as per request
2) Any support URL that i can integrate to set push notifications the same as wialon app

thanks for your support again

35

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello trushal.shah!

could you please write me to email chdi@gurtam.com , that we can discuss about some details regarding your app.

Diana Cheley
Wialon Hosting Expert
Gurtam
36

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

chdi wrote:
trushal.shah wrote:

Thanks for the solutions,

Last point that how I can get the movement of the units with start and [Between each] endpoint the day, or between dates

Hello!

To get history data of events (trips, ignition) you need to execute  events/load & events/get
First you load events for some period  - , then get  it
For example,

Get trips from Oct 1 - Oct 5 , unix time UTC+0

Load events

https://hst-api.wialon.com/wialon/ajax.html?svc=events/load&params={"ivalType":1,"itemId":214,"timeFrom":1601510400,"timeTo":1601942399,"detectors":[{"type":"trips","filter1":0}]}&sid=028384ac3f02f18c414208758685b320

Get result

https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"type":"trips","timeFrom":1601510400,"timeTo":1601942399,"detalization":3}}&sid=028384ac3f028758685b320

As this works perfect for us, but here with a response

"type":"trips"

we are not getting idle or parking details of the unit, if you can please help me with which parameter we should update to get all unit trip details with movement and, parking

37

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hi trushal.shah,

there is not registered parking evetns. There are calculated on web-part. When you can 'trips' event, you get trip start and trip end ("from" / "to"), so you need to calculate parking as beetween end of 1 trip and start 2d trip.

For example, the return result from the day

{"trips":{"0":[{"from":{"t":1606820862,"y":46.1797103882,"x":-123.037498474},"to":{"t":1606821362,"y":46.1567115784,"x":-123.059989929},"m":1606821662,"f":0}]},{"1":[{"from":{"t":1606825022,"y":46.1567115784,"x":-123.059989929},"to":{"t":1606825622,"y":46.1567115784,"x":-123.059989929},"m":1606821897,"f":0}]}}

So 1st parking was till to "t":1606820862 (11:07:42 UTC+0) , the second parking from  1606821362 (1st trip end) to 160682502 (2nd trip begin) with duration 1606821362 - 1606825022 = 3660 sec = 1 h 1 min
The next parking will be from 1606825622 (2d trip end) till next trip begining

Diana Cheley
Wialon Hosting Expert
Gurtam
38

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

chdi wrote:

Hi trushal.shah,

there are not registered parking events. There are calculated on web-part. When you can 'trips' event, you get the trip start and trip end ("from" / "to"), so you need to calculate parking as between the end of 1 trip and start 2d trip.

For example, the return result from the day

{"trips":{"0":[{"from":{"t":1606820862,"y":46.1797103882,"x":-123.037498474},"to":{"t":1606821362,"y":46.1567115784,"x":-123.059989929},"m":1606821662,"f":0}]},{"1":[{"from":{"t":1606825022,"y":46.1567115784,"x":-123.059989929},"to":{"t":1606825622,"y":46.1567115784,"x":-123.059989929},"m":1606821897,"f":0}]}}

So 1st parking was till to "t":1606820862 (11:07:42 UTC+0) , the second parking from  1606821362 (1st trip end) to 160682502 (2nd trip begin) with duration 1606821362 - 1606825022 = 3660 sec = 1 h 1 min
The next parking will be from 1606825622 (2d trip end) till next trip begining


Thanks for your reply,

its works for us to get some movement of the unit with the center of the day but I am not getting if in the parking with start and endpoint

The first trip end time (to time) will be the starting of the parking time(from the time) and the second trip start time will be the end time of the parking event and so on we are calculating parking detail between all the trips.

1. How we can calculate the first parking event of the day which is shown in the attached image as point 1
2. How we can calculate the last parking event of the day which is shown in the attached image as point 2
- If it is the same day event then we are considering the current time as the end time of the last parking event, but for the last day we have considered the end time of the day 11:59 PM but we are not able to calculate that data

39

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

1. To calculate the first parking in day it depend on your goal, for example you can group events by days, so the day starts from 00:00 to 23:59
and cut the event by begin/end of day.
So to calculate first parking you just calculate time from 00:00 to start 1st trip.
2. The last parking event you can calculate by the end of the day (23:59) , if the day was at history. If it's current day you can calculate by current time
For example, the last trip was end at 09:00 AM, now current time is 9:31, so the current parking is 32 min

Diana Cheley
Wialon Hosting Expert
Gurtam
40

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

chdi wrote:

Hello!

1) Last data information (unit name, speed, position, date/time) you can get via request search item (or search items ) with correspodings flags value.

2) Engine status , moving/parking status you can get via Events - trips and igntion 
To get live events the steps are the following

  • Then execute request events/check_updates, for example every 2-5 sec, to get response with online data

For example

1. First (after login) it needs to add required units to session via request  svc=events/update_units

https://hst-api.wialon.com/wialon/ajax.html?svc=events/update_units&params={"mode":"add","units":[{"id":2147,"detect":{"ignition":0,"trips":0}},{"id":2174,"detect":{"ignition":0,"trips":0}}]}&sid=023078baa1999df1ea0da05cd4cbc9a02cb

"units" - units array where  'id' - unit's id, 'detect' - required events types, in our case only "ignition":0 and trips "trips":0, 0 means all ignition sensors, if you know that unit has only 1 ignition sensor, you can set up '0'.
If there is several ignition sensors it's better to set up sensor's id. But sure it depends on appropriate business task. For trips is always 0 ("trips":0).
It needs to specify for each units 'id' each 'detect' type.

2. After required units has been added to session, we can monitor online ingtion state via request events/check_updates which can be executed for example every 2 sec or rarely , it depends on how often the device sends data to the server

https://hst-api.wialon.com/wialon/ajax.html?svc=events/check_updates&params={"detalization":3}&sid=023078baa1999df1ea0da05cd4cbc9a02cb

"detalization":3  means that server will return  JSON information for flags plus


This is working for us properly , Here how we should manage engine status for below conditions how we should get flags in the response of this



Hello if you can please help me to get unit engine status with the bellow cases

How i can get it from API

1) Add key next to the icon when the engine starts it : Green with key when Vehicle is moving and the engine is on,

2) Red with key when the Vehicle stop and the engine is on,

3) Green only if the Vehicle moving without start engine so no key in this situation & red without key if the Vehicle stops and the engine off.


what we have considered that if speed is > 0 then engine status is ON and Speed = 0 then engine status is off but how we should calculate that speed with and engine status with current screens shots

41

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

As this status is online, you need to get events in online mode, for this it needs to use get
You can get current online trips and ignition, please look below the detailed example.

+ show spoiler

To control online current ignition state it can be used request  events/check_updates
http://sdk.wialon.com/wiki/en/sidebar/r … ck_updates

1. First (after login) it needs to add required units to session via request  svc=events/update_units
http://sdk.wialon.com/wiki/en/sidebar/r … date_units

https://hst-api.wialon.com/wialon/ajax.html?svc=events/update_units&params={"mode":"add","units":[{"id":21080147,"detect":{"ignition":0,"trips":0}},{"id":21728414,"detect":{"ignition":0,"trips":0}}]}&sid=02abb0c22bb8a9cc5df633a630bcbbfb

"units" - units array where  'id' - unit's id, 'detect' - required events types, in our case only "ignition":0 and trips "trips":0, 0 means all ignition sensors, if you know that unit has only 1 ignition sensor, you can set up '0'.
If there is several ignition sensors it's better to set up sensor's id. But sure it depends on appropriate business task. For trips is always 0 ("trips":0).
It needs to specify for each units 'id' each 'detect' type.

2. After required units has been added to session, we can monitor online ignition state via request events/check_updates which can be executed for example every 2 sec or rarely , it depends on how often the device sends data to the server

https://hst-api.wialon.com/wialon/ajax.html?svc=events/check_updates&params={"detalization":3}&sid=023078baa1df1ea0da05cd4cbc9a02cb

"detalization":3  means that server will return  JSON information for flags plus

First response


{"21080147":[{"ignition":{"1":{"from":{"t":1590045850,"y":43.79845047,"x":-99.7432632446},"to":{"t":1590046021,"y":43.79845047,"x":-99.7432632446},"m":1590046021,"f":0,"state":0,"type":1,"hours":175782,"switches":2,"value":0}}}]}

21 May 2020 07:24:10 - 21 May 2020 07:27:01 = time from / to
"state":0 - ignition is Off
So during 2 min 51 sec ignition has being Off

Next request svc=events/check_updates
Response
{} - empty answer  means nothing changes as there is not yet new messages coming

new message with time 05-21-2020 07:33:36 coming, due to several second event has been recalculated

{"21080147":[{"ignition":{"1":{"from":{"t":1590045850,"y":43.79845047,"x":-99.7432632446},"to":{"t":1590046416,"y":43.79845047,"x":-99.7432632446},"m":1590046416,"f":0,"state":0,"type":1,"hours":175782,"switches":2,"value":0}}}]}

21 May 2020 07:24:10
21 May 2020 07:33:36

Ignition switched to On , new messages with time 05-21-2020 07:36:02 coming , new interval with state = 1 has been calculated


{"21080147":[{"ignition":{"1":{"from":{"t":1590046562,"y":43.79845047,"x":-99.7432632446},"to":{"t":1590046562,"y":43.79845047,"x":-99.7432632446},"m":1590046562,"f":0,"state":1,"type":1,"hours":175782,"switches":3,"value":1}}}]}

21 May 2020 07:36:02
21 May 2020 07:36:02

messages still coming with ignition On, event with state =1  recalculated with every new messages (delay can be about 1-3 sec, but if device sends data from black-box memory, the delay for recalculation can be more, even about 1 hour)

{"21080147":[{"ignition":{"1":{"from":{"t":1590046562,"y":43.79845047,"x":-99.7432632446},"to":{"t":1590046706,"y":43.79845047,"x":-99.7432632446},"m":1590046706,"f":0,"state":1,"type":1,"hours":175926,"switches":3,"value":1}}}]}

{}

{"21080147":[{"ignition":{"1":{"from":{"t":1590046562,"y":43.79845047,"x":-99.7432632446},"to":{"t":1590046767,"y":43.79845047,"x":-99.7432632446},"m":1590046767,"f":0,"state":1,"type":1,"hours":175987,"switches":3,"value":1}}}]}

{"21080147":[{"ignition":{"1":{"from":{"t":1590046562,"y":43.79845047,"x":-99.7432632446},"to":{"t":1590046777,"y":43.79845047,"x":-99.7432632446},"m":1590046777,"f":0,"state":1,"type":1,"hours":175997,"switches":3,"value":1}}}]}

So after every request  events/check_updates  you will get  {} answer which means nothing was change  or recalculation with new time or state.
On your side you can calculate difference between time from/to as duration of current state.

Diana Cheley
Wialon Hosting Expert
Gurtam
42

How to get Unit Last update date and time

(edited by trushal.shah 17/12/2020 13:08:02)

Re: How to get Unit Last update date and time

Hi, thanks for your help and support

I want to bind the driver with a unit with a code or password

I can do create Driver with the below API it's working for me

resource/update_driver&params={"itemId":1299,"id":0,"callMode":"create","ej":"","c":"123456","ck":0,"ds":"Joy testing as driver","n":"Joy driver","p":" %2B1234567","r":0,"f":4,"pwd":"123456","jp":""}

                  
I can bind driver with unit
       

svc=resource/bind_unit_driver&params={"resourceId":1299,"unitId":1233,"driverId":1,"time":0,"mode":1}

How I can bind drive with a specific password of code which added on create a driver

for e.g i create one driver ABCD with code='123456' and password= 'ABCD'

and while the driver click to bind with the unit he/she needs to add their code

how to set bind driver with a passcode  if you can please help me

Also please help me how i can get all list of register drivres

43

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

1. The password in drivers settings it's only used in mobile logistics app for the driver. http://apps.wialon.com/docs/en/logistics.html
Sure you can use this property another way in your app. For example, when user click to bind driver it (manually binding) it will the alert window where it needs to confirm password
But in Wialon system there is not such functional.

2. To get binding/unbinding of a driver for specified period of time use the request svc=resource/get_driver_bindings
To get list of binded drivers for specific unit - svc=resource/get_unit_drivers
To get all created drivers in resource(s) - use request search_item/search_items (search resource) with flags = 256 ( https://sdk.wialon.com/wiki/en/sidebar/ … ce#drivers )

Diana Cheley
Wialon Hosting Expert
Gurtam
44

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

chdi wrote:

The password in drivers settings it's only used in mobile logistics app for the driver. http://apps.wialon.com/docs/en/logistics.html
Sure you can use this property another way in your app. For example, when user click to bind driver it (manually binding) it will the alert window where it needs to confirm password
But in Wialon system there is not such functional.


so there is no such API where we can post driver id and password before bind driver with the unit?

45

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

trushal.shah wrote:
chdi wrote:

The password in drivers settings it's only used in mobile logistics app for the driver. http://apps.wialon.com/docs/en/logistics.html
Sure you can use this property another way in your app. For example, when user click to bind driver it (manually binding) it will the alert window where it needs to confirm password
But in Wialon system there is not such functional.


so there is no such API where we can post driver id and password before bind driver with the unit?

there is not such possibility in Wialon.

Diana Cheley
Wialon Hosting Expert
Gurtam
46

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

chdi wrote:
trushal.shah wrote:

Thanks for the solutions,

Last point that how I can get the movement of the units with start and [Between each] endpoint the day, or between dates

Hello!

To get history data of events (trips, ignition) you need to execute  events/load & events/get
First you load events for some period  - , then get  it
For example,

Get trips from Oct 1 - Oct 5 , unix time UTC+0

Load events

https://hst-api.wialon.com/wialon/ajax.html?svc=events/load&params={"ivalType":1,"itemId":214,"timeFrom":1601510400,"timeTo":1601942399,"detectors":[{"type":"trips","filter1":0}]}&sid=028384ac3f02f18c414208758685b320

Get result

https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"type":"trips","timeFrom":1601510400,"timeTo":1601942399,"detalization":3}}&sid=028384ac3f028758685b320


Hello I need to know that as suggested API to get history of trips and its workig like charm, but here we get differet on display rooth path on the map,


svc=events/get

get a response from APi with start and end location

"trips": {
        "0": [
            {
                "from": {
                    "t": 1608526381,
                    "y": 24.7762775421,
                    "x": 46.6249923706
                },
                "to": {
                    "t": 1608527106,
                    "y": 24.7713947296,
                    "x": 46.6237869263
                }

and we use this start and end location as in the below API of the google

https://maps.googleapis.com/maps/api/directions/json?origin=\(source.latitude),\(source.longitude)&destination=\(destination.latitude),\(destination.longitude)&sensor=false&mode=driving&key=\(API_KEY)")

but we are getting the wrong path to compare to Wialon track location path at history page ,

if you can please help me that how i can get this root location from start to endpoint

47

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

The Wialon is displayed track using Google Polyline Algorithm
When you request trips events, you can get such track in parameter  , just add flag ("detalization")  = 8

For example,

https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"type":"trips","timeFrom":1601510400,"timeTo":1608551874,"detalization":9}}&sid=06f3f79ddfad80414a4db

Response

{"trips":{"0":[{"from":{"t":1608377059,"y":46.8571205139,"x":-122.974449158},"to":{"t":1608377259,"y":46.826374054,"x":-122.963294983},"m":1608377483,"f":2,"track":"_x~|GfmqmV??????lo@wdA????vnC?????"},{"from":{"t":1608379499,"y":46.826374054,"x":-122.963294983},"to":{"t":1608379749,"y":46.8789367676,"x":-122.876327515},"m":1608379749,"f":2,"track":"ywx|GngomV??????????????ogI??o~O??"}

Then you can decode 'track' via Google Decode Polyline

Diana Cheley
Wialon Hosting Expert
Gurtam
48

How to get Unit Last update date and time

(edited by trushal.shah 22/12/2020 17:46:48)

Re: How to get Unit Last update date and time

chdi wrote:

Hello!

The Wialon is displayed track using Google Polyline Algorithm
When you request trips events, you can get such track in parameter  , just add flag ("detalization")  = 8

For example,

https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"type":"trips","timeFrom":1601510400,"timeTo":1608551874,"detalization":9}}&sid=06f3f79ddfad80414a4db

Response

{"trips":{"0":[{"from":{"t":1608377059,"y":46.8571205139,"x":-122.974449158},"to":{"t":1608377259,"y":46.826374054,"x":-122.963294983},"m":1608377483,"f":2,"track":"_x~|GfmqmV??????lo@wdA????vnC?????"},{"from":{"t":1608379499,"y":46.826374054,"x":-122.963294983},"to":{"t":1608379749,"y":46.8789367676,"x":-122.876327515},"m":1608379749,"f":2,"track":"ywx|GngomV??????????????ogI??o~O??"}

Then you can decode 'track' via Google Decode Polyline

Hello Thanks for the reply

https://sdk.wialon.com/wiki/en/kit/remoteapi/apiref/events/get#x1_flag

("detalization")  = 8

Which flag I should post that I can get all the details of the trip in a single response

distance key and engine hours with the same response where we get to track of the units

49

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

You can apply "detalization":256.

Diana Cheley
Wialon Hosting Expert
Gurtam
50

How to get Unit Last update date and time

(edited by trushal.shah 28/12/2020 16:56:08)

Re: How to get Unit Last update date and time

Diana wrote:

Hello!

There is not quotes for text parameters, like "pageOrientation":portrait, "coding":utf8 and etc.

the correct params

{"format":2,"pageOrientation":"portrait","pageSize":"a4","pageWidth":0,"coding":"utf8","delimiter":"semicolon","headings":0,"compress":1,"attachMap":0,"extendBounds":0,"hideMapBasis":0,"outputFileName":"Online_report"}

Hello thanks for your support

In the report, I request

Between date from 27/12/2020 00:00 AM
Between date To 27/12/2020 11:59 PM

exec_report API:

{"reportObjectSecId":0,"reportObjectId":20306,"interval":{"flags":0,"to":1609113599,"from":1609027200},"reportResourceId":"62290","reportTemplateId":1}"

exec_result API

"extendBounds":0,"pageWidth":0,"format":2,"headings":0,"coding":"utf8","pageSize":"a4","pageOrientation":"portrait","delimiter":"semicolon","attachMap":1,"outputFileName":"eabdalmnem_27/12/2020","hideMapBasis":1,"compress":0}

Above both API working and we are getting report as PDF file

But here the issue is we are not getting proper data with the above post formates

we use to get date as UTC time [timeFormatter.timeZone = TimeZone(abbreviation: "UTC")]

Please check two diff response screenshots

Initial location, Final location, Duration this data are coming proper

But Beginning time and End time coming wrong

51

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

By default report result has UTC+0 timezone.
To apply user's timezone to report result, after login it needs to execute request  render/set_locale
Then you can execute reports, get PDF file.

For example, timezone +5.30 = "tzOffset":134237528
"tzOffset" value includes DST settings (no DST = 0x08000000 = 134217728 )

https://hst-api.wialon.com/wialon/ajax.html?svc=render/set_locale&sid=02b93b7a37e3ce1510908253b4db8902
params: {"tzOffset":134237528,"language":"en","flags":256,"formatDate":"%m-%E-%Y %H:%M:%S"}

Note: also it may need to url-encode special symbol %

Diana Cheley
Wialon Hosting Expert
Gurtam
52

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Diana wrote:

Hello!

By default report result has UTC+0 timezone.
To apply user's timezone to report result, after login it needs to execute request  render/set_locale
Then you can execute reports, get PDF file.

For example, timezone +5.30 = "tzOffset":134237528
"tzOffset" value includes DST settings (no DST = 0x08000000 = 134217728 )

https://hst-api.wialon.com/wialon/ajax.html?svc=render/set_locale&sid=02b93b7a37e3ce1510908253b4db8902
params: {"tzOffset":134237528,"language":"en","flags":256,"formatDate":"%m-%E-%Y %H:%M:%S"}

Note: also it may need to url-encode special symbol %

thanks for the response,

Here if the customer location is in Saudi Arabia and maybe a different location then do we need to update each time different time zone

53

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

How to execute a command for different requests

With search_item API we got different command and each command have different execution, on which flag we set a condition to user selection

core/search_item&params={"id":29916,"flags":512}


{
    "item": {
        "cmds": [
            {
                "n": "إطفاء المحرك",
                "a": 1,
                "t": "tcp,gsm,vrt",
                "c": "custom_msg",
                "p": "Out 1,0"
            },
            {
                "n": "تشغيل المحرك",
                "a": 1,
                "t": "tcp,gsm,vrt",
                "c": "custom_msg",
                "p": "Out 1,1"
            },
            {
                "n": "Arnavi 2",
                "a": 1,
                "t": "tcp,gsm,vrt",
                "c": "custom_msg",
                "p": ""
            },
            {
                "n": "إعادة تشغيل الجهاز",
                "a": 1,
                "t": "tcp,gsm,vrt",
                "c": "custom_msg",
                "p": "reset"
            }
        ]
    },
    "flags": 512
}

1) Sent message option to execute a command
2) Reset option to execute the command
3) simple Execute commands

How i can differenciate this response value of t,c and p for different units,

svc=unit/exec_cmd&params={"itemId":55873,"commandName":"custom_msg","linkType":"tcp,gsm,vrt","param":"","timeout":10,"flags":0}
54

How to get Unit Last update date and time

(edited by trushal.shah 01/01/2021 14:39:02)

Re: How to get Unit Last update date and time

Diana wrote:
trushal.shah wrote:

Thanks for the solutions,

Last point that how I can get the movement of the units with start and [Between each] endpoint the day, or between dates

Hello!

To get history data of events (trips, ignition) you need to execute  events/load & events/get
First you load events for some period  - , then get  it
For example,

Get trips from Oct 1 - Oct 5 , unix time UTC+0

Load events

https://hst-api.wialon.com/wialon/ajax.html?svc=events/load&params={"ivalType":1,"itemId":214,"timeFrom":1601510400,"timeTo":1601942399,"detectors":[{"type":"trips","filter1":0}]}&sid=028384ac3f02f18c414208758685b320

Get result

https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"type":"trips","timeFrom":1601510400,"timeTo":1601942399,"detalization":3}}&sid=028384ac3f028758685b320

Hello

Thanks for your support,

if you can please support us for below query

Event Load:
{"ivalType":1,"itemId":54533,"timeFrom":1609007400,"timeTo":1609093799,"detectors":[{"type":"trips","filter1":0},{"type":"ignition","filter1":0}]}

Get Event

svc=events/get&params={"selector":{"type":"*","timeFrom":1609007400,"timeTo":1609093799,"detalization":11}}

Here how we can get stop details of the unit movement for track pages

please check the screenshot, we need to display the same stop icon on the map

55

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

The Stops are the part of trips where speed is less than min value speed in Trip Detector. So if you need stops intervals you can request events trips with selected speed (custom intervals expressions)

For example, the min speed value = 1 km/h, so "expr":"trips{s<1}" means intervals where speed (s) less than 1 km/h

First load trips

https://hst-api.wialon.com/wialon/ajax.html?svc=events/load&params={"ivalType":1,"itemId":21728414,"timeFrom":1609718400,"timeTo":1609804799,"detectors":[{"type":"trips","filter1":0}]}&sid=02b93b7a37e3ce1510908253b4db8902

Then request intervals with speed < 1 km/h


https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"expr":"trips{s<1}","timeFrom":1609718400,"timeTo":1609804799,"detalization":1}}&sid=02b93b7a37e3ce1510908253b4db8902

Response

{"trips":{"0":[{"from":{"t":1609753417,"y":43.3473701477,"x":-8.48857975006},"to":{"t":1609753448,"y":43.2673683167,"x":-8.48857975006},"m":0,"f":0},{"from":{"t":1609753490,"y":43.2673683167,"x":-6.4885802269},"to":{"t":1609753530,"y":43.1673698425,"x":-6.34601783752},"m":0,"f":0},{"from":{"t":1609754439,"y":42.4268341064,"x":-8.6491394043},"to":{"t":1609754439,"y":42.4268341064,"x":-8.6491394043},"m":0,"f":0}]}}
Diana Cheley
Wialon Hosting Expert
Gurtam
56

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Diana wrote:

Hello!

The Stops are the part of trips where speed is less than min value speed in Trip Detector. So if you need stops intervals you can request events trips with selected speed (custom intervals expressions)

For example, the min speed value = 1 km/h, so "expr":"trips{s<1}" means intervals where speed (s) less than 1 km/h

First load trips

https://hst-api.wialon.com/wialon/ajax.html?svc=events/load&params={"ivalType":1,"itemId":21728414,"timeFrom":1609718400,"timeTo":1609804799,"detectors":[{"type":"trips","filter1":0}]}&sid=02b93b7a37e3ce1510908253b4db8902

Then request intervals with speed < 1 km/h


https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"expr":"trips{s<1}","timeFrom":1609718400,"timeTo":1609804799,"detalization":1}}&sid=02b93b7a37e3ce1510908253b4db8902

Response

{"trips":{"0":[{"from":{"t":1609753417,"y":43.3473701477,"x":-8.48857975006},"to":{"t":1609753448,"y":43.2673683167,"x":-8.48857975006},"m":0,"f":0},{"from":{"t":1609753490,"y":43.2673683167,"x":-6.4885802269},"to":{"t":1609753530,"y":43.1673698425,"x":-6.34601783752},"m":0,"f":0},{"from":{"t":1609754439,"y":42.4268341064,"x":-8.6491394043},"to":{"t":1609754439,"y":42.4268341064,"x":-8.6491394043},"m":0,"f":0}]}}


Hi, thanks for the reply

we got the response trips{s<1} with this condition but same time we need trips data also

so how I can get all movement of the vehicle with stop, parking, and  trips in single response

57

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

There is not parking intervals in response.
You can get only trips, and trips with less speed (stops).
The parkings are calculated as difference between trips time.

First load, then get all full trips, and then get trips intervals (with speed less) as stops.

https://hst-api.wialon.com/wialon/ajax.html?svc=events/load&params={"ivalType":1,"itemId":21728414,"timeFrom":1609718400,"timeTo":1609891199,"detectors":[{"type":"trips","filter1":0}]}&sid=026499c89bc755056c401314b35bfa9f
https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"type":"trips","timeFrom":1609718400,"timeTo":1609891199,"detalization":1}}&sid=026499c89bc755056c401314b35bfa9f
https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"expr":"trips{s<1}","timeFrom":1609718400,"timeTo":1609891199,"detalization":1}}&sid=026499c89bc755056c401314b35bfa9f

All 3 requests can be execute at one svc=core/batch

Format like
https://hst-api.wialon.com/wialon/ajax.html?svc=core/batch&sid=026499c89bc755056c401314b35bfa9f&params={"params":[{},{},{}]}
where JSON object in array is a request {"svc":"...","params":{...}}

Example

https://hst-api.wialon.com/wialon/ajax.html?svc=core/batch&sid=026499c89bc755056c401314b35bfa9f&params={"params":[{"svc":"events/load","params":{"ivalType":1,"itemId":21728414,"timeFrom":1609718400,"timeTo":1609891199,"detectors":[{"type":"trips","filter1":0}]}},{"svc":"events/get","params":{"selector":{"type":"trips","timeFrom":1609718400,"timeTo":1609891199,"detalization":1}}},{"svc":"events/get","params":{"selector":{"expr":"trips{s<1}","timeFrom":1609718400,"timeTo":1609891199,"detalization":1}}}],"flags":0}

The response will contain full trips (in example 5 full trips) and stops intervals (in example 6 intervals)

[{"events":{"trips":{"0":5}},"states":{"trips":{"updateTime":1606694400}},"selector":{}},{"trips":{"0":[{"from":{"t":1609740136,"y":46.8365631104,"x":-2.789290905},"to":{"t":1609740381,"y":46.3055648804,"x":-2.789290905},"m":1609740681,"f":2},{"from":{"t":1609747691,"y":46.3055648804,"x":-2.789290905},"to":{"t":1609748071,"y":43.3003921509,"x":-2.0059273243},"m":1609748385,"f":2},{"from":{"t":1609748558,"y":43.3003921509,"x":-2.0059273243},"to":{"t":1609748851,"y":43.4693832397,"x":-3.83861064911},"m":1609749180,"f":2},{"from":{"t":1609749642,"y":43.4693832397,"x":-3.83861064911},"to":{"t":1609750584,"y":43.3473701477,"x":-8.48857975006},"m":1609750884,"f":2},{"from":{"t":1609753417,"y":43.3473701477,"x":-8.48857975006},"to":{"t":1609754439,"y":42.4268341064,"x":-8.6491394043},"m":1609754768,"f":2}]}},{"trips":{"0":[{"from":{"t":1609740321,"y":46.3055648804,"x":-2.789290905},"to":{"t":1609740351,"y":46.3055648804,"x":-2.789290905},"m":0,"f":0},{"from":{"t":1609747781,"y":46.2055625916,"x":-2.98929095268},"to":{"t":1609747981,"y":43.3233222961,"x":-2.00242733955},"m":0,"f":0},{"from":{"t":1609748041,"y":43.3003921509,"x":-2.0059273243},"to":{"t":1609748041,"y":43.3003921509,"x":-2.0059273243},"m":0,"f":0},{"from":{"t":1609748588,"y":43.3103904724,"x":-2.0059273243},"to":{"t":1609748822,"y":43.4533843994,"x":-3.83861064911},"m":0,"f":0},{"from":{"t":1609750500,"y":43.3473701477,"x":-8.40155792236},"to":{"t":1609750500,"y":43.3473701477,"x":-8.40155792236},"m":0,"f":0},{"from":{"t":1609753595,"y":42.4268341064,"x":-8.6491394043},"to":{"t":1609754408,"y":42.4268341064,"x":-8.6491394043},"m":0,"f":0}]}}]

If you need to load trips from new interval, you need to execute request svc=events/unload, then load new intervals.

Diana Cheley
Wialon Hosting Expert
Gurtam
58

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Diana wrote:

Hello!

There is not parking intervals in response.
You can get only trips, and trips with less speed (stops).
The parkings are calculated as difference between trips time.

First load, then get all full trips, and then get trips intervals (with speed less) as stops.

https://hst-api.wialon.com/wialon/ajax.html?svc=events/load&params={"ivalType":1,"itemId":21728414,"timeFrom":1609718400,"timeTo":1609891199,"detectors":[{"type":"trips","filter1":0}]}&sid=026499c89bc755056c401314b35bfa9f
https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"type":"trips","timeFrom":1609718400,"timeTo":1609891199,"detalization":1}}&sid=026499c89bc755056c401314b35bfa9f
https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"expr":"trips{s<1}","timeFrom":1609718400,"timeTo":1609891199,"detalization":1}}&sid=026499c89bc755056c401314b35bfa9f

All 3 requests can be execute at one svc=core/batch

Format like
https://hst-api.wialon.com/wialon/ajax.html?svc=core/batch&sid=026499c89bc755056c401314b35bfa9f&params={"params":[{},{},{}]}
where JSON object in array is a request {"svc":"...","params":{...}}

Example

https://hst-api.wialon.com/wialon/ajax.html?svc=core/batch&sid=026499c89bc755056c401314b35bfa9f&params={"params":[{"svc":"events/load","params":{"ivalType":1,"itemId":21728414,"timeFrom":1609718400,"timeTo":1609891199,"detectors":[{"type":"trips","filter1":0}]}},{"svc":"events/get","params":{"selector":{"type":"trips","timeFrom":1609718400,"timeTo":1609891199,"detalization":1}}},{"svc":"events/get","params":{"selector":{"expr":"trips{s<1}","timeFrom":1609718400,"timeTo":1609891199,"detalization":1}}}],"flags":0}

The response will contain full trips (in example 5 full trips) and stops intervals (in example 6 intervals)

[{"events":{"trips":{"0":5}},"states":{"trips":{"updateTime":1606694400}},"selector":{}},{"trips":{"0":[{"from":{"t":1609740136,"y":46.8365631104,"x":-2.789290905},"to":{"t":1609740381,"y":46.3055648804,"x":-2.789290905},"m":1609740681,"f":2},{"from":{"t":1609747691,"y":46.3055648804,"x":-2.789290905},"to":{"t":1609748071,"y":43.3003921509,"x":-2.0059273243},"m":1609748385,"f":2},{"from":{"t":1609748558,"y":43.3003921509,"x":-2.0059273243},"to":{"t":1609748851,"y":43.4693832397,"x":-3.83861064911},"m":1609749180,"f":2},{"from":{"t":1609749642,"y":43.4693832397,"x":-3.83861064911},"to":{"t":1609750584,"y":43.3473701477,"x":-8.48857975006},"m":1609750884,"f":2},{"from":{"t":1609753417,"y":43.3473701477,"x":-8.48857975006},"to":{"t":1609754439,"y":42.4268341064,"x":-8.6491394043},"m":1609754768,"f":2}]}},{"trips":{"0":[{"from":{"t":1609740321,"y":46.3055648804,"x":-2.789290905},"to":{"t":1609740351,"y":46.3055648804,"x":-2.789290905},"m":0,"f":0},{"from":{"t":1609747781,"y":46.2055625916,"x":-2.98929095268},"to":{"t":1609747981,"y":43.3233222961,"x":-2.00242733955},"m":0,"f":0},{"from":{"t":1609748041,"y":43.3003921509,"x":-2.0059273243},"to":{"t":1609748041,"y":43.3003921509,"x":-2.0059273243},"m":0,"f":0},{"from":{"t":1609748588,"y":43.3103904724,"x":-2.0059273243},"to":{"t":1609748822,"y":43.4533843994,"x":-3.83861064911},"m":0,"f":0},{"from":{"t":1609750500,"y":43.3473701477,"x":-8.40155792236},"to":{"t":1609750500,"y":43.3473701477,"x":-8.40155792236},"m":0,"f":0},{"from":{"t":1609753595,"y":42.4268341064,"x":-8.6491394043},"to":{"t":1609754408,"y":42.4268341064,"x":-8.6491394043},"m":0,"f":0}]}}]

If you need to load trips from new interval, you need to execute request svc=events/unload, then load new intervals.

Hi, thanks for the reply this works

but still, there is wrong location data on the map of the parking and stop comparing with webpenal

All data under s>1 consider as stop with less than 5 min different

As we compare with backend penal and mobile few locations consider as parking is considered as stop in the mobile.

1)i have attached a file of the response

2) screenshot of the web model with stop and parking

3) Mobile same request data with stop and parking

which condition would make can get same stop and parking location as web track on the map

Post's attachments

Attachment icon Platinum till 6pm.docx 14.81 kb, 55 downloads since 2021-01-07 

59

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello, trushal.shah

There are used different algorithms (Real-time Data Processing vs Processing Messages from the Database upon Request)  to proceed data via events (for example, Wialon mobile app) and Tracks on web site,
More about it here https://docs.wialon.com/en/hosting/user/data/data.  The results depends on the unit data - how it sends, what parameters and etc.

Unfortunately, it's hard to understand what's wrong on screenshot. Please provide a full request which you execute to get trips / stops data and a real location with time intervals of stops for unit.

Diana Cheley
Wialon Hosting Expert
Gurtam
60

How to get Unit Last update date and time

(edited by trushal.shah 12/01/2021 16:09:09)

Re: How to get Unit Last update date and time

Diana wrote:

Hello, trushal.shah

There are used different algorithms (Real-time Data Processing vs Processing Messages from the Database upon Request)  to proceed data via events (for example, Wialon mobile app) and Tracks on web site,
More about it here https://docs.wialon.com/en/hosting/user/data/data.  The results depends on the unit data - how it sends, what parameters and etc.

Unfortunately, it's hard to understand what's wrong on screenshot. Please provide a full request which you execute to get trips / stops data and a real location with time intervals of stops for unit.

Hello

thanks for the reply,

Sure i will do share more details with API call, response and mobile view with webview

In the share screenshots different is that

all location which we get as stop in the API are considered as Parking in the web,

so just want to know how we can get parking data stop data from the API

do we need to add any type like ignition?

61

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

When data are get via events(or in reports proceeded), there is not parking or stops events type, only trips (motion) detected by unit Trip Detector
The parkings/stops system is calculated additionally (you cannot get them via some API) :

The parkings are intervals between trips
For example   1st trip - 10:20 - 11:20
2nd trip  11:50 - 12:30
So the parking is 11:20 - 11:50

The stops are intervals inside trips where the speed is less then value Min moving speed.
For example, 1st trips - 10:20 - 11:20  where speed is less than 1 km/h (default value Min moving speed)  in messages from 10:21 till 10:24, so 3 minutes is stop.

Diana Cheley
Wialon Hosting Expert
Gurtam
62

How to get Unit Last update date and time

(edited by trushal.shah 22/01/2021 10:15:47)

Re: How to get Unit Last update date and time

Hello

I do send this message to get track data of the unit same as wialon page

same as the first image and the second image

but we are struggling to get data. we applied the same login you suggest getting between time data

its not sufficient to get the same data as the web does we if we apply s<1 then we are getting all the stops which are not there in the website

below is API call we done


APi URL:

Dates select 11/01/2021 to 12/01/2021 and unit id as 11489

http://gps.tawasolmap.com/wialon/ajax.html?svc=core/batch&sid=bdfabd36adfb22323b0a292ceb799ed5&params={"params":[{"svc":"events/load","params":{"ivalType":1,"itemId":11489,"timeFrom":1609439400,"timeTo":1609525799,"detectors":[{"type":"trips","filter1":0},{"type":"ignition","filter1":0}]}},{"svc":"events/get","params":{"selector":{"type":"trips","timeFrom":1609439400,"timeTo":1609525799,"detalization":11}}},{"svc":"events/get","params":{"selector":{"expr":"trips{s<1}","timeFrom":1609439400,"timeTo":1609525799,"detalization":11}}}],"flags":0}

let me know token required

and also I have attached result we from API call

check attached images that we need same stop and parking would display as wialon web/track page has

Please help me with this would much appreciate

Post's attachments

Attachment icon Platinum till 6pm.docx 14.81 kb, 60 downloads since 2021-01-22 

63

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

The same different time interval in request  and on screenshot.
"timeFrom":1609439400,"timeTo":1609525799 :
Thu, 31 Dec 2020 18:30:00 +0000
Fri, 01 Jan 2021 18:29:59 +0000 

On screenshot Jan 6, 00:00-18:00 (regarding users timezone).

You write about other dates Dates select 11/01/2021 to 12/01/2021

Sure you can get different result on different intervals.

You can open Developer Console and look which time(from/to) is passed in request to get track data.

Diana Cheley
Wialon Hosting Expert
Gurtam
64

How to get Unit Last update date and time

(edited by trushal.shah 01/02/2021 16:05:20)

Re: How to get Unit Last update date and time

Hello

if you can please help me that what would be the format of the URL to send push notification on engine On and Off


{
    "t":"push_messages",    /* action type */
    "p":{
        "url":<text>,        /* server name (port may be defined), start it with "http(s)" */
        "get":<bool>        /* request type: 1 - GET, 0 - POST */       
    }
}

this is what I have set but not getting a notification
https://localhost.ip/front/api/v1/send_push?user=username&msg='Hello'

Do we need to attache message to send push, ot Wialon server would send same which we had set on the text

65

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

trushal.shah wrote:

Hello

if you can please help me that what would be the format of the URL to send push notification on engine On and Off


{
    "t":"push_messages",    /* action type */
    "p":{
        "url":<text>,        /* server name (port may be defined), start it with "http(s)" */
        "get":<bool>        /* request type: 1 - GET, 0 - POST */       
    }
}

this is what I have set but not getting a notification
https://localhost.ip/front/api/v1/send_push?user=username&msg='Hello'

Do we need to attach a message to send push, to Wialon server would send the same which we had set on the text


Hello Diana

if you can please help me in this its working with fire notification from firebase with the below URL

https://serverURL/front/api/v1/send_push?user=brainvire1

Method:  GET

But I am not getting from penal which saws fire of few notifications

66

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

trushal.shah wrote:

Hello

if you can please help me that what would be the format of the URL to send push notification on engine On and Off


{
    "t":"push_messages",    /* action type */
    "p":{
        "url":<text>,        /* server name (port may be defined), start it with "http(s)" */
        "get":<bool>        /* request type: 1 - GET, 0 - POST */       
    }
}

this is what I have set but not getting a notification
https://localhost.ip/front/api/v1/send_push?user=username&msg='Hello'

Do we need to attache message to send push, ot Wialon server would send same which we had set on the text

Hello!

The URL for server is specified path with end point by which the GET/POST request from Wialon will be proceeded.
For example , at my server there is file php which proceeds GET request with some parameters , so at notification as URL I have specified the path to this file.
{t: "push_messages", p: {get: "1", url: "http://dinacheley.com/notif/index.php"}}
The parameters for GET/POST request are specified in notification text  as param1=some_value&param2=%some_wialon_tag%&.....
The parameters name/value  can be different.

Diana Cheley
Wialon Hosting Expert
Gurtam
67

How to get Unit Last update date and time

(edited by trushal.shah 10/02/2021 08:59:28)

Re: How to get Unit Last update date and time

Hi, thanks for the replay this working fine, and we are getting notifications

But if I set the URL as this then getting as attached screenshot notification

https://localhost/front/api/v1/send_push?user=brainvire&msg=%UNIT%

and our requirement is to send message same

%UNIT% violated speed limitations. At %POS_TIME% it moved with speed %SPEED% near '%LOCATION%'.

How I can set this if you can please guide me

68

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hi!

If you need to get  a full string as text messages,  you can specify at notification (notification's text)  parameter with JSON object
For example,  msg={"spec":"%UNIT% unit and so on %some_other_wialon_tags%"}
So server should get parameter 'msg' with JSON value, and parse this JSON

Diana Cheley
Wialon Hosting Expert
Gurtam
69

How to get Unit Last update date and time

(edited by trushal.shah 18/02/2021 14:08:55)

Re: How to get Unit Last update date and time

Diana wrote:

Hi!

If you need to get  a full string as text messages,  you can specify at notification (notification's text)  parameter with JSON object
For example,  msg={"spec":"%UNIT% unit and so on %some_other_wialon_tags%"}
So server should get parameter 'msg' with JSON value, and parse this JSON


Thanks for the update

the issue is with Notification text with space is not working

"txt":"Helllo UNITName%UNIT%Current_Location: %LOCATION%Current_Time%CURR_TIME%"


Notification got just Hello text rest of the message skip due to space, if we have remove all space then its working

like this "txt":"HellloUNITName%UNIT%Current_Location:%LOCATION%Current_Time%CURR_TIME%"

check the attached screenshot

70

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

trushal.shah wrote:
Diana wrote:

Hi!

If you need to get  a full string as text messages,  you can specify at notification (notification's text)  parameter with JSON object
For example,  msg={"spec":"%UNIT% unit and so on %some_other_wialon_tags%"}
So server should get parameter 'msg' with JSON value, and parse this JSON


Thanks for the update

the issue is with Notification text with space is not working

"txt":"Helllo UNITName%UNIT%Current_Location: %LOCATION%Current_Time %CURR_TIME%"


Notification got just Hello text rest of the message skip due to space, if we have remove all space then its working

like this "txt":"HellloUNITName%UNIT%Current_Location:%LOCATION%Current_Time %CURR_TIME%"

check the attached screenshot

Hello!

Try to type  URL-encoding %20  instead space

Diana Cheley
Wialon Hosting Expert
Gurtam
71

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Diana wrote:
trushal.shah wrote:
Diana wrote:

Hi!

If you need to get  a full string as text messages,  you can specify at notification (notification's text)  parameter with JSON object
For example,  msg={"spec":"%UNIT% unit and so on %some_other_wialon_tags%"}
So server should get parameter 'msg' with JSON value, and parse this JSON


Thanks for the update

the issue is with Notification text with space is not working

"txt":"Helllo UNITName%UNIT%Current_Location: %LOCATION%Current_Time %CURR_TIME%"


Notification got just Hello text rest of the message skip due to space, if we have remove all space then its working

like this "txt":"HellloUNITName%UNIT%Current_Location:%LOCATION%Current_Time %CURR_TIME%"

check the attached screenshot

Hello!

Try to type  URL-encoding %20  instead space

thanks for the reply but still looks its skip the notification text with space, even from penal also

txt: UNITName: %UNIT% Current_Location: %LOCATION% Current_Time %CURR_TIME%

encode text: UNITName%20%25UNIT%25%20Current_Location%20%25LOCATION%25%20Current_Time%20%25CURR_TIME%25

But still its skip with space

72

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

As I said before, it's better to send text as JSON parameter string type, i.e notification text is like paramName={"spec":"%UNIT% unit and so on %some_other_wialon_tags% some text with spaces"}
Sure the server should parse parameter paramName as JSON

In any case you should look through server parsing which get message from Wialon.
For example, our push server parse  any text from Wialon notifications, and users get the same text on mobile as in web interface.

Diana Cheley
Wialon Hosting Expert
Gurtam
73

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Diana wrote:

Hello!

As I said before, it's better to send text as JSON parameter string type, i.e notification text is like paramName={"spec":"%UNIT% unit and so on %some_other_wialon_tags% some text with spaces"}
Sure the server should parse parameter paramName as JSON

In any case you should look through server parsing which get message from Wialon.
For example, our push server parse  any text from Wialon notifications, and users get the same text on mobile as in web interface.

Thanks for the support

review with both option but getting error

Normal URL

"act":[{"t":"push_messages","p":{"url":"https://tawasoul.brainvire.dev/front/api/v1/send_push?user=brainvire&msg=","get":1}}],"txt":{"spec":"%UNIT%"}



After encode
"act":[{"t":"push_messages","p":{"url":"https%3A%2F%2Ftawasoul.brainvire.dev%2Ffront%2Fapi%2Fv1%2Fsend_push%3Fuser%3Dbrainvire%26msg%3D","get":1}}],"txt":%7B%22spec%22%3A%22%25UNIT%25%7D,



Both case its not working

getting error

    "error": 4,
    "reason": "VALIDATE_PARAMS_ERROR: {n: text, txt: text, ta: uint, td: uint, ma: uint, mmtd: uint, cdt: uint, mast: uint, mpst: uint, cp: uint, fl: uint, tz: int, la: text, un: [long], sch: {f1: ushort, f2: ushort, t1: ushort, t2: ushort, m: uint, y: uint, w: uint}, trg: {t: text, p: {}}, act: [{t: text, p: {}}]}"
}

74

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

When you change notification , you need to send all parameters, not only changed.
Also the parameter "txt" value should be string, not object, so it needs ""

For example,

{"n":"dinacheley","ta":1614027600,"td":0,"tz":134228528,"la":"ru","ma":0,"sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"ctrl_sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0,"fl":0},"un":[20685653,21728414],"trg":{"t":"outage","p":{"type":"0","time":60,"check_restore":1}},"d":"","act":[{"t":"push_messages","p":{"url":"https://tawasoul.brainvire.dev/front/api/v1/send_push?user=brainvire&msg=","get":1}}],"txt":"{\"spec\":\"%UNIT%\"}","fl":0,"mast":0,"mpst":0,"cdt":0,"mmtd":3600,"cp":0,"id":124,"itemId":930849,"callMode":"update"}

Diana Cheley
Wialon Hosting Expert
Gurtam
75

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello

How I can get running vehicle latest details in the below API

https://sdk.wialon.com/wiki/en/kit/remo … vents/load

like if the vehicle as in the parking then getting proper data of the duration of movement

but if in the running mode then also getting last parked data  not currently running data, if you can help me which flag i should add to get the latest running data with below API

Below post data i am using

{"params":[{"svc":"events\/load","params":{"detectors":[{"filter1":0,"type":"trips"}],"timeTo":1616092199,"ivalType":1,"timeFrom":1616005800,"itemId":65788}},{"svc":"events\/get","params":{"selector":{"detalization":11,"type":"*","timeFrom":1616005800,"timeTo":1616092199}}},{"svc":"events\/get","params":{"selector":{"timeFrom":1616005800,"detalization":11,"expr":"trips{s<1}","timeTo":1616092199}}}],"flags":0}&sid=fd3b1aff8d623662dfdd038effd7ab25
76

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

The requests events/load and events/get are used to get history events (trips, sensors, ignition , fuel thefts/fillings/consumption) which already registered in system
More - https://forum.gurtam.com/viewtopic.php? … 16#p186716

If you need to get current data, when unit is running online, you need to get use the following requests
https://sdk.wialon.com/wiki/en/sidebar/ … date_units - add units to session and specify event's detector
https://sdk.wialon.com/wiki/en/sidebar/ … ck_updates - execute request periodically to get data
See my previous answer - https://forum.gurtam.com/viewtopic.php? … 05#p183805

Diana Cheley
Wialon Hosting Expert
Gurtam
77

How to get Unit Last update date and time

(edited by trushal.shah 26/04/2021 15:59:43)

Re: How to get Unit Last update date and time

Hello

Can you help me with how I can execute this command [start engine"]?

http://localhost/wialon/ajax.html?svc=unit/exec_cmd&params={"itemId":11489,"commandName":"custom_msg","linkType":"tcp,vrt","param":"","timeout":1,"flags":0}&sid=04dfaf9bcf913b6fca84e821fb220b11

{
    "error": 5
}

"cml": {
                "1": {
                    "id": 1,
                    "n": "start engine",
                    "c": "custom_msg",
                    "l": "",
                    "p": "Juste un exemple",
                    "a": 1,
                    "f": 0
                },
                "2": {
                    "id": 2,
                    "n": "stop engine",
                    "c": "custom_msg",
                    "l": "",
                    "p": "stop engine",
                    "a": 1,
                    "f": 0
                },
                "3": {
                    "id": 3,
                    "n": "أمر جديد",
                    "c": "custom_msg",
                    "l": "tcp",
                    "p": "",
                    "a": 1,
                    "f": 0
                }
            },

78

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

When you execute command you need to pass the same parameters which original command has, like link type, commandName and etc.

In your example,
"n": "start engine" - commandName
"l": "" - link type (empty value means 'Auto')
"p": "Juste un exemple" - specified parameters

So you need to execute request unit/exec_cmd with the following parameters

"params":{"itemId":11489,"commandName":"start engine","linkType":"","param":"Juste un exemple","timeout":1,"flags":0}
Diana Cheley
Wialon Hosting Expert
Gurtam
79

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Diana wrote:

Hello!

When you execute command you need to pass the same parameters which original command has, like link type, commandName and etc.

In your example,
"n": "start engine" - commandName
"l": "" - link type (empty value means 'Auto')
"p": "Juste un exemple" - specified parameters

So you need to execute request unit/exec_cmd with the following parameters

"params":{"itemId":11489,"commandName":"start engine","linkType":"","param":"Juste un exemple","timeout":1,"flags":0}

Hi thanks for the reply if I set this with APi i am getting "

Unrecognized:JUSTE un example"

and same from penal got this message

Command 'start engine' sent to unit 'Platinum'.

params={"itemId":11489,"commandName":"start engine","linkType":"","param":"TawasolMap","timeout":1,"flags":0}&sid=09fff31a9820105727644773ba146a80

80

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hi!

The device send this response to your command as I see on your screenshot, because there is not correct parameter 'Juste un exemple' for command. You need to send command (create command before for unit) with correct parameter for certain command. Please look to device's manual or request to manufacturer  which parameters are correct for this command type.
Maybe here on forum - https://forum.gurtam.com/viewforum.php?id=18  you can find helpful information

Diana Cheley
Wialon Hosting Expert
Gurtam
81

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hi,

Thanks for the reply now it's working for us

I just want to know how I can display Map on the report please check below API request

{svc=report/export_result, params={"format":2,"pageOrientation":"portrait","pageSize":"a4","pageWidth":0,"coding":"utf8","delimiter":"semicolon","headings":0,"compress":0,"attachMap":1,"extendBounds":0,"hideMapBasis":0,"outputFileName":"eabdalmnem_30-04-2021"}, sid=d628a7f4e54b4cb31c928154b234cbb8}

I had reviewed with hideMapBasis hide map layer: 0 - no, 1 - yes

"extendBounds":0
"hideMapBasis":1

"extendBounds":1
"hideMapBasis":1

"extendBounds":1
"hideMapBasis":0

extendBounds=0
hideMapBasis=0

Please find both files different only is right of the screenshot with map and left is without map.

82

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello

I need your 2 bits of help

1. Above request how to display Map background on the report

2. How to get sensor engine operation value in the check_updates API

From search_item API we got all sens value check_updates API

"sens": {
                "1": {
                    "id": 1,
                    "n": "حالة المحرك",
                    "t": "engine operation",
                    "d": "",
                    "m": "On/Off",
                    "p": "adc1",
                    "f": 0,
                    "c": "{\"act\":0,\"appear_in_popup\":true,\"ci\":{},\"mu\":0,\"pos\":1,\"show_time\":false,\"timeout\":0,\"uct\":0,\"unbound_code\":\"\",\"validate_driver_unbound\":0,\"consumption\":2}",
                    "vt": 1,
                    "vs": 0,
                    "tbl": []
                },
                "2": {
                    "id": 2,
                    "n": "الكهرب",
                    "t": "voltage",
                    "d": "",
                    "m": "V",
                    "p": "pwr_int",
                    "f": 0,
                    "c": "{\"act\":1,\"appear_in_popup\":true,\"ci\":{},\"cm\":0,\"mu\":\"0\",\"pos\":2,\"show_time\":false,\"timeout\":0,\"uct\":0}",
                    "vt": 1,
                    "vs": 0,
                    "tbl": []
                }


I am looking for same value from update_unit API how i can get, i do get but I got a second sensor not first


svc=events/update_units&params={"mode":"add","units":[{"id":11489,"detect":{"sensors":0}}]}&sid=c0816af7dfa8862ae026cf4a1499f2d8


svc=events/check_updates&params={"detalization":3}&sid=9e0f2c649220ff65229c68a56de69f3e


"11489": [
        {
            "sensors": {
                "2": {
                    "from": {
                        "t": 1615747447,
                        "y": 24.7718658447,
                        "x": 46.633014679
                    },
                    "to": {
                        "t": 1620026997,
                        "y": 24.7718448639,
                        "x": 46.6330413818
                    },
                    "m": 1620026997,
                    "f": 0,
                    "type": 4,
                    "value": 4.141
                }
            }
        }
    ]
}

83

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

1. If you need to attach map to the exported PDF file, you need to pass parameter "attachMap":1, "hideMapBasis":0

"hideMapBasis":1 means tracks and markers are shown on the blank background
"extendBounds":1 means option Squeeze in all graphics

For example, parameters for request  report/export_result

{"compress":0,"attachMap":1,"hideGoogleLinks":0,"extendBounds":0,"hideMapBasis":0,"pageOrientation":"landscap","pageSize":"a4","pageWidth":"0","coding":"utf8","delimiter":"semicolon","headings":1,"outputFileName":"Volvo_awesome_!gtest_Eco_driving_03-05-2021_14-38-20","format":2}

2.The sensor engine operation is not included to 'sensors' event detector.  To get data from this sensor type you need to get event type 'ignition'
So instead detector 'sensors' in request events/update_units just add detect 'ignition' - "detect":{"ignition":0} or "detect":{"ignition":1} as you already know the sensor id.

Diana Cheley
Wialon Hosting Expert
Gurtam
84

How to get Unit Last update date and time

(edited by trushal.shah 11/05/2021 17:51:15)

Re: How to get Unit Last update date and time

Hello Thanks for the reply it's working fine


to add the unit to get the update we set this API as per your suggestion and its working fine when we have small[20] set of units

but when I have 500 units then we get error

1.{"id":11489,"detect":{"ignition":0,"sensors":0}}
2.{"id":11499,"detect":{"ignition":0,"sensors":0}}
.
.
.
500 .{"id":11989,"detect":{"ignition":0,"sensors":0}}




<head>
    <title>414 Request-URI Too Large</title>
</head>


events/update_units&params={"mode":"add","units":[{"id":11489,"detect":{"ignition":0,"sensors":0}}]}&sid=75252dc521f0c23fd8be8085452bd6ff

85

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

First make sure that you perform POST request. There is basic limit to length of URL.
Also I think to monitor at one time all 500 units is quite complicated, even just to get information about all 500 units on one screen  (specially mobile screen). So if in your app the units visualization are divided on several blocks (parts, pages) you can request to add units into session sequentially, if necessary.

Diana Cheley
Wialon Hosting Expert
Gurtam
86

How to get Unit Last update date and time

(edited by trushal.shah 22/06/2021 12:44:45)

Re: How to get Unit Last update date and time

Hello,

How I can get the last movement of the vehicle, i am not getting the last movement if any vehicle is running so i can display on the map.

for i.e my last trip was 2 PM after in parking, next i started at 6 PM and my car running so i could not get 6 PM running data till its moves as parking

can you please help me on this....

core/batch&params={"params":[{"svc":"events\/load","params":{"ivalType":1,"itemId":55873,"timeFrom":1623954600,"timeTo":1624040999,"detectors":[{"type":"trips","filter1":0}]}},{"svc":"events\/get","params":{"selector":{"type":"*","timeFrom":1623954600,"timeTo":1624040999,"detalization":11}}},{"svc":"events\/get","params":{"selector":{"type":"*","expr":"trips{s<1}","timeFrom":1623954600,"timeTo":1624040999,"detalization":11}}}],"flags":0}&sid=47a5b1d3697adb0fe149fb7a3c086559

87

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hi!

You can use the several ways :

1) Just get the last message from request search item(s) with flag = 1024,     last message and position
Flags - https://sdk.wialon.com/wiki/en/sidebar/ … ormat/unit
Search item(items) - https://sdk.wialon.com/wiki/en/sidebar/ … les/search

2) To get current event (trip or stop) via requests events/update_units & events/check_updates  (not events/load,  it's used only to get history data) - https://sdk.wialon.com/wiki/en/sidebar/ … ck_updates
https://sdk.wialon.com/wiki/en/sidebar/ … date_units
Here more useful information (webinar) how to work with these requests (methods event) - https://www.youtube.com/watch?v=nUtNS5Al5wo

Diana Cheley
Wialon Hosting Expert
Gurtam
88

How to get Unit Last update date and time

(edited by trushal.shah 24/06/2021 17:28:13)

Re: How to get Unit Last update date and time

Thanks for update

The query is above API will get the vehicle's last location.

e.t my last trip ends at 2 PM and I have started at 3 Pm new trip and continue

I can get till 2 PM all location of the vehicle but Runnin trips[All movement need to display at Map] i am not sure how i can get 
with

can we made any cane in load / get trip data API

like till last message movement data on map

Please find attach the request

89

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hi!

yes, you can get current trip via events requests - events/check_updates
where in JSON response in 'to' you will get the last coordinates

"to": {
            "t":<uint>,    /* time (UNIX-time) */
            "y":<double>,    /* latitude */
            "x":<double>    /* longitude */
        }

For example

1. Add unit to session - https://sdk.wialon.com/wiki/en/sidebar/ … date_units
events/update_units

params
{"mode":"add","units":[{"id":21728414,"detect":{"trips":0,"sensors":0}}]}

2. Execute request check_updates
events/check_updates

params {"detalization":3}

In response we get current trip  which starts at 1624876649   Jun 28 2021 13:37:29 GMT+03
"state": 1 means that the trip is going  ( /* state: 0 - parking, 1 - trip, 2 - stop */ )
the last message and location in parameter 'to'

"trips": {
                "from": {
                    "t": 1624876649,
                    "y": 53.4268836975,
                    "x": 27.9888801575
                },
                "to": {
                    "t": 1624877580,
                    "y": 53.4268836975,
                    "x": 27.9888801575
                },
                "m": 1624877580,
                "f": 2,
                "state": 1,
                "max_speed": 23,
                "curr_speed": 23,
                "avg_speed": 0,
                "distance": 0,
                "odometer": 2147483648,
                "course": 90,
                "altitude": 90,
                "pos_flags": 0
            }

3 Again execute events/check_updates and get the new data:
updated last position and time in parameter 'to'
the "state": 1 , so the trip is still going


 "trips": {
                "from": {
                    "t": 1624876649,
                    "y": 53.4268836975,
                    "x": 27.9888801575
                },
                "to": {
                    "t": 1624877925,
                    "y": 51.4268836975,
                    "x": 27.9888801575
                },
                "m": 1624877925,
                "f": 2,
                "state": 1,
                "max_speed": 120,
                "curr_speed": 120,
                "avg_speed": 628,
                "distance": 222553,
                "odometer": 2147483648,
                "course": 90,
                "altitude": 90,
                "pos_flags": 0
            }
        }
Diana Cheley
Wialon Hosting Expert
Gurtam
90

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Thanks for the update

yes, this I do use to display running car on the map and its movement

but here I need to display his all past and current running movement on the Map

e.g I started my vehicle at 6 AM and I moves to continue for 5 hours, till 11 AM

and in between if I want to see his trip all position on the Map from 6 to 8 and still vehicle is moving,

91

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

trushal.shah wrote:

Thanks for the update

yes, this I do use to display running car on the map and its movement

but here I need to display his all past and current running movement on the Map

e.g I started my vehicle at 6 AM and I moves to continue for 5 hours, till 11 AM

and in between if I want to see his trip all position on the Map from 6 to 8 and still vehicle is moving,

Hello!

In this case to get all messages from event you can pass digitalization  flags 16 plus 8 , for example total  "detalization":25

The response

"msgs":[{"tm":1454479860,"x":38.4273986816,"y":65.6319351196,"z":30,"c":18,"m":0,"s":10}...], // all messages
"track":"qvqoKejpiFkG??mIaAlI?{Sg^zSyS?"}} // track in Google notation https://developers.google.com/maps/docu … ineutility

Diana Cheley
Wialon Hosting Expert
Gurtam