cancel
Showing results for 
Search instead for 
Did you mean: 

WLAN remoute switch on/off

igor_tunakin
Contributor
Hi all,
I have a client who would like to have an easy way to switch on/off one of WLAN. The client has two WLANs - one for employee and another one for guests. The ideal solution would be a switch or button. In this way a secretary can push the button and switch on an ofen WLAN for guests.

The client has a controller vSZ-E 3.6
Does anybody have an idea how it can be done?


4 REPLIES 4

diego_garcia_de
Contributor III
Probably not trivial (we had a similar request).. but you could rely on the SZ API and a raspberry pi which calls the API based on a switch. But nothing out-of-the-box vas far as I can see.

depending on how handy you feel with python.. you could base yourself on something like this:
http://www.oraclealchemist.com/news/real-push-button-refresh-raspberry-pi/

Cheers!


alex_shalima
Contributor
Hi Igor,

These are several ways you can do this:

1. Use Scheduler, a build in feature to schedule WLAN operation based on time of the day and day of the week. This method would automatically turn on/off the WLAN based on parameters you give it. This is the easiest way to go.

It can be found in this document, on Page 132
https://support.ruckuswireless.com/documents/2081-smartzone-3-6-administrator-guide-sz100-vsz-e


2. Turn the WLAN on/off using CLI (SSH Command Line Interface)

In this method there would be some sort of script that would add or delete WLAN from the desired WLAN Group. Based on your OS implementation, it can be Bash or Power Shell scripts.

Use this document for reference:
https://support.ruckuswireless.com/documents/2083-smartzone-3-6-command-reference-guide-sz100-vsz-e


3. Same as previous, only using SNMP


4. Same as #2, only using RESTful API


Hope this helps!

Cheers,
Alex

diego_garcia_de
Contributor III
See here for a quick example on how to do it via the API with python and requests

import requests
import json baseUrl="https://YOUR-IP-HERE:8443/wsg/api/public/v6_0" username="admin" password="YOUR-PASSWORD" zoneId="YOUR-ZONE-ID-AS-UUID" wlanId="YOUR-WLAN-ID-AS-INTGER-ID" enableWlan=True loginData={ "username": username, "password": password, "timeZoneUtcOffset": "+03:00" } headers = {"Content-Type": "application/json;charset=UTF-8"} login=requests.post(baseUrl + "/session", headers=headers, data=json.dumps(loginData)) print login.text print login.status_code if (login.status_code == requests.codes.ok): cookieJar=login.cookies # enable below to list zone and wlan ids you need to fill above # zoneRequests=requests.get( baseUrl + '/rkszones',cookies=cookieJar, headers=headers) # print zoneRequests.text # allWlansRequest=requests.get( baseUrl + '/rkszones/' +zoneId + '/wlans' ,cookies=cookieJar, headers=headers) # print allWlansRequest.text enableWlanData = {"type": "AlwaysOn" if enableWlan else "AlwaysOff"} wlanRequest=requests.patch(baseUrl + '/rkszones/' + zoneId + '/wlans/' + wlanId + '/schedule', cookies=cookieJar, headers=headers, data=json.dumps(enableWlanData)) print wlanRequest.status_code logoutRequest=requests.delete(baseUrl + '/session', headers=headers, cookies=cookieJar) print logoutRequest.status_code
If you're using a url and have proper certificates for the server then use the proper dns name. If you're using the "untrusted"  ruckus cert for the controller, please use the parameter "verify=False" in all the calls to request. (see here http://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification )

cheers!

igor_tunakin
Contributor
Thanks for help guys.
I will try to do it with a raspberry pi, python, and API