-
Notifications
You must be signed in to change notification settings - Fork 555
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
How to enable Debug and Ratchet? #38
Comments
Replacing DEBUG_WEBSOCKETS with Serial.println i can see the moment of error. When call function acceptKey. The validation it is not working. From Firefox I connect in WebSocket Server. Any ideas for resolve this problem? |
For Example For send Web-Socket-Key 17Gf8QiZr8lDr/aU9ePVFQ== the correct Sec-WebSocket-Accept is rssLO9/Rz1QGFYktqTxzJ5viYUc=, but the function acceptKey returns Kfh9QIsMVZcl6xEPYxPHzW8SZ8w= |
do you use the ESP8266 or a ATmega? /// Serial
#define DEBUG_WEBSOCKETS(...) Serial.printf( __VA_ARGS__ )
/// Serial1
#define DEBUG_WEBSOCKETS(...) Serial1.printf( __VA_ARGS__ ) the avr not support printf for print class. #include <stdio.h>
static FILE uartout = {0} ;
static int uart_putchar (char c, FILE *stream)
{
Serial.write(c) ;
return 0 ;
}
void setup(void)
{
Serial.begin(115200);
fdev_setup_stream (&uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE);
stdout = &uartout ;
} #define DEBUG_WEBSOCKETS(...) printf( __VA_ARGS__ ) with printf you will see the acceptKey that is send to the server and the AcceptKey |
Hi @Links2004, thanks for the answer. But, replacing and testing, I got the problem above. |
try to change clientKey += "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; look like the + and = are mixed |
Wow @Links2004 . This Works like a charm! Very Very Thanks. Can i close this issue? |
Sorry for the noob question.
I see many times in issues the line for enable debug. In line 30 in WebSockets.h
But, i dont understand what i need put in line 30 for debug works.
I tried Serial, Serial1, Serial2, Serial3... But no ones works. In all cases i got an error in compilation.
I need to debug because Arduino is not connecting the WebSocket server made in Ratchet (PHP).
I see the connection in Ratchet console, but Arduino disconnects immediately following.
Anyone Can help me?
The text was updated successfully, but these errors were encountered: