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
hi, i am try to connect the socketIO server v4 using Arduino and building library for socketIO at low level communication. but i did't find the work flow of client and server handshake and hard to connect to socketIO server using Arduino
boards list:
Arduino UNO + EthernetShield For ENC28J60 or W5100
Arduino + WifiShield For ESP8266 or ESP32
Following code to rebuilt:
#include "Arduino.h"
#if defined(W5100)
#include <Ethernet.h>
#include "SPI.h" //For W5100
#elif defined(ENC28J60)
#include <UIPEthernet.h>
#include "SPI.h" //For ENC28J60
#elif defined(ESP8266)
#include <ESP8266WiFi.h> //For ESP8266
#elif defined(ESP32)
#include <WiFi.h> //For ESP32
#elif (!defined(ESP32) && !defined(ESP8266) && !defined(W5100) && !defined(ENC28J60)) //If no interface is defined
#error "Please specify an interface such as W5100, ENC28J60, ESP8266 or ESP32"
#error "above your includes like so : #define ESP8266 "
#endif
// Length of static data buffers
#define DATA_BUFFER_LEN 120
#define SID_LEN 24
hi, i am try to connect the socketIO server v4 using Arduino and building library for socketIO at low level communication. but i did't find the work flow of client and server handshake and hard to connect to socketIO server using Arduino
boards list:
Arduino UNO + EthernetShield For ENC28J60 or W5100
Arduino + WifiShield For ESP8266 or ESP32
Following code to rebuilt:
#include "Arduino.h"
#if defined(W5100)
#include <Ethernet.h>
#include "SPI.h" //For W5100
#elif defined(ENC28J60)
#include <UIPEthernet.h>
#include "SPI.h" //For ENC28J60
#elif defined(ESP8266)
#include <ESP8266WiFi.h> //For ESP8266
#elif defined(ESP32)
#include <WiFi.h> //For ESP32
#elif (!defined(ESP32) && !defined(ESP8266) && !defined(W5100) && !defined(ENC28J60)) //If no interface is defined
#error "Please specify an interface such as W5100, ENC28J60, ESP8266 or ESP32"
#error "above your includes like so : #define ESP8266 "
#endif
// Length of static data buffers
#define DATA_BUFFER_LEN 120
#define SID_LEN 24
class SocketIOClient {
public:
bool connect(char hostname[], int port = 80, char query[] = "");
bool connectHTTP(char hostname[], int port = 80);
bool connected();
void disconnect();
bool reconnect(char hostname[], int port = 80, char query[] = "");
bool monitor();
void sendMessage(String message = "");
void send(String RID, String Rname, String Rcontent);
void sendNSP();
void sendJSON(String RID, String JSON);
void heartbeat(int select);
void clear();
void getREST(String path);
void postREST(String path, String type, String data);
void putREST(String path, String type, String data);
void deleteREST(String path);
private:
void parser(int index);
void sendHandshake(char hostname[], char query[] = "");
#if defined(W5100) || defined(ENC28J60)
EthernetClient client; //For ENC28J60 or W5100
#endif
#if defined(ESP8266) || defined(ESP32)
WiFiClient client; //For ESP8266 or ESP32
#endif
};
The text was updated successfully, but these errors were encountered: