Avatar for RobertMcReed


Member since Jun 2019 • Last active Aug 2019
  • 1 conversations

Most recent activity

  • in Pico / Wifi / Original Espruino
    Avatar for RobertMcReed

    Hi Gordon,

    Thanks for checking in. I closed the post as I was able to make the connection work.

    What I found was that I was trying to connect to http://ec2-xx-yyy-zzz-v.compute-1.amazon­aws.com from the Espruino board, and that did not work (although that is the host I used for the node ws client without an issue).

    By removing the http:// I was able to connect the Espruino to the hosted socket. I really thought I had tried that the other day to no avail, but I suppose something must have been different.

    @MaBe sent me a message letting me know that there is a 32 char limit for the internal hostname, so I'm a bit confused as my hostname is 40 characters. Nevertheless, it seems to be connecting and sending data ok, but will intermittently disconnect.

    A stranger issue that I am having is when connecting locally. When testing, I host the ws server on my local machine and connect the Espruino to the same WiFi. After finding the ip of my computer that is running the server, I use that on the Espruino to connect. However, I only seem to be able to connect 1/10 times.

    Most of the time it simply fails to connect, and then randomly without changing anything it will work. Any ideas what that might be about?

  • in Pico / Wifi / Original Espruino
    Avatar for RobertMcReed

    Hi there.

    I've been working on a project that uses the ws module (as shown here) to connect to a node process running a WebSocket server.

    When running the server locally and connecting the Espruino to the same WiFi, the board is able to open a socket and communicate with the host given the ip address (ie 192.168.x.yy).

    However, when running the server on an EC2 on AWS the Espruino is unable to connect to the host (ie ec2-xx-yyy-zzz-v.compute-1.amazonaws.com­). The ws.on('close', () => { ... }); event is immediately fired after opening the socket. On the server side I see no indication of a connection attempt.

    The host is running on port 80 and I have opened that port. I can connect a node ws client to the host on the EC2, but the Espruino client refuses to connect.

    Any ideas on what might be preventing the connection? I found one Stack Overflow post that seems to be describing the same issue, but does not have a resolution and is quite old at this point.

    Any help you all could provide will be much appreciated.