0
votes

I want to make a WebSocket inner ESP8266 but i cant do it. I used this link for made it. https://github.com/billroy/socket.io-arduino-client I get error inner SocketIOClient.h

The error is:

In file included from C:\Users\WaffenSS\Desktop\ses\ses.ino:1:0:

C:\Program Files (x86)\Arduino\libraries\SocketIOClient/SocketIOClient.h:44:2: error: "Please specify an interface such as W5100, ENC28J60, or ESP8266"

C:\Program Files (x86)\Arduino\libraries\SocketIOClient/SocketIOClient.h:45:2: error: "above your includes like so : #define ESP8266 "

exit status 1 Error compiling for board Arduino/Genuino Uno.

There is anyone can help me ?

2

2 Answers

0
votes

Socket.IO is an API for WebSockets and most of Websocket libraries are supporting it.

I am pretty happy with this most contributed Arduino WebSocket library and it also supports Socket.IO. Here is your Socket.IO example.

Here is a heartbeat message type of socket.io implementaiton from the example:

if((now - heartbeatTimestamp) > HEARTBEAT_INTERVAL) {
    heartbeatTimestamp = now;
    // socket.io heartbeat message
    webSocket.sendTXT("2");
}
0
votes

into library you need set type of device that you use, C:\Program Files (x86)\Arduino\libraries\SocketIOClient/SocketIOClient.h: open this file and uncomment any line where specified type of device