This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3100: POST variables vanishes in HTTP request

Part Number: CC3100

Hi,

  I have started the CC3100 in Access Point mode and configured the device to listen to port 8081. Then from a mobile device (iphone) I have typed "192.168.1.1:8081" from the browser. This resulted in a standard HTTP request coming into the CC3100 that starts with something like "GET ....". The CC3100 (with the help of the host MCU) replies back with an HTML page containing form submission in POST method. Now, when the data of the HTML form is submitted at the mobile browser end, the CC3100 receives an HTTP request that starts with "POST ....". But I am finding that all the POST variables that should have come like "var1=56&var2=34&var3=99 ...." are not there in the HTTP request. The HTTP request that came into the CC3100 from the mobile browser contains "Content-Length: 45" but the contents itself are not there. Is there any automatic filtering of the POST variables from an HTTP request inside CC3100. I didn't notice anything as such in the documentation of Simplelink CC3100. Or am I missing something somewhere? If so, I would appreciate if anyone could point me to the right document to look for further details into this matter.

-

NOTE: I am manually transmitting the HTML file contents to the mobile browser using sl_Send() function & the HTML files are not stored in the CC3100 internal FLASH memoy.

-

Thanks

-

Regards

Soumyajit

  • Hi Soumyajit,

    Are you using the CC3100's internal HTTP server for any of the HTTP server functionality, or is it purely based off of an HTTP library on your host MCU?
    If you are using the internal HTTP server, then POST tokens must follow the naming convention of __SL_P_*. See section 12.5 of the wi-fi user's guide here for details on HTTP post handling:
    www.ti.com/.../swru368a.pdf

    Regards,
    Michael
  • Hi Michael,
    Thanks for the reply. I am using HOST MCU's HTTP function (code section presented below).
    -
    CODE:
    strcpy((char *)(uBuf.BsdBuf), "");
    strcat((char *)(uBuf.BsdBuf), "HTTP/1.1 200 OK\n");
    strcat((char *)(uBuf.BsdBuf), "Content-Length: 1009\n");
    strcat((char *)(uBuf.BsdBuf), "Content-Type: text/html\n");
    strcat((char *)(uBuf.BsdBuf), "\n");
    strcat((char *)(uBuf.BsdBuf), "<html>");
    strcat((char *)(uBuf.BsdBuf), "<head>");
    strcat((char *)(uBuf.BsdBuf), "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">");
    strcat((char *)(uBuf.BsdBuf), "<title>");
    strcat((char *)(uBuf.BsdBuf), "WIFI CONFIGURATOR");
    strcat((char *)(uBuf.BsdBuf), "</title>");
    strcat((char *)(uBuf.BsdBuf), "</head>");
    strcat((char *)(uBuf.BsdBuf), "<body>");
    strcat((char *)(uBuf.BsdBuf), "<font size=\"10\" color=\"red\">BOSCH</font>");
    strcat((char *)(uBuf.BsdBuf), "<br><br><form action=\"wificfg.cgi\" method=\"post\">");
    strcat((char *)(uBuf.BsdBuf), "<br>Configurator Password: <input type=\"password\" name=\"cfgpassword\">");
    strcat((char *)(uBuf.BsdBuf), "<br>AP Name: <input type=\"text\" name=\"apname\">");
    strcat((char *)(uBuf.BsdBuf), "<br>AP Password: <input type=\"password\" name=\"appassword\">");
    strcat((char *)(uBuf.BsdBuf), "<br>AP Security Type: <select name=\"apsectype\">");
    strcat((char *)(uBuf.BsdBuf), "<option value=\"0\">OPEN</option>");
    strcat((char *)(uBuf.BsdBuf), "<option value=\"1\">WEP</option>");
    strcat((char *)(uBuf.BsdBuf), "<option value=\"2\">WPA</option>");
    strcat((char *)(uBuf.BsdBuf), "<option value=\"3\" selected>WPA WPA2</option>");
    strcat((char *)(uBuf.BsdBuf), "<option value=\"4\">WPS PBC</option>");
    strcat((char *)(uBuf.BsdBuf), "<option value=\"5\">WPS PIN</option>");
    strcat((char *)(uBuf.BsdBuf), "<option value=\"6\">WPA ENT</option>");
    strcat((char *)(uBuf.BsdBuf), "<option value=\"7\">P2P PBC</option>");
    strcat((char *)(uBuf.BsdBuf), "<option value=\"8\">P2P PIN KEYPAD</option>");
    strcat((char *)(uBuf.BsdBuf), "<option value=\"9\">P2P PIN DISPLAY</option>");
    strcat((char *)(uBuf.BsdBuf), "<option value=\"10\">P2P PIN AUTO</option>");
    strcat((char *)(uBuf.BsdBuf), "</select>");
    strcat((char *)(uBuf.BsdBuf), "<br>TX Interval (Minutes): <input type=\"text\" name=\"txinterval\" maxlength=\"4\" value=\"20\">");
    strcat((char *)(uBuf.BsdBuf), "<br><br><input type=\"submit\" value=\"UPDATE\">");
    strcat((char *)(uBuf.BsdBuf), "</form>");
    strcat((char *)(uBuf.BsdBuf), "</body>");
    strcat((char *)(uBuf.BsdBuf), "</html>");

    -
    Thanks
    -
    Regards
    Soumyajit
  • Hi Soumyajit,

    If you are using an HTTP library on your host MCU to implement your HTTP server, then the NWP will only see TCP data coming in and out. Thus, it cannot interfere with the HTTP pages that you serve and the data you get back. You'll have to debug your http library to see why those variables are being filtered out.

    Regards,
    Michael
  • Ok, Michael. I'll check the codes again & will open a new thread if the problem persists.
    -
    Thanks
    -
    Regards
    Soumyajit