ArduinoPusherClient icon indicating copy to clipboard operation
ArduinoPusherClient copied to clipboard

Wont work over GSM, timeout?

Open andygilbert opened this issue 12 years ago • 0 comments

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

andygilbert avatar Oct 08 '12 10:10 andygilbert