1

Execute commads via remote API (tcp opton)

(17/12/2013 20:30:58 отредактировано gchumbes)

Тема: Execute commads via remote API (tcp opton)

hi, we are trying to execute commands (send commands) via remote API and we got error 4, we send following sentence:

:https://hst-api.wialon.com/wialon/ajax.html?svc=unit/exec_cmd&params={"itemId":7004974,"commandName":"custom_msg","linkType":"tcp","param":"SSSXP11","timeout":10,"flags":0}&sid=b31d80f53b6dc6b7649f2dd69672302a

but we received error 4 (i understand is input error), do we have any syntax problem? we use custom_msg.

any suggestion would be very helpfull


regards

Gustavo Chumbes

2

Execute commads via remote API (tcp opton)

Re: Execute commads via remote API (tcp opton)

I have no idea  what the problem is. You can write me a personal message and point login and password for checking this request.

Development Department
Gurtam
3

Execute commads via remote API (tcp opton)

Re: Execute commads via remote API (tcp opton)

Currently we have exactly the the same problem. Everything else over API works but not execution of the commands. We have checked everything like permissions etc but I think this is something else that we can not really find what it is.

gchumbes, have you solved the problem and could you please post what was the problem?

Maybe Gurtam guys know how to solve this error: 4 issue while executing commands over API?

Thanks.

4

Execute commads via remote API (tcp opton)

Re: Execute commads via remote API (tcp opton)

gpser
To execute command you need only 2 request:
1) Create
2) Execute

Just tested and everything works well for me
Can you provide a little bit more information about your problem?

5

Execute commads via remote API (tcp opton)

(11/01/2016 10:48:22 отредактировано gpser)

Re: Execute commads via remote API (tcp opton)

We are not trying to first Create a command, we are executing it without prior creating any command. Do we need to create it first?

Well, we are trying to execute a command like this:
http://sdk.wialonpro.com/ajax.html?svc=unit/exec_cmd&params={"itemId":3798,"commandName":"Fall_Down_Alarm","linkType":"tcp","param":"123456F1","timeout":20,"flags":0}&ssid=4003231d4766a13d733b1c8dba72e6e2

К сожалению, у вас не достаточно прав для просмотра данного текста

Can you please give me example that you know should work? As parameter you can write anything just give us an example.

6

Execute commads via remote API (tcp opton)

Re: Execute commads via remote API (tcp opton)

Sorry, all my comments about Hosting

+ открыть спойлер

Logic is straightforward:
* create command once (using unit/update_command_definition)
* after creation execute it as many time as you want (using unit/exec_cmd). commandName should be same that you used
while command creation.

7

Execute commads via remote API (tcp opton)

Re: Execute commads via remote API (tcp opton)

It does not work!

Getting "error: 4" even while I am issuing command unit/update_command_definition

http://sdk.wialonpro.com/ajax.html?svc=unit/update_command_definition&params={"itemId":3798, "id":123, "callMode":"create", "n":"fall_alarm", "c":"custom_msg", "l":"tcp", "p":"123456F1", "a":"0xfffffffffffffff"}&ssid=3785df7e66b3a8fd14287bac7537415d

I didn't know what to write as id so I just typed 123. I don' know if this is needed during command creation?

8

Execute commads via remote API (tcp opton)

Re: Execute commads via remote API (tcp opton)

gpser, use unit/update_command_alias request in pro with your parameters.
Parameter id is ignored in creation mode.

Head of Wialon Local Department
Gurtam