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
88 views 0 comments
by anonymous
Hello,

Is there an API to control the RUTX11 for connecting/disconnecting from a wifi network (providing the necessary SSID/password).

Modbus doesn't seems to do the trick, json rpc documentation doesn't show that option.

Thanks a lot.

1 Answer

0 votes
by anonymous

Hello,

I assume you are looking for a way to connect to the wireless AP in client (STA) mode. Also, I assume that simply connecting to the AP and then turning on/off the interface is not enough in your case.

While I haven't done so myself, you can try the following approach with JSON-RPC:

You can use an ubus command to scan for WiFi networks (wlan0 for 2.4GHz and wlan1 for 5Ghz):

  • ubus call iwinfo scan '{"device":"wlan1"}'

This should return the available access points.

Then, I suggest creating one client instance via WebUI and checking its config via UCI. This is just so that you know what it should looks like:

  • uci show wireless

Afterwards, you can use UCI commands to either create (uci add + uci set) a new interface or edit (just uci set) the existing one to match the access point to which you want to connect. The properties will be based on the output of the scan results and the password (key) that you should know.

For example, to add an interface:

Let me know if this works.

Kind Regards,

Andzej