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

Wont work over GSM, timeout? #5

Open
andygilbert opened this issue Oct 8, 2012 · 0 comments
Open

Wont work over GSM, timeout? #5

andygilbert opened this issue Oct 8, 2012 · 0 comments

Comments

@andygilbert
Copy link

Hi, i have a simple sketch that connects and outputs its connecton status. (using ethernet sheidl)

If i plug it into my standard internet it works, if i plug it into a working fully connected GSM router (via ethernet) it cannot connect. Yet i can plug a laptop into the GSM router and it works fine, full internet access.

So i can only assume this is either down to timout or something else but its impossible to debug without any real errors?

Have you got any idea why this wont work over a GSM router?

_UPDATE_

Ok, i think i know what the issue is. GSM modems split the packets in order to cope with them and i am assuming that handshake "lines" are being returned and getting split and the library isnt prepared for this and therfore reads part of what it thinks is a line.

Is there a way that this could be fixed, the code in question is:

bool WebSocketClient::readHandshake() {
    bool result = false;
    char character;
    String handshake = "", line;
    int maxAttempts = 300, attempts = 0;

    while(_client.available() == 0 && attempts < maxAttempts) 
    { 
        delay(100); 
        attempts++;
    }

    while((line = readLine()) != "") {
        handshake += line + '\n';
    }


    String response = getStringTableItem(6);
    result = handshake.indexOf(response) != -1;

    if(!result) {
        _client.stop();
    }

    return result;
}

Thanks
Andy

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

1 participant