Avatar for michael_101

michael_101

Member since Oct 2019 • Last active Feb 2021
  • 6 conversations
  • 25 comments

Most recent activity

  • in Puck.js, Pixl.js and MDBT42
    Avatar for michael_101

    Hi - the connections are good, close and with 0 resistance from pin to pin (espruino => SIM808)
    I changed the baud rate from 115200 to 57600 and then to 38400 and this missing characters is less frequent and it's a lot more stable now.

    The testing still in progress...

    Thanks again @Gordon.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for michael_101

    Thank you @Gordon! It's better now.

    There is a similar bug with Uncaught Error: 0, SEND OK already registered

    Here is 2 examples..

    Example 1:

    ["AT+CIPSTART=0,\"TCP\",\"fake.server.co­m\",80\r\n"
    ] "\r\nOK\r\n"
    ] "\r\n0, CONNECT OK\n"
    ] "\r\n0, CLOED\r\n"
    ] "\r\nERROR\r\n"
    

    then every 10 minutes

    ["AT+CIPSTART=1,\"TCP\",\"fake.server.co­m\",80\r\n"
    ] "\r\nOK\r\n"
    ] "\r\n1, CONNECT OK\r\n"
    ] "\r\n1, CLOSED\r\n"
    ERROR: {"code":-15,"message":"no response"}
    Uncaught Error: 0, SEND OK already registered
     at line 1 col 44
    if(h[a])throw Error(a+" already registered");h[a]=b
                                               ^
    in function "registerLine" called from line 1 col 254
    ...+', SEND FAIL'),busy=!1,''}),at.registerLine(a+',­ SEND FAIL'...
                                  ^
    in function called from system
    

    when the sockets debug look like this

    {
      "socks": [ true ],
      "sockData": [
        "",
        "",
        "",
        "",
        "",
        "0124": "undefined"
       ]
     }
    

    Example 2:

    ["AT+CIPSTART=0,\"TCP\",\"fake.server.co­m\",80\r\n"
    ] "\r\nOK\r\n"
    ] "\r\n0, CONNECT OK\r\n"
    ] "\r\n> "
    ] "\r\n0, END OK\r\n"
    ] "\r\n+RE"
    ] "CEIVE,0,124:\r\nHTTP/1.1 408 Request Timeout\r\nConnection: close\r\nDate: Thu, 21 Jan 2021 14:32:35 GMT\r\nContent-Length: 0\r\n\r\n"
    ] "\r\n, CLOSED\r"
    ] "\n"
    

    then every 10 minutes

    ["AT+CIPSTART=1,\"TCP\",\"fake.server.co­m\",80\r\n"
    ] "\r\nOK\r\n"
    ] "\r\n1, CONNECT OK\r\n"
    ] "\r\n1, CLOSED\r\n"
    ERROR: {"code":-15,"message":"no response"}
    Uncaught Error: 0, SEND OK already registered
     at line 1 col 44
    if(h[a])throw Error(a+" already registered");h[a]=b
                                               ^
    in function "registerLine" called from line 1 col 254
    ...+', SEND FAIL'),busy=!1,''}),at.registerLine(a+',­ SEND FAIL'...
                                  ^
    in function called from system
    

    when the sockets debug look like this

    {
      "socks": [ true, undefined ],
      "sockData": [
        "",
        "",
        "",
        "",
        ""
       ]
     }
    

    Thanks again.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for michael_101

    Hi,

    I'm still getting the error, this is how it looks using the second scenario when at.debug enabled

    ["AT+CSTT=\"apn.net\", \"\", \"\"\r\n"
    ] "\r\nO"
    ] "K\r\n"
    ["AT+CIICR\r\n"
    ] "\r\nOK"
    ] "\r\n"
    ["AT+CIFSR\r\n"
    ] "\r\n"
    ] "ip.ip.ip.ip\r\n"
    ["AT+CIPSTART=0,\"TCP\",\"fake.server.co­m\",80\r\n"
    ] "\r\nOK\r\n"
    ] "\r\n0, CONNECT O\r\n"
    ] "\r\n0, CLOSED\r\n"
    ERROR: {"code":-15,"message":"no response"}
    ] "\r\nS"
    ] "HUT OK\r\n"
    

    And then after 10 minutes

    ["AT+CSTT=\"apn.net\", \"\", \"\"\r\n"
    ] "\r\nOK"
    ] "\r\n"
    ["AT+CIICR\r\n"
    ] "\r\nO"
    ] "K\r\n"
    ["AT+CIFSR\r\n"
    ] "\r\n"
    ] "ip.ip.ip.ip\r\n"
    ["AT+CIPSTART=0,\"TCP\",\"fake.server.co­m\",80\r\n"
    ] "\r\nOK\r\n"
    Uncaught Error: 0, CONNECT OK already registered
     at line 1 col 44
    if(h[a])throw Error(a+" already registered");h[a]=b
                                               ^
    in function "registerLine" called from line 1 col 174
    ...CONNECT FAIL'),socks[a]=!0}),at.registerLine(a+'­, CONNECT FA...
                                  ^
    in function "c" called from line 1 col 25
    g=void 0;var b;c&&(b=c(a))?(g=e,c=b):clearTimeout(d);­void 0=...
                            ^
    in function "g" called from line 2 col 4
    g(f)}b=b.substr(a+1);if(p&&d)return q("");"\n"==b[0]&&(b=b.s...
       ^
    in function called from system
    ] "\r\n0, CONNEC"
    ] "T OK\r\n"
    ] "\r\n> "
    ] "\r\n0, SE"
    ] "ND OK\r\n\r\n+RECEIVE,0,159:\r\nHTTP/1.1 200 OK\r\nConnection: close\r\nDate: Mon, 18 Jan 2021 15:47:55 GMT\r\nContent-Type: application/json; charset="
    ["AT+CIPCLOSE=0,1\r\n"
    ] "\r\n0, CLOSE OK\r\n"
    ["AT+CIPSTART=0,\"TCP\",\"fake.server.co­m\",80\r\n"
    ] "\r\nOK\r\n"
    ] "\r\n0,"
    ] " CONNECT OK\r\n"
    ] "\r\n> "
    ] "\r\n0, SEN"
    ] "D OK\r\n\r\n+RECEIVE,0,159:\r\nHTTP/1.1 200 OK\r\nConnection: close\r\nDate: Mon, 18 Jan 2021 15:48:08 GMT\r\nContent-Type: application/json; charset=u"
    ["AT+CIPCLOSEE=0,1\r\n"
    ] "\r\n0, CLOSE OK\r\n"
    ] "\r\n"
    ] "SHUT OK\r\n"
    

    Thank you

  • in Puck.js, Pixl.js and MDBT42
    Avatar for michael_101

    Hello again,
    Still testing this module https://raw.githubusercontent.com/esprui­no/EspruinoDocs/sim808/devices/SIM900.js­

    I don't know if this related to the request timeout but I'm posting data every 10 minutes, at first this works ok, but when I got {"code":-15,"message":"no response"} response so after 10 minutes, the next request will begin with this error message.

    Uncaught Error: 0, CONNECT OK already registered
     at line 1 col 44
    if(h[a])throw Error(a+" already registered");h[a]=b
                                               ^
    in function "registerLine" called from line 1 col 174
    ...CONNECT FAIL'),socks[a]=!0}),at.registerLine(a+'­, CONNECT FA...
                                  ^
    in function "c" called from line 1 col 25
    g=void 0;var b;c&&(b=c(a))?(g=e,c=b):clearTimeout(d);­void 0=...
                            ^
    in function "g" called from line 2 col 4
    g(f)}b=b.substr(a+1);if(p&&d)return q("");"\n"==b[0]&&(b=b.s...
       ^
    in function called from system
    

    It might work, but over time after couple requests this getting worse and the majority of the responses are 'no response' with the error above.

    What I'm trying to establish for now is to find the best way for stable connection and requests so I can continue my project knowing I have reliable way dealing with this.

    All test I did are when there is a good cellular signal.

    I tried those 2 scenarios with same results:
    1:

    • gprs = require('https://.../devices/SIM900.js')­.connect(Serial1... - ONCE
    • gprs.connect('', '', '', (err)... - ONCE
    • gprs.getIP((err, ip) - ONCE
    • require("http").request(options, (res) - EVERY 10 MINUTES

    2:

    • gprs = require('https://.../devices/SIM900.js')­.connect(Serial1... - ONCE
    • gprs.connect('', '', '', (err)... - EVERY 10 MINUTES
    • gprs.getIP((err, ip) - EVERY 10 MINUTES
    • require("http").request(options, (res) - EVERY 10 MINUTES
    • "AT+CIPSHUT" command (deactivate gprs) - EVERY 10 MINUTES

    Your help is greatly appreciated..
    Michael.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for michael_101

    I think it's ok.
    I'll see how it goes in the long term.
    Thank you Gordon.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for michael_101

    The default timeout seems to be 120 seconds? from simcom.
    https://simcom.ee/documents/SIM808/SIM80­0%20Series_AT%20Command%20Manual_V1.09.p­df

    Anyway,
    GET requests testGet1 = function() {} worked fine every 30 seconds even when the service was down.
    POST requests in other hand, I tried requests every 130 seconds for more than 10 hours when the service was up. I started with 666 free memory and finished with 451. This leak occurred only once, from 666 to 451 with "no response" message.
    There were more "no response" messages but the leak occurred only on one of them.

    I will do the same test with POST requests, service down, 5 minutes interval and see if still there any memory leak.

    Is there a way to specify a 30 seconds timeout in the GET/POST requests from http module?

    Thank you.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for michael_101

    Until ... :)

    It's definitely a lot better but I did some more tests, I shut down the remote service while continuing the POST requests to it (every 30 seconds), I got a 'no response' message as expected but it seems to be a memory leak here.
    BTW, 1 is when the service is up and running...

    Loading 12442 bytes from flash...
    Running onInit()...
    >initGPRS()
    =undefined
    ==========
    FREE MEMORY BEFORE STARTING REQUESTS: 928
    ==========
    Response: 1
    ==========
    FREE MEMORY - POST 664
    ==========
    Response: 1
    ==========
    FREE MEMORY - POST 664
    ==========
    Response: 1
    ==========
    FREE MEMORY - POST 664
    ==========
    Response: 1
    ==========
    FREE MEMORY - POST 664
    ==========
    ERROR: { "code": -15,
      "message": "no response"
     }
    ==========
    FREE MEMORY - ERROR POST 563
    ==========
    ERROR: { "code": -15,
      "message": "no response"
     }
    ==========
    FREE MEMORY - ERROR POST 473
    ==========
    New interpreter error: LOW_MEMORY,MEMORY
    ERROR: { "code": -15,
      "message": "no response"
     }
    ==========
    FREE MEMORY - ERROR POST 152
    ==========
    ERROR: { "code": -15,
      "message": "no response"
     }
    ==========
    FREE MEMORY - ERROR POST 430
    ==========
    ERROR: { "code": -15,
      "message": "no response"
     }
    ==========
    FREE MEMORY - ERROR POST 434
    ==========
    ERROR: Error processing Serial data handler - removing it.
    Execution Interrupted during event processing.
    New interpreter error: CALLBACK
    ERROR: { "code": -15,
      "message": "no response"
     }
    ==========
    FREE MEMORY - ERROR POST 136
    ==========
    ERROR: Ctrl-C while processing interval - removing it.
    Execution Interrupted during event processing.
    > 
    

    With Debug (Service down all time):

    Loading 12442 bytes from flash...
    Running onInit()...
    >initGPRS()
    =undefined
    ==========
    FREE MEMORY BEFORE STARTING REQUESTS: 927
    ==========
    >sim.gprs.at.debug()
    ={
      line: "",
      lineCallback: undefined,
      handlers: {
        "+RECEIVE": function (b) { ... },
        "+D": function (b) { ... }
       },
      lineHandlers: {
        "0, CLOSE": function (b) { ... },
        "1, CLOSE": function (b) { ... },
        "2, CLOSE": function (b) { ... },
        "3, CLOSE": function (b) { ... },
        "4, CLOSE": function (b) { ... }
       },
      waiting: [  ],
      dataCount: 0 }
    ["AT+CIPSTART=0,\"TCP\",\"fake.server.co­m\",80\r\n"
    ] "\r\nOK\r\n"
    ["AT+CIPSTART=1,\"TCP\",\"fake.server.co­m\",80\r\n"
    ] "\r\nOK\r\n"
    ["AT+CIPSTART=2,\"TCP\",\"fake.server.co­m\",80\r\n"
    New interpreter error: LOW_MEMORY,MEMORY
    ] "\r\nOK\r\n"
    ] "\r\n0, CONNECT FAIL\r\n"
    ERROR: { "code": -15,
      "message": "no response"
     }
    ==========
    FREE MEMORY - ERROR POST 152
    ==========
    ERROR: { "code": -15,
      "message": "no response"
     }
    ==========
    FREE MEMORY - ERROR POST 430
    ==========
    ["AT+CIPSTART=0,\"TCP\",\"fake.server.co­m\",80\r\n"
    ] "\r\nOK\r\n"
    ] "\r\n1, CONNECT FAIL\r\n"
    ERROR: { "code": -15,
      "message": "no response"
     }
    ==========
    FREE MEMORY - ERROR POST 434
    ==========
    ["AT+CIPSTART=1,\"TCP\",\"fake.server.co­m\",80\r\n"
    ] "\r\nOK\r\n"
    ] "\r\n2, CONNECT FAIL\r\n"
    ["AT+CIPSTART=2,\"TCP\",\"fake.server.co­m\",80\r\n"
    ] "\r\nOK\r\n"
    ERROR: Error processing Serial data handler - removing it.
    Execution Interrupted during event processing.
    New interpreter error: CALLBACK
    ERROR: { "code": -15,
      "message": "no response"
     }
    ==========
    FREE MEMORY - ERROR POST 136
    ==========
    ["AT+CIPSTART=2,\"TCP\",\"fake.server.co­m\",80\r\n"
    ERROR: Ctrl-C while processing interval - removing it.
    Execution Interrupted during event processing.
    > 
    
  • in Puck.js, Pixl.js and MDBT42
    Avatar for michael_101

    @Gordon thank you very much!
    It's doing GET/POST requests for ~13 hours now without any errors or memory leak :)

Actions