Use a Meraki MT30 button to enabled/disable a Meraki Wi-Fi SSID and generate a QR code allowing users to join the Wi-Fi network.
Note:
Only Open and PSK Authentication modes are supported at this time.
If applicable, the password (and corresponding QR code) depend on password policy chosen. Options include:
Ensure a MT30 button is claimed and licensed in the Meraki Org. Follow the button setup and installation guide here
In order to use the Meraki API, you need to enable the API for your organization first. After enabling API access, you can generate an API key. Follow these instructions to enable API access and generate an API key:
Organization > Settings > Dashboard API access
Enable access to the Cisco Meraki Dashboard API
My Profile > API access
Generate API key
For more information on how to generate an API key, please click here.
Note: You can add your account as Full Organization Admin to your organizations by following the instructions here.
The script requires being reachable over an internet accessible URL to receive the Meraki MT30 Webhook events. Therefore, it can be deployed on different IaaS platforms like Heroku, Amazon Web Services Lambda, Google Cloud Platform (GCP) etc. . For simplicity, we use the ngrok
tool here.
ngrok http 5000
and press enterIt is required to define a Webhook HTTP server and to configure a MT30 button automation in the Meraki Dashboard for this integration.
Configure the Webhook in the Meraki Dashboard:
Go to Network-wide > Alerts
Add an HTTP server in Webhooks: HTTP servers section:
Configure a Meraki MT30 Button Automation
git clone [repository name]
.env_sample
file to .env
. Rename config_sample.py
to config.py
..env
.MERAKI_API_KEY = "" SHARED_SECRET = "" ORG_NAME = "" NETWORK_NAME = "" SSID_NAME = ""
3
is selected) in config.py
# Password methodology choice. Only applicable to SSIDs that use PSK. See Available options: # 1. Same Password (set originally in Meraki Dashboard) -> Default Option # 2. Random Password (Randomly generate password) # 3. Password List (Randomly select from PASSWORD_LIST - must have at least 1 password in list, passwords must # conform to Meraki SSID password policy: >= 8 alphanumeric characters, etc.) PASSWORD_POLICY = 1 PASSWORD_LIST = ['sample1', 'sample2']
pip3 install -r requirements.txt
To run the program, use the command:
$ flask run
Press the MT30 button, and the automation workflow will trigger.
Navigate to the hosted URL for the flask app (for ex: the ngrok url if running locally), and you will see a QR code generated for the SSID (assuming the SSID was disabled before):
Note: it can take up to 30 seconds for the workflow to complete. Please refresh the page if webpage display has not updated.
If the new SSID state is disabled, the following will be displayed:
If this is the first QR code created for the SSID, the following will be displayed:
Note: Created QR codes can be found under static > qr_codes > [ssid name].png
Provided under Cisco Sample Code License, for details see LICENSE
Our code of conduct is available here
See our contributing guidelines here
Please note: This script is meant for demo purposes only. All tools/ scripts in this repo are released for use "AS IS" without any warranties of any kind, including, but not limited to their installation, use, or performance. Any use of these scripts and tools is at your own risk. There is no guarantee that they have been through thorough testing in a comparable environment and we are not responsible for any damage or data loss incurred with their use.
You are responsible for reviewing and testing any scripts you run thoroughly before use in any non-testing environment.
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community