Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not connect with ESPAsyncTCP! #173

Open
tinamore opened this issue Feb 27, 2017 · 3 comments
Open

Can not connect with ESPAsyncTCP! #173

tinamore opened this issue Feb 27, 2017 · 3 comments

Comments

@tinamore
Copy link

tinamore commented Feb 27, 2017

Hi,
when i run with "WEBSOCKETS_NETWORK_TYPE NETWORK_ESP8266" is GOOD
But when i active NETWORK_ESP8266_ASYNC, then i can not server socket.io.
This is log:

[WS-Client][sendHeader] sending header... Done (15217us).
[WS-Server][0] Disconnect client
[WS-Client] asyncConnect...
[WS-Client] connected to reserve-hk.mydomain.com:3000.
[WS-Client][sendHeader] sending header...
[WS-Client][sendHeader] handshake GET /socket.io/?EIO=3&transport=websocket&sid=1EeDZIBT_OxiJaDMAAAH HTTP/1.1
Host: reserve-hk.mydomain.com:3000
Connection: Upgrade
Upgrade: websocket
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: S8BcSOKBA1Urz13kLblhOA==
Sec-WebSocket-Protocol: arduino
Origin: file://
User-Agent: arduino-WebSocket-Client

[WS-Client][sendHeader] sending header... Done (13542us).
[WS-Client][handleHeader] RX: Session ID unknownHTTP/1.1 400 Bad Request
[WS-Client][handleHeader] RX: Connection: close
[WS-Client][handleHeader] RX: Content-type: text/html
[WS-Client][handleHeader] RX: Content-Length: 18
[WS-Client][handleHeader] Header read fin.
[WS-Client][handleHeader] Client settings:
[WS-Client][handleHeader]  - cURL: /socket.io/?EIO=3
[WS-Client][handleHeader]  - cKey: S8BcSOKBA1Urz13kLblhOA==
[WS-Client][handleHeader] Server header:
[WS-Client][handleHeader]  - cCode: 200
[WS-Client][handleHeader]  - cIsUpgrade: 1
[WS-Client][handleHeader]  - cIsWebsocket: 1
[WS-Client][handleHeader]  - cAccept: haqBuucO/RQ9+lB+pwvIwd0gCE0=
[WS-Client][handleHeader]  - cProtocol: arduino
[WS-Client][handleHeader]  - cExtensions: 
[WS-Client][handleHeader]  - cVersion: 0
[WS-Client][handleHeader]  - cSessionId: 1EeDZIBT_OxiJaDMAAAH
[WS-Client][handleHeader] Sec-WebSocket-Accept is wrong
[WS-Client][sendHeader] sending header...
[WS-Client][sendHeader] handshake GET /socket.io/?EIO=3&transport=websocket&sid=1EeDZIBT_OxiJaDMAAAH HTTP/1.1
Host: reserve-hk.mydomain.com:3000
Connection: Upgrade
Upgrade: websocket
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: 3RwKajA9ee9RulE7vPVI0w==
Sec-WebSocket-Protocol: arduino
Origin: file://
User-Agent: arduino-WebSocket-Client

how fix issue ?

@Links2004
Copy link
Owner

looks like the event flow for async goes wrong with socket.io.

@shrynshjn
Copy link
Contributor

Hi @Links2004 ,
The problem still persists, are you or anyone working on the same?
The socket.io client connects to the server in async mode, but is not able to exchange data. And ping timeouts.
Is there any work around to the problem, if you can guide me towards what changes needs to be done, I can try to implement them and create a PR.
Thanks

@shrynshjn
Copy link
Contributor

This is the output i get in async mode
5:18:45.157 -> [WS-Client][sendHeader] sending header... Done (42721us). 15:18:45.157 -> [WS-Client][handleHeader] RX: HTTP/1.1 101 Switching Protocols 15:18:45.157 -> [WS-Client][handleHeader] RX: Upgrade: websocket 15:18:45.157 -> [WS-Client][handleHeader] RX: Connection: Upgrade 15:18:45.157 -> [WS-Client][handleHeader] RX: Sec-WebSocket-Accept: HAKSJDIUdegk78bfrPRgPkkeeqw= 15:18:45.187 -> [WS-Client][handleHeader] RX: Sec-WebSocket-Protocol: arduino 15:18:45.187 -> [WS-Client][handleHeader] Header read fin. 15:18:45.187 -> [WS-Client][handleHeader] Client settings: 15:18:45.187 -> [WS-Client][handleHeader] - cURL: /socket.io/?transport=websocket&<other params here> 15:18:45.236 -> [WS-Client][handleHeader] - cKey: /eV575vyUW8kN49xpUHfyw== 15:18:45.236 -> [WS-Client][handleHeader] Server header: 15:18:45.236 -> [WS-Client][handleHeader] - cCode: 101 15:18:45.236 -> [WS-Client][handleHeader] - cIsUpgrade: 1 15:18:45.236 -> [WS-Client][handleHeader] - cIsWebsocket: 1 15:18:45.236 -> [WS-Client][handleHeader] - cAccept: HAKSJDIUdegk78bfrPRgPkkeeqw= 15:18:45.236 -> [WS-Client][handleHeader] - cProtocol: arduino 15:18:45.236 -> [WS-Client][handleHeader] - cExtensions: 15:18:45.236 -> [WS-Client][handleHeader] - cVersion: 0 15:18:45.236 -> [WS-Client][handleHeader] - cSessionId: 15:18:45.236 -> [WS-Client][handleHeader] still missing cSessionId try socket.io V3 15:18:47.669 -> sleep disable

also when pinging

15:19:24.436 -> [wsIOc] send ping 15:19:24.436 -> [WS][0][sendFrame] not in WSC_CONNECTED state!?

any idea on why this is happening and how to solve it?

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

No branches or pull requests

3 participants