You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@romuye123 , if you put a Socket.io client inside a HTML page, will this page connect to your server correctly?
I'm asking this because we can trace the problem origin this way.
Hi,
I am unable to connect to SocketIO server. Following is my sketch file:
#include <ESP8266WiFi.h>
include "SocketIOClient.h"
SocketIOClient client;
const char* ssid = "myssid";
const char* password = "mypwd";
char host[] = "192.168.0.132";
int port = 3000;
extern String RID;
extern String Rname;
extern String Rcontent;
void setup() {
Serial.begin(115200);
delay(10);
setupWifi();
if (!client.connect(host, port)) {
Serial.println("connection failed");
return;
}
if (client.connected())
{
client.send("connection", "message", "Connected !!!!");
}
}
void setupWifi(){
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// put your main code here, to run repeatedly:
}`
Following is the output on serial
WiFi connected
IP address:
192.168.24.106
[hostByName] Host: 192.168.0.132 is a IP!
connection failed
The text was updated successfully, but these errors were encountered: