FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
478 views 7 comments
by anonymous

Hi,

Currently I try to use teltonika RMS API https://wiki.teltonika-networks.com/view/RMS_API

I manage to get router information and do action like reboot through the API
but is there a way to set LAN config or DHCP config through the API? and also can we update router firmware through the API?

for update firmware I saw 1 API
/devices​/updates​/set, but here I need to put file id which I am not sure what to put, do I need to upload file to RMS first, get the ID and use that ID to update the firmware?

there is another one for device action
/devices/{id}/command, but I am not sure what kind of command I can put here?

Thank you

1 Answer

0 votes
by anonymous

Hello,

    

Currently, RMS API only supports changing the RMS configuration, and Device Configuration (Beta) feature is not yet implemented into the API.

/devices/{id}/command is used for sending the commands to be executed on the device shell. So this could be used to set the various settings until Device Configuration is implemented into the API. The status of the command execution can then be monitored using the Status API.

To update a device firmware using the RMS API, indeed, a firmware file needs to be uploaded, then it's ID can be found using /file. Then, this ID can be used to send this POST /devices/updates/set request:


{
    "data": [
        {
            "action""update_firmware",
            "file_id"<ID_from_/file>,
            "id"<device_ID>,
            "offline"false,
            "keep_settings"true
        }
    ]
}

This will return a message like this:

{
    "success"true,
    "meta": {
        "channel""private-status.yyyyyy.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    }
}

Then, using the Status API mentioned earlier, the update status can be monitored.

For testing purposes, I'd recommend using an application like Postman, and downloading the OpenAPI YAML reference file.

Let me know if any more information is needed!

  

Best regards,
DaumantasG

Best answer
by anonymous

Hi,

Thank you for your information

that mean with /devices/{id}/command i can use this to send multiple UCI set command to update the lan/dhcp settings?

by anonymous
Hello,

Correct. However, the device ID has to be specified, so a separate command would need to be used for each device.

 

Best regards,
DaumantasG
by anonymous
Great I will try this

 thanks a lot for your help
by anonymous
Let me know if any more help is needed!

Best regards,
DaumantasG
by anonymous

Hi,

I try to do UCI command on my TRB, but it is failed

when I try to do using CLI, I get UCI entry not found, and I can't find any etc/config too, do I need to do anything first?

by anonymous

Hello,

  

As the TRB1xx series of devices do not have WiFi, the wireless configuration does not exist. A full list of UCI options can be sound by running the command uci show. If you have something particular you'd like to look for, grep can be used in addition to the uci show:

uci show | grep apn

  

Best regards,
DaumantasG

by anonymous
Hi,

I tried it and can use the API to call all the UCI command

thank you so much for your help