SIM900 issues

Posted on
  • I am having an issue with my Pico logger project which is using a SIM800 board. It runs successfully for over a week posting data every 5 mins to Parse.com, but then a couple of times it has got into a 'stuck state'. It is currently in this state and I am trying to debug.

    When I reset the application the SIM800 does connect and do 1 or 2 succesful POSTs and then gets stuck.
    Before doing the send I check I have a valid IP and then start a POST request. With at.debug() on I can see that CIPSTART is successful then I get CONNECT OK but then nothing more - no DATA SEND as normal. Then after a 30s or so the SIM800 sends a CLOSED.

    I am running a local copy of the SIM900 module as I have added some functions. How do I go about debugging this further ?

  • Hi Jon, that's a really odd one.

    I think first steps would be to check gsm.debug() and to see what the current state of the sockets is (socks - you'll need to know what the socket number was but you could see that from the debug data). If it's wait or not true then somehow the CONNECT OK got missed - maybe it had extra stuff on the start of the line?

    Otherwise it's a matter of poking around in the actual HTTP implementation, but I'm not sure that would be an issue as it's been used quite a lot to date. The SIM900 module is by far the mode likely culprit.

    If you are in the Wait state, maybe start adding print statements to the connect code to see where it's got to.

    Hope that's some help - let us know how you get on!

    What are your changes? If you could contribute them back it'd be great - anything that cleans up the SIM900 code or makes it more reliable would be great.

  • Thanks for that - I had just done some reading on the networking to understand the interface and was about to start trying that. But now there are stranger things going on when I try to upload new code it is real slow and I get http and networkJS modules not found and then when uploaded the console is running real slow and a few keystrokes behind :( Maybe I have a hardware issue going on here ?

  • gprs.at.debug() is showing multiple response lines eg
    ["ATE0\r\n"
    ] "\r\nOK\r\n" <--- "\r\nOK\r\n"
    ] "\r\nOK\r\n" <--- "\r\nOK\r\n"
    ] "\r\nOK\r\n" <--- "\r\nOK\r\n"
    ] "\r\nOK\r\n" <--- "\r\nOK\r\n"
    ] "\r\nOK\r\n" <--- "\r\nOK\r\n"
    ["AT+CPIN?\r\n"
    ] "\r\n+CPIN: READY\r\n\r\nOK\r" <--- "\r\n+CPIN: READY\r\n\r\nOK\r"
    ] "\r\n+CPIN: READY\r\n\r\nOK\r" <--- "\r\n+CPIN: READY\r\n\r\nOK\r"
    ] "\r\n+CPIN: READY\r\n\r\nOK\r" <--- "\r\n+CPIN: READY\r\n\r\nOK\r"
    ] "\r\n+CPIN: READY\r\n\r\nOK\r" <--- "\r\n+CPIN: READY\r\n\r\nOK\r"
    ] "\r\n+CPIN: READY\r\n\r\nOK\r" <--- "\r\n+CPIN: READY\r\n\r\nOK\r"
    [["AT+CGATT?\r\n"
    ] "\n\r\n+CGATT: 0\r\n\r\nOK" <--- "\n\r\n+CGATT: 0\r\n\r\nOK"
    ] "\n\r\n+CGATT: 0\r\n\r\nOK" <--- "\n\r\n+CGATT: 0\r\n\r\nOK"
    ] "\n\r\n+CGATT: 0\r\n\r\nOK" <--- "\n\r\n+CGATT: 0\r\n\r\nOK"
    ] "\n\r\n+CGATT: 0\r\n\r\nOK" <--- "\n\r\n+CGATT: 0\r\n\r\nOK"
    ] "\n\r\n+CGATT: 0\r\n\r\nOK" <--- "\n\r\n+CGATT: 0\r\n\r\nOK"

    What would cause that ?

  • Maybe you're somehow instantiating multiple GSM modules that are all listening for the same data? Have you disabled the reset on upload setting in the Web IDE?

  • OK my bad - I introduced some multiple modules in my debugging. Took a hardware reset to recover from that.

    So back to the original issue - there are a number of error conditions from SIM900 that are not being caught which means the busy flag and the AT handlers are not being cleared hence everything stops. I am in the process of adding these error handlers in - once I have it running reliably am happy to submit back.

  • That'd be great - thanks!

    The module itself isn't in a great state, and I've had some trouble getting the SIM900 modules I bought working here (region problems) so I haven't really been able to do much about it. Not sure if it helps, but the ESP8266WiFi_0v25 module might help out as I think it tries to handle a lot of things in a more sane way.

  • OK will check out that module for some consistency. Out of interest will the SIM900 module support the new HTTPS additions or are there changes required ? I would prefer to use the Parse Cloud functions but they only work over HTTPS

  • Yes, it should 'just work'. The only problem would be if the SIM900 didn't accept raw data when sending over a socket (maybe it wants some characters escaped), but I think you're probably safe.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

SIM900 issues

Posted by Avatar for jonreid @jonreid

Actions