You are reading a single comment by @jakedempsey and its replies. Click here to read the full conversation.
  • Ok I def need some help. In debugging this I am getting what seems like weird behavior and I can't identify why.

    The SIM900 module issues AT commands with a 100ms timeout which is fine because it passes itself as a function and does a stepper pattern where it just keeps checking the response from the AT command and once it gets a good response it steps to the next command etc.

    However, what I am seeing is that the SIM900 module does not account for getting 'undefined' back as a result from the AT callback. I am trying to step through that code as well to figure out what is going on. If I make the timeout larger (like 2000ms) for step 1 it will get a good response and move on to step 2. This of course is not ideal ... the current code should work because it just continues to call itself on the same step until it gets one of N number of results.

    Here is the output of a session where the step 1 (AT+CPIN?\r\n) was set to a 2000ms timeout on the AT call. If I leave it at the 100ms timeout, I will get an undefined in that step... Really could use some help on this one!

    Connecting to SIM900 module
    ] "ÿ" <--- "ÿ"
    ] "ÿÿ" <--- "ÿ"
    ] "ÿÿÿ" <--- "ÿ"
    DEBUG: Starting
    ["ATE0\r\n"
    ] "ÿÿÿA" <--- "A"
    ] "ÿÿÿATE0" <--- "TE0"
    ] "ÿÿÿATE0\r\n\r\n" <--- "\r\n\r\n"
    DEBUG:ÿÿÿATE0
    ] "OK\r\n" <--- "OK\r\n"
    DEBUG:OK
    ["AT+CPIN?\rr\n"
    ] "\r" <--- "\r"
    ] "\n+CP" <--- "\n+CP"
    ] "+CPIN: " <--- "IN: "
    ] "+CPIN: READ" <--- "READ"
    ] "+CPIN: READY\r\n\r" <--- "Y\r\n\r"
    DEBUG:+CPIN: READY
    ] "\nOK\r\n" <--- "\nOK\r\n"
    DEBUG:OK
    ["AT+CGATT?\r\n"
    DEBUG:undefined
    ] "\r" <--- "\r"
    ] "\n+CG" <--- "\n+CG"
    ] "+CGATT:" <--- "ATT:"
    ] "+CGATT: 0\r\n" <--- " 0\r\n"
    ] "\r\nOK\r\n" <--- "\r\nOK\r\n"

About

Avatar for jakedempsey @jakedempsey started