-4

I'm trying to get a simple WebSocket client working on an Arduino Mega with an ethernet shield. I tested the ethernet on the Arduino and it's working fine. I've tried a few of different WebSocket libraries the example sketches fail to connect. I've tried them with echo.websocket.org and with two different express instances ( one running WS and one running SocketIO ). But the WebSocket connection seems to fail.

https://github.com/billroy/socket.io-arduino-client

https://github.com/krohling/ArduinoWebsocketClient

is there a preferred library for the most recent WS standard that anyone has used with sucess recently?

  • I am sure all three of those libraries work fine - other wise why would they have published them? Certainly the first one in your list has commits that are very recent. It is most likely how you are using it that is failing, but you didn't bother to ask us about that, just assumed that your code is perfect but the libraries are all at fault. – Majenko Dec 24 '16 at 15:59
  • 1
    I'm running the examples and not modifying the code, and they are not working, I actually haven't tried the first LIB yet, but I will now ... My assumption was that perhaps the since the WS standard changed it broke the older libraries ... my question was more, if there is a preferred lib to use when trying to implement WS on Arduino, seems like it would be a common use case. Also, I don't really know why you seem to have such an attitude about the question, I wasnt being lazy, or making assumptions – user379468 Dec 24 '16 at 18:08
  • Well that's how it came across. "None of the libraries work. Where can I get a working one?" Given that there are 3 libraries (supposedly) tried and only 1 "your code", the balance of probability (3:1 against) says that it's your code that is at fault. Complaining about the libraries, therefore, smacks of arrogance and "My code is perfect!"ism. – Majenko Dec 24 '16 at 18:11
  • 1
    Well then, I've tried to reword so that it does not "smack of arrogance". although I think you are reading something that not there, I just see no point in aggro comments to honest questions, even if they are bad questions, just downvote it and or vote to close it and be done with it – user379468 Dec 24 '16 at 18:27
0

I have debugged both these libraries using wireshark, sending a message to a node.js ws server in my computer, and there really is some sort of problem in the handshake. The package is sent by the client and received by the host, by the connection with the ws server is never established.

Was anyone able to use them? Is there any alternative (besides Johnny-Five)?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.