You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Hi! What you're doing looks fine - although I'm not sure the console log you posted actually matches the code that you posted up?

    Are you sure you're not calling initGPRS more than once? I don't see it called at all in the code, but if it were called multiple times it would definitely cause a memory leak.

    Looking at the module the Uncaught Error: 0, CLOSED already registered message would seem to be caused by the module not actually sending the line 0, CLOSED when the request finishes. I don't know if that's some difference between the SIM808 and SIM900 or not, but it might be I need to make a few tweaks to the module to get it to handle that properly.

    Please could you run sim.gprs.at.debug(), make a request, then post what gets printed up here?

    Hopefully it'll allow me to make some changes to the module to fix the issue.

  • Hi Gordon,

    although I'm not sure the console log you posted actually matches the code that you posted up?

    Yes I Just clean it up to be easier to see the important data.

    Are you sure you're not calling initGPRS more than once? I don't see it called at all in the code, but if it were called multiple times it would definitely cause a memory leak.

    I am calling it only once manually from the left side of the IDE when the SIM808 is ready - Just for testing.

    AT Debug:

    >sim.gprs.at.debug()
    ={
      line: "",
      lineCallback: undefined,
      handlers: {
        "+RECEIVE": function (b) { ... },
        "+D": function (b) { ... }
       },
      lineHandlers: {  },
      waiting: [  ],
      dataCount: 0 }
    

    First request:

    >testGet1()
    ["AT+CIPSTART=0,\"TCP\",\"http://www.pur3.co.uk\",80\r\n"
    =undefined
    ] "\r\nOK\r\n"
    ] "\r\n0, CONNECT OK\r\n"
    ] "\r\n> "
    ] "\r\n0, SEND "
    ] "OK\r\n"
    ] "\r\n+RECEIVE,0,134"
    ] "8:\r\nHTTP/1.1 200 OK\r\nDate: Thu, 31 Dec 2020 11:09:20 GMT\r\nServer: Apache/2.4.18 (Ubuntu)\r\nVary: Accept-Encoding\r\nConnection: close\r\nContent-Type: text/html;charset=UT"
    ] "\r\n+RECEI"
    ] "VE,0,1348:\r\n/h1> \r\n<!--\t\t<form method=\"get\" class=\"searchform\" action=\"search.php\">\r\n\t\t\t<div><input type=\"text\" name=\"text\" class=\"textbox\" />"
    ] "\r\n+RECEIVE,"
    ] "0,1325:\r\na wide variety of platforms. For more information, please see the <a href=\"About\"><span>About</span></a> page.<br />\n<br />\n<strong>We also develop the&nbs"
    ["AT+CIPCLOSE=0,1\r\n"
    Got Response with statuscode: 200
    Error Flags [  ]
    ==========
    FREE MEMORY - GET1 885
    ==========
    ] "\r\n0, CLOSE OK\r\n"
    

    Second request:

    >testGet1()
    ["AT+CIPSTART=0,\"TCP\",\"http://www.pur3.co.uk\",80\r\n"
    =undefined
    ] "\r\nOK\r\n"
    Uncaught Error: 0, CLOSED already registered
     at line 1 col 44
    if(m[a])throw Error(a+" already registered");m[a]=d
                                               ^
    in function "registerLine" called from line 2 col 432
    ...;g[a]=void 0;l=!1;return""});else return g[a]=void 0,""
                                  ^
    in function "c" called from line 1 col 25
    e=void 0;var u;c&&(u=c(t))?(e=k,c=u):clearTimeout(h);void 0=...
                            ^
    in function "e" called from line 2 col 16
    k=!0);k||e&&e(h)}b=b.substr(a+1);if(k&&f)return d("");"\n"==...
                   ^
    in function called from system
    ] "\r\n0, CONNECT OK\r\n"
    ] "\r\n> "
    ] "\r\n0, SEND"
    ] " OK\r\n"
    ] "\r\n+RECEIVE,0,134"
    ] "8:\r\nHTTP/1.1 200 OK\r\nDate: Thu, 31 Dec 2020 11:09:43 GMT\r\nServer: Apache/2.4.18 (Ubuntu)\r\nVary: Accept-Encoding\r\nConnection: close\r\nContent-Type: text/html;charset=U"
    ] "\r\n+RECEI"
    ] "VE,0,1348:\r\n/h1> \r\n<!--\t\t<form method=\"get\" class=\"searchform\" action=\"search.php\">\r\n\t\t\t<div><input type=\"text\" name=\"text\" class=\"textbox\" />\r\n"
    ] "\r\n+RECEIVE"
    ] ",0,1325:\r\na wide variety of platforms. For more information, please see the <a href=\"About\"><span>About</span></a> page.<br />\n<br />\n<strong>We also develop the&nbs"
    ["AT+CIPCLOSE=0,1\r\n"
    Got Response with statuscode: 200
    Error Flags [  ]
    ==========
    FREE MEMORY - GET1 750
    ==========
    ] "\r\n0, CLOSE OK\r\n"
    

    Thank you,

About

Avatar for Gordon @Gordon started