Chat freely about anything...

User avatar
By rant
#30770 Using the ITEAD library for AT commands , i mage to connect.

Then i am trying to create TCP. I could see that only if i enable multiple connections, i can then later create TCP connection to Amazon server, but with a single connection i cant !


So this let me to create the TCP latter :

Code: Select allif (wifi.enableMUX())
        Serial.print("multiple ok\r\n");
 


but this is not :


Code: Select allif (wifi.disableMUX()) {
        Serial.print("single ok\r\n");



the tcp connection is made with :

Code: Select all uint8_t buffer[128] = {0};
   static uint8_t mux_id = 0;
    if (wifi.createTCP(mux_id, HOST_NAME, HOST_PORT)) {
        Serial.print("create tcp ");



Which as said works only for multiple (why ? )


Then , the GET request which works in any browser and get tool, but is not working on the esp (when the TCP connection returns true) :


Code: Select all char *hello = "GET /index.php HTTP/1.1\r\nHost:52.xx.2xx.xx\r\nUser-Agent:runscope/0.1\r\nContent-Type:application/json\r\nConnection:close\r\n\r\n";
   
    Serial.println(hello);
    wifi.send((const uint8_t*)hello, strlen(hello));
    uint32_t len = wifi.recv(buffer, sizeof(buffer), 10000);
    if (len > 0) {
        Serial.print("Received:[");

   






What is going on here?
What is the difference between multi to single ?
Is there a difference for the mux_id channel being 0 in the TCP connection ?


Thanks a lot !

//library
http://docs.iteadstudio.com/ITEADLIB_Ar ... index.html