Nucleo_Wifly_Thingspeak

04 Jan 2017

Hello I have a Problem with Thingspeak over Wifly. I do with the HTTPClient a GET to Thingspeak, the Value is receive on Thingspeak but the in Debugmode from the HTTPClient come the reply (WARN]Connection was closed by server) and it hangs up.

include the mbed library with this snippet

    pc.printf("\n\rWiFly Start");
    wifly.init(); // use DHCP
    pc.printf("\n\rWiFly init");
    while (!wifly.connect()); // join the network
    pc.printf("\n\rIP Address is %s\n\r", wifly.getIPAddress());
    pc.printf("\n\rTCP Link is %d\n\r", wifly.is_connected());
    //------------------------------------
    
     //parse URL 
     urlBuffer[0] = 0;
    sprintf(urlBuffer, "%s?key=%s&field1=30\r\n", thingSpeakUrl, thingSpeakKey);
    pc.printf("Request to %s\r\n", urlBuffer);  
      
      
    //GET data
    printf("\r\nTrying to fetch page...");  
    //HTTPText resp; 
    HTTPResult ret = http.get(urlBuffer,str,128);
    if ( !ret) {
        printf("\r\nPage fetched successfully - read %d characters\n", strlen(str));
        printf("\r\nResult: %s\n", str);
    } else {
        printf("\r\nError - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode());
    }
    //+++++++++++++++++++++++++++++++++++++++++++++++

/media/uploads/Andmo/cmd.png

Please help