Hi!
Before get sensor's values it needs to load required raw messages to message loader :
Execute request svc=messages/load_interval to load messages from interval or svc=messages/load_last to load last messages.
After you can execute request svc=unit/calc_sensonrs with empty source paramter "source":"" (please note - without any space in value) as messages are put from message loader directly.
For example,
https://hst-api.wialon.com/wialon/ajax.html?svc=messages/load_interval¶ms={"itemId":135,"timeFrom":1583010000,"timeTo":1584392399,"flags":1,"flagsMask":65281,"loadCount":3}&sid=029b7fbf397b30239da8a43332fbc49d
response - fisrt 3 messages
{"count":6915,"messages":[{"t":1583232345,"f":1073741825,"tp":"ud","pos":{"y":53.9057559,"x":27.456982,"c":295,"z":315,"s":8,"sc":8},"lc":0,"rt":1583232413,"p":{"pass":"15","pass_index":0,"a":25.5520000458}},{"t":1583232345,"f":1073741825,"tp":"ud","pos":{"y":53.9057478,"x":27.4570056,"c":290,"z":315.5,"s":6,"sc":8},"lc":0,"rt":1583232413,"p":{"pass":"15","pass_index":0,"a":25.3220005035}},{"t":1583232348,"f":1073741825,"tp":"ud","pos":{"y":53.9057735,"x":27.4569488,"c":278,"z":315,"s":0,"sc":8},"lc":0,"rt":1583232413,"p":{"pass":"15","pass_index":0,"a":25.954000473}}]}
get sensors from 2 first messages
https://hst-api.wialon.com/wialon/ajax.html?svc=unit/calc_sensors¶ms={"source":"","indexFrom":0,"indexTo":1,"unitId":135,"sensorId":0}&sid=029b7fbf397b30239da8a43332fbc49d
responce
[{"1":8,"2":0,"3":0,"4":-348201.3876,"5":25.5520000458,"6":0,"7":0,"8":0,"9":0,"10":1583232345,"11":295,"12":315,"13":-348201.3876,"14":-348201.3876,"15":0,"16":-348201.3876,"17":-348201.3876,"18":1583232413,"19":-348201.3876,"20":-348201.3876,"21":25.5520000458,"22":25.5520000458},{"1":6,"2":0,"3":0,"4":-348201.3876,"5":25.3220005035,"6":0,"7":0,"8":0,"9":0,"10":1583232345,"11":290,"12":315.5,"13":-348201.3876,"14":-348201.3876,"15":0,"16":-348201.3876,"17":-348201.3876,"18":1583232413,"19":-348201.3876,"20":-348201.3876,"21":25.3220005035,"22":25.3220005035}]
Diana Cheley
Wialon Hosting Expert
Gurtam