Edge Provisioning API

Edge Provisioning REST API

📘

Provisiong services in the edge is only supported on OpenWRT

Please contact Droplit support to get access to the provisioning services.

Enable the Edge Provisioning Service

The provisioning service on the Edge hub is disabled by default. To enable the provisioning service, set the provisioningServiceEnabled property under config in the localsettings.json file to true.

  • Disabled
...
"config": {
    "provisioningServiceEnabled": false,
    ...
}
  • Enabled
...
"config": {
    "provisioningServiceEnabled": true,
    ...
}

Configure Edge Provisioning Service Port

The provisioning service on the Edge hub, when enabled, is configured to port 81 by default. To change the port, set the provisioningServicePort property under config in the localsettings.json file to a valid port number.

  • Default Port Number
...
"config": {
    "provisioningServiceEnabled": true,
    "provisioningServicePort": 83,
    ...
}

Auth Suite

Connect to a specific network with a specified Auth Suite encryption and password. Supported Auth Suites include:

  • wep+open
  • wep+shared
  • wep+mixed
  • psk2+tkip+ccmp
  • psk2+tkip+aes
  • psk2+tkip
  • psk2+ccmp
  • psk2+aes
  • psk2
  • psk+tkip+ccmp
  • psk+tkip+aes
  • psk+tkip
  • psk+ccmp
  • psk+aes
  • psk
  • psk-mixed+tkip+ccmp
  • psk-mixed+tkip+aes
  • psk-mixed+tkip
  • psk-mixed+ccmp
  • psk-mixed+aes
  • psk-mixed

For more information see: https://wiki.openwrt.org/doc/uci/wireless#wpa_modes

Endpoints

Returns the Edge ID

  • Definition
    • GET: http://192.168.1.1:81/droplit-edge
  • Result Format
    • 200 OK
    •   {
            "edgeId" : "00-00-5E-00-53-EB"
        } 
      
    • 400 Bad request - no content

Returns the list of WiFi networks scanned by the Edge Hub

Network Details

  • essid - service set identifier for wireless network

  • uci - encryption parameter that should be used as the value for AUTH_SUITE

  • encryption - User readable description of the encryption type

  • mode - connection type for access point

  • channel - channel the network is using

  • signal - signal strength in dB

  • quality - quality of the connection to the network

  • Definition

    • GET: http://192.168.1.1:81/droplit-edge/config/wifi
  • Result Format
    200 OK
    ```
    {
    "items": [
    {
    "address": "B0:77:AC:37:96:C0",
    "essid": "MySuperFastNetwork",
    "mode": "Master",
    "channel": 1,
    "signal": -38,
    "quality": "64/70",
    "encryption": "mixed WPA/WPA2 PSK (TKIP, CCMP)",
    "uci": "psk-mixed+tkip+ccmp"
    },
    {
    "address": "02:1A:11:F5:B4:7A",
    "essid": "MySuperFastGuestNetwork",
    "mode": "Master",
    "channel": 5,
    "signal": -39,
    "quality": "70/70",
    "encryption": "mixed WPA/WPA2 PSK (TKIP, CCMP)",
    "uci": "psk-mixed+tkip+ccmp"
    }
    ]
    }

    * 400 Bad request - no content

### Connect to a specified network
* Definition (Note: You will lose connection to the Edge hub after sending this request  since the Edge 
hub will switch from provisioning mode to attempting to establish and connection to the specified network)
    * ```PUT: http://192.168.1.1:81/droplit-edge/config/wifi ```
* Parameters: 
    * ```
        {
            "SSID" : "MySuperSafeNetwork",
            "PASS": "MySuperSafePasswordThatIChangeFrequenly",
            "AUTH_SUITE": "psk-mixed"
        }
      ```
* Result Format 
    * Status: 200 OK - no content (check to see if Edge hub is connected to internet)
    * 400 Bad request - no content