Disconnecting wireless network via API

Hi,

I’m trying to get wireless control of the RUT901 router via /wireless/actions/disconnect endpoint and every time i get response similart to this:

{“success”:false,“errors”:[{“source”:“sta_id”,“code”:103,“value”:“wifi1”,“error”:“Interface must be a station”,“section”:“disconnect”}]}

The thing is that i have no idea what to put in the sta_id, i have tried everything from device_ids, ssid, mac, network name, .. and can’t really seem to get it working. I tried searching docs and no mention of it either. Could someone please help me where can i get the sta_id from?

Thanks!

Tom

Hello,

Could you start by explaining what you mean by get wireless control?

Do you refer to:

  • Enabling/disabling wireless access point interface?
  • Managing client devices connected to the router’s wireless access point interface?
  • Connecting/disconnecting wireless client (station) interface?
  • Something else…

Best regards,

Hello,

sorry i should have been clearer with the quetsion i am using this API call:
https://developers.teltonika-networks.com/reference/rutx50/7.10.1/v1.2/wireless#post-wireless-actions-disconnect

i am able to use the API to scan for networks and connect to a network as well. Bu the /wireless/actions/disconnect endpoint requires following in the request

{
“data”: {
“sta_id”: “string”
}
}

and I can’t figure out where to get the sta_id from. I can’t find it anywhre in the docs.

Thanks and have a nice evening :slight_smile:

Hi,

sta_id means wireless interface id that has “mode” set as “sta” (Client). Also you probably want to disable “auto_reconnect” to get more control over it before using disconnect/reconnect actions

Thank you very much for your help, this was exactly what I needed :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.