Open

Description
Hi I am trying to set up a new GSTcpClient which reuses the GSModule created by the Wifi backpack. I am unable to connect to an address in my local network.
void connectToServer() {
GSModule *gsPtr;
gsPtr = &pinoccio::WifiModule::instance.bp()->gs;
GSTcpClient client = GSTcpClient(*gsPtr);
IPAddress ip;
char* url = SERVER_LOCATION;
if (!gsPtr->parseIpAddress(&ip, url)) {
ip = gsPtr->dnsLookup(url);
if (ip == INADDR_NONE) {
Serial.print(F("Failed to resolve "));
Serial.print(url);
Serial.println(F(", reassociating to retry"));
return;
}
}
if (!client.connect(ip, 8000)) {
Serial.println(F("HQ connection failed, reassociating to retry"));
pinoccio::WifiModule::instance.bp()->associate();
return;
}
client.print("Hello"); // Should print a raw GET or POST request
client.flush();
return;
}
I've dug into what's causing the error and I can pinpoint to the following:
client.connect(ip, 8000)
(line 75) is returningfalse
GSModule::cid_t cid = gs.connectTcp(ip, port)
is settingcid
toINVALID_CID
.- Turning verbose logging from the GS Chipset is resulting in the following output:
>>= AT+NCMAUTO=0,0,0,1 <<= 0 >>= AT+WD <<= 0 >>= AT+NCMAUTOCONF=11,0 <<= 0 >>= AT+NCMAUTO=0,1,0,1 <<= 0
Anyone here knows what's the root of this problem?
My code can be found at https://github.com/vicngtor/OyoroiPinoccio/blob/master/Test/TcpCall/TcpCall.ino
Metadata
Metadata
Assignees
Labels
No labels