Skip to content

Wont work over GSM, timeout? #5

@andygilbert

Description

@andygilbert

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions