Announcement

Collapse
No announcement yet.

Adding WLAN Profile via POST

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding WLAN Profile via POST

    ANother question..

    I am unable to successfully as a WLAN profile via a POST.

    I have posted the data using Key:Value parameters in multi-part form as appended parameters

    url: /import/config

    key: "configrecord"

    value:
    Code:
    <?xml version="1.0" standalone="yes"?>
    <!-- Automatically generated XML -->
    <!DOCTYPE configrecord [  
    <!ELEMENT configrecord (configgroup+)>
    <!ELEMENT configgroup (configitem+)>
    <!ELEMENT configitem (value+)>
    <!ELEMENT value (#PCDATA)>
    <!ATTLIST configrecord version CDATA #IMPLIED>
    <!ATTLIST configgroup name CDATA #IMPLIED>
    <!ATTLIST configgroup instance CDATA #IMPLIED>
    <!ATTLIST configitem name CDATA #IMPLIED>
    <!ATTLIST configitem instance CDATA #IMPLIED>
    <!ATTLIST value name CDATA #IMPLIED>]>
    <configrecord version = "0.1.0.1">
    <configgroup name = "WLAN Profile" instance = "BobbyWing">
    <configitem name = "Basic">
    <value name = "Network Name">westWiFi</value>
    <value name = "State">Enabled</value>
    </configitem>
    <configitem name = "Security">
    <value name = "Suite">WPA2</value>
    <value name = "WEP Key Size">40</value>
    <value name = "WEP TX Key Index">4</value>
    <value name = "WEP Key 1 Key"></value>
    <value name = "WEP Key 2 Key"></value>
    <value name = "WEP Key 3 Key"></value>
    <value name = "WEP Key 4 Key"></value>
    <value name = "WPAx Key Type">Passphrase</value>
    <value name = "WPAx Passphrase">38801815</value>
    <value name = "WPAx Key"></value>
    <value name = "WPAx Encryption">CCMP</value>
    </configitem>
    <configitem name = "Advanced">
    <value name = "TX Power Maximum">17 dBm</value>
    <value name = "Power Management">Disabled</value>
    <value name = "PM Interval">1 beacons (100ms each)</value>
    </configitem>
    </configgroup>
    </configrecord>
    Last edited by foolishsailor; 04-04-2017, 10:34 PM.

  • #2
    Marion - I have tried same above using Postman with
    body set to: form-data
    key: configrecord
    value: as above as text

    I am getting back a 400 bad request error.

    After looking at your javascript ode for the function I think I am doing ti correctly - help would be appreciated!

    I am using firmware version: 1.3.0.1R4

    Comment


    • #3
      ok making progress..

      In Postman even though I changeed to Form-Data there was still a header left for content type x-www-form-urlencoded. I removed that and am now getting an error response with more detail. However I need help parsing what it is saying

      Code:
      <?xml version="1.0" standalone="yes"?>
      <!-- Automatically generated XML -->
      <!DOCTYPE function [
         
      <!ELEMENT function (return)>
      <!ELEMENT return (result,message+)>
      <!ELEMENT result (#PCDATA)>
      <!ELEMENT message (#PCDATA)>
      <!ATTLIST function version CDATA #IMPLIED>
      ]>
      <function version = "0.1.0.0">
          <return>
              <message>ERROR: Only units of "beacons (100 ms each)" are accepted.</message>
              <message>ERROR: Invalid setting for WLAN Profile:BobbyWing Advanced PM Interval, no changes were made.</message>
              <message>ERROR: XML parsing failed at line 3.</message>
              <message>ERROR: XML import failed.</message>
              <result>Failed</result>
          </return>
      </function>

      Comment


      • #4
        I have it working now - figured out how to read the error and removed the "1 beacons (100ms each) content

        Comment

        Working...
        X