The WiFi schedules taps into the existing schedules feature of the MESHdesk firmware.
If there is a schedule associated with a SSID, the controller will insert entries to the schedules JSON reply data.
Below is a snippet which we will discuss further.
"schedules": [
{
"id": 35,
"mo": true,
"tu": false,
"we": false,
"th": false,
"fr": false,
"sa": false,
"su": false,
"event_time": "0",
"command": "\/etc\/MESHdesk\/utils\/ssid_on_off.lua \u0027Dev\u0027 \u0027off\u0027",
"type": "command"
},
{
"id": 36,
"mo": false,
"tu": true,
"we": false,
"th": false,
"fr": false,
"sa": false,
"su": false,
"event_time": "0",
"command": "\/etc\/MESHdesk\/utils\/ssid_on_off.lua \u0027Dev\u0027 \u0027off\u0027",
"type": "command"
},
Each entry will have a event_time (0 means 00:00 and 1439 is 23:59)
Then we also have a flag for the day of the week.
We also have a command to execute.
To turn a SSID on and off we have a utility script /etc/MESHdesk/utils/ssid_on_off.lua
This is given the SSID and the action (on or off) as arguments.
With this implementation the activating and disable of a SSID does not depend on communication to the controller but is offloaded to the Access Point when it fetches its configuration.
It is however important that the time on the Access Point matches the timezone where it is deployed for the minute of the day when the schedule entry runs to match the actual time where the Access Point is deployed.