0
Answered

Dynamic change network connection settings for AMX Controller

Рустем Зиятдинов 5 years ago in Products / AMX updated 5 years ago 2
Hello,
Is it possible to change network connection settings for AMX Controller using JS?
I need to set AMX Controller IP address based on information in the external database.

Answer

Answer
Answered
Dear Rustem,

The settings of connection to AMX are available for writing via scripts with the following construction:
IR.AddListener(IR.EVENT_START,0,function() 
{ 
    IR.GetDevice("AMX").SetParameters({ Host: "192.168.0.21", 
                                        Port: "12004", 
                                        DeviceID: "1", 
                                        Login: "admin", 
                                        Password: "12345"}); }); 
http://wiki2.iridiummobile.net/Drivers_API#SetParameters

The SetParameters function can activated not at start but after receiving data from the database. The host and port fields should be left empty in the driver settings so that initially the project wouldn't connect to any controller. The , конечно, можно вызвать не по старту, а после получения данных из базы.
The parameter HostIP from the driver tokens is not aailable for writing. The SetParameters function sets all connection parameters at once and you cannot change any of them, if you don't have a password. You need to indicate
Password: ""
There is an instruction for setting up connection parameters in the description of the АМХ driver. Besides commands from iRidium Script API you can use the AMX command Loopback Port. The principles of its work ans setting is not different from the ones for IR.SetParameters

Sincerely yours,

Olga Ermakova
iRidium mobile Team
Answer
Answered
Dear Rustem,

The settings of connection to AMX are available for writing via scripts with the following construction:
IR.AddListener(IR.EVENT_START,0,function() 
{ 
    IR.GetDevice("AMX").SetParameters({ Host: "192.168.0.21", 
                                        Port: "12004", 
                                        DeviceID: "1", 
                                        Login: "admin", 
                                        Password: "12345"}); }); 
http://wiki2.iridiummobile.net/Drivers_API#SetParameters

The SetParameters function can activated not at start but after receiving data from the database. The host and port fields should be left empty in the driver settings so that initially the project wouldn't connect to any controller. The , конечно, можно вызвать не по старту, а после получения данных из базы.
The parameter HostIP from the driver tokens is not aailable for writing. The SetParameters function sets all connection parameters at once and you cannot change any of them, if you don't have a password. You need to indicate
Password: ""
There is an instruction for setting up connection parameters in the description of the АМХ driver. Besides commands from iRidium Script API you can use the AMX command Loopback Port. The principles of its work ans setting is not different from the ones for IR.SetParameters

Sincerely yours,

Olga Ermakova
iRidium mobile Team