Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Socket Connection Demo Hangs on "H" #7

Open
flimshaw opened this issue Nov 18, 2015 · 11 comments
Open

Socket Connection Demo Hangs on "H" #7

flimshaw opened this issue Nov 18, 2015 · 11 comments

Comments

@flimshaw
Copy link

Hey there,

Thanks so much for your work on this. I'm getting the following message in my serial console when trying to run the demo, seems like it's connecting but then crashing shortly after? Log is as follows:

Connecting to ****
...
WiFi connected
IP address:
10.10.10.106
Connected
Waiting...
H�

@creation9
Copy link

I have the same problem. I have narrowed it down to the analyserequest method in websocketserver.cpp. Once the header "upgrade: websocket" is recieved, serial.print prints out garbage. Im still digging.

@mattfelsen
Copy link

Just ran into this myself too. I set the serial port rate down to 9600 and things are working for me. Turns out that even with broken serial output, the code was still running fine, i.e. I had the module sending strings to a websocket server on my computer and they were coming in.

gifsicle

@deepikavira
Copy link

Hi Mattfelsen, what code were you running on the server side? this the output which I am getting stuck at:
WiFi connected
IP address:
172.16.42.43
Connected
þ

There is no response after that. Any idea what may be going wrong?

@creation9
Copy link

Like Mattfelsen said, the program is still running, it just looks like it
isnt. I don't use the esp's serial output in my recent projects right now.
My esp is just responding to json commands by controlling other devices.
Still havent figured out why the serial is freezing though.

On Mon, Feb 8, 2016 at 7:08 PM, deepika notifications@github.com wrote:

Hi Mattfelsen, what code were you running on the server side? this the
output which I am getting stuck at:
WiFi connected
IP address:
172.16.42.43
Connected
þ

There is no response after that. Any idea what may be going wrong?


Reply to this email directly or view it on GitHub
#7 (comment)
.

@mattfelsen
Copy link

@deepikavira It was just a simple websocket echo server written with node.js and ws. Did you try changing the serial port baud rate (both in the code and in the Arduino IDE serial monitor window)?

@deepikavira
Copy link

@mattfelsen thanks for the quick response. I did reduce the baud rate to 9600 but still no luck with the serial monitor.
It now shows the following:
WiFi connected
IP address:
172.16.42.43
Connected
Waiting...
ÿ

Anyway I think I will try giving it some functionality after the handshake and see if that works. @creation9 thanks for your quick response as well.

@mattfelsen
Copy link

@deepikavira If you're having trouble with this library, there's another arduino websocket server/client lib for esp8226 here: https://github.com/Links2004/arduinoWebSockets I haven't tried it myself, but could be helpful if you're stuck

@ildr3him
Copy link

+1

@sfa1906
Copy link

sfa1906 commented Mar 30, 2016

Was facing a similar problem..

// capture the value of analog 1, send it along
// pinMode(1, INPUT);
//data = String(analogRead(1));

data= "Hii";
webSocketClient.sendData(data);

Remove or comment-out the lines as shown above, put a string in 'data' variable and set the baud to 230400 and it works like charm..

@jthiller
Copy link

Based on @sfa1906's findings, thought I'd share my experience with this issue.
Setting pinMode(1, INPUT); inside of the loop seems to be the problem here.
By moving it into setup I've managed to clear the issue.

@aliwo
Copy link

aliwo commented May 19, 2017

jthiller, you are my savior

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants