Trouble connecting Espruino ws module to domain hosted on EC2 #4778
Replies: 1 comment
-
Posted at 2019-06-12 by @gfwilliams Hi! I noticed you closed this post - was that because you found an answer? I seem to recall that Amazon EC2 uses secure connections - it may be that while you can connect to port 80, it actually silently redirects to port 443 for HTTPS? Espruino wouldn't handle any redirections so that might be the issue? On the Pico and WiFi boards you can use HTTPS, but quite a lot of RAM is required for it. Posted at 2019-06-12 by 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 By removing the @MaBecker 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 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? Posted at 2019-06-13 by @gfwilliams Which board are you using? The 32 char limit is news to me @MaBecker - is it something specific to ESP8266? I'm afraid I have no idea about the connection issues - without any code it's pretty much impossible to diagnose, and I know I've tried Posted at 2019-06-13 by @MaBecker Yes, that was news for me too. Added a sdk non os 2v2 3.5.30. wifi_station_set_hostname |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2019-06-11 by 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
). Thews.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.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions