Go Down

Topic: Socket.io v1.x Library for W5100 & ENC28J60 + ESP8266 (Read 20190 times) previous topic - next topic


thank you for your kind message.
a wiki has been started and should be available on github soon as well as the new version which will include HTTP REST functions

stay tuned


Mar 26, 2016, 09:37 pm Last Edit: Mar 26, 2016, 09:43 pm by BhanuTejaJ
Thanks for your ...quick response :)

Mean while can you help me with some source where can I start learning ? ....at least to get some overview, please.



I'm starting to use this great library!
But I can not receive from the Node long strings,
these are truncated !!
I Uncomment line 145 SocketIOClient.cpp to show (databuffer), which
instead it contains the whole string.
How can I do to valorize (Rcontent) with long strings (600 characters)?
Thank you


this is a know issue with a fix on github
the fix will be added to the next version



First of all thank you for the library. It works perfect with W5100.

I am now the owner of a new Ethernet Shield 2 - W5500 chip. I work with arduino ide 1.7.9 and Ethernet2 library.

I tried to combine the ethernet2 with socket.IO and i had partly success. My setup is a Mega and Ethernet shield 2. I connected to a Socket.IO server, but it disconnects from it and never sends any message.

I don't know if it is a chip error or the libraries are not completely compatible.

Do you have any suggestions i might try?


Apr 15, 2016, 01:13 am Last Edit: Apr 15, 2016, 01:20 am by washo4evr

I have not tried the w5500 yet
I might order one at some point
most of the code should work though without any modification.
probably some changes in the ethernet library
I will investigate
meanwhile, you can try editing the lib
according to http://labs.arduino.org/Arduino%20Ethernet%20Shield%202
NB. You can reuse your code written for Arduino Ethernet Shield, simply replacing
#include <Ethernet.h>  -->  #include <Ethernet2.h>
#include <EthernetUdp.h>  -->  #include <EthernetUdp2.h>


I got the library working with communication between server and web-client and between server and ESP8266.

I have one problem: data are received on the ESP8266 (log-msg) but not delivered to the application.
Code: [Select]
  if (client.monitor()) {
    lastreply = millis();

I get no print of RID, Rname and Rcontent in my client.monitor

I also tried to implement a callback routing like this:
Code: [Select]
void ondata(SocketIOClient client, char *data) {

registering the callback in setup() like this:

Code: [Select]

But this also not works.

I cannot understand from the SocketIOClient.cpp how the callback is called???

Any help is highly appreciated.


After looking into the library code, I see that the monitor function does not return true.

I added this and it works fine now.

For reference I attach my revised library.

Changes in SocketIOClient.cpp and example


Sorry - I  try again.


Sorry to bump an older post, but I have jumped into the world of websockets without a clue of what I am doing (the more I learn, the more I realize what I don't know). This is the only library that I've found that deals with socket.io after version 1.0, and the only one where I've gotten the example to actually work!

What I am working on currently will send and receive JSON data through a socket.io server on a computer that will in turn be sending and receiving data from another "black box" (doesn't really matter, which is the whole point of websockets).

I'm using an Adafruit capacitive touch sensor and some LEDs to indicate what has been touched at my end, sending that data and receiving data to also control the LEDs from the other end. This was originally done using the serial port to talk to the black box, but it ended up with considerable distance and the USB extender we used seems to have issues with being used for a serial port (drops the connection after a while - end up having to reboot both ends to get it working again). Websockets was the solution the programmer of the black box wanted, so here I am trying to catch up.

TLDR: I still don't know what I don't know. Would anyone who has used this library care to share some of their code so I can learn from the examples?



Thanks for bringing this thread back to life

I have been mostly on github lately.
I also replied to your PM.

Let me know if you need anything



    I am using BH-MSD-2A driver with BH42SH38-1684 LA-TR 8X8 BIPOLAR stepper motor so how should I calibrate it with my arduino board to operate it with potentiometer of 1 M ohm and also to operate it for fixed rotation for clock wise and anti clockwise direction.


As it been discussed on github, there is a bug, and the connection is lost after 3', does anyone succeeded in maintaining the connection during a long time ?


does w5100 ethernet module support websockets or long polling methods to communicate with server


Why the lib won't work with an Arduino Wifi Uno? http://www.arduino.org/products/boards/arduino-uno-wifi
I there any chance I can set up a websocket on this board?

Go Up