Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout AT+CIFSR; with possible fix #4

Open
Gustavvr opened this issue Nov 5, 2017 · 1 comment
Open

Timeout AT+CIFSR; with possible fix #4

Gustavvr opened this issue Nov 5, 2017 · 1 comment

Comments

@Gustavvr
Copy link

Gustavvr commented Nov 5, 2017

HologramSIMCOM::_connectNetwork() fails to get an IP after connecting to the network AT+CIFSR. This seems to be cause by CIFSR needing addition time even after sending its "OK".

This can be "hack" fixed by adding a delay(5000) after the CIICR and before the CIFSR. A more elegant solution might me to call ATs until they come back OK.

I am happy to submit a pull request but wanted to see if anyone had any suggestions first

I am using the cheepest $10 modules from amazon. This could have something to do with it

If anyone wants to implement this hack. Edit the library file HologramSIMCOM.cpp. With the understanding that adding delays like this to fix an issue is just bad coding.

        // Bring up wireless connection
        if(_writeCommand("AT+CIICR\r\n", 85, "OK", "ERROR") != 2) {
            Serial.println(F("ERROR: failed at +CIICR"));
            break;
        }
	delay(5000);
		
        // Get local IP address
        if(_writeCommand("AT+CIFSR\r\n", 2, ".", "ERROR") != 2) {
            Serial.println(F("ERROR : failed at +CIFSR"));
            break;
        }
@Coollick
Copy link

As per your suggestion, I am using a fix with calling AT commands until OK.

instead of the delay(5000);

//TIMEOUT FIX
while(_writeCommand("AT\r\n", 1, "OK", "ERROR") != 2) {
  delay(1000);
}

For me, it calls the AT command 1-2 times before it finally returns OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants