Additional information: after some time - several minutes, connection is possible again.
So it looks like web server is resseting this "inproper" state after few minutes.
But my question : how to close the socket correctly remains valid.
Anybody?
Search found 4 matches
- Tue Apr 15, 2014 8:38 pm
- Forum: STM32 Support
- Topic: HTTP Client for Chibios with LWiP
- Replies: 4
- Views: 5333
- Tue Apr 15, 2014 8:30 pm
- Forum: STM32 Support
- Topic: HTTP Client for Chibios with LWiP
- Replies: 4
- Views: 5333
Re: HTTP Client for Chibios with LWiP
Hi there,
I found the problem!
Whis was in line:
res = lwip_connect(sock, (struct sockaddr *)&serv_addr, sizeof (serv_addr));
Declaration of serv_addr was:
static char *http_request =
"GET / HTTP/1.0\r\nHost: 92.43.118.240\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image ...
I found the problem!
Whis was in line:
res = lwip_connect(sock, (struct sockaddr *)&serv_addr, sizeof (serv_addr));
Declaration of serv_addr was:
static char *http_request =
"GET / HTTP/1.0\r\nHost: 92.43.118.240\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image ...
- Mon Apr 14, 2014 5:19 pm
- Forum: STM32 Support
- Topic: HTTP Client for Chibios with LWiP
- Replies: 4
- Views: 5333
Re: HTTP Client for Chibios with LWiP
Here is the code I use:
#include "ch.h"
#include "lwip/opt.h"
#include "lwip/arch.h"
#include "lwip/api.h"
#include "lwip/sockets.h"
#define PORT 80
#include "client.h"
//#include <string.h>
static char *http_request =
"GET / HTTP/1.1\r\nHost: 192.168 ...
#include "ch.h"
#include "lwip/opt.h"
#include "lwip/arch.h"
#include "lwip/api.h"
#include "lwip/sockets.h"
#define PORT 80
#include "client.h"
//#include <string.h>
static char *http_request =
"GET / HTTP/1.1\r\nHost: 192.168 ...
- Sun Apr 13, 2014 8:22 pm
- Forum: STM32 Support
- Topic: HTTP Client for Chibios with LWiP
- Replies: 4
- Views: 5333
HTTP Client for Chibios with LWiP
Hi all,
I was trying to run HTTP client using Chibios and LWIP demo example for stm32 F4 Discovery.
I'm using sockets from LWip.
I wrote client thread which connects (lwip_connect), then sends HTTP request to server (lwip_write), then reads the response (lwip_read).
After running it:
a) connects ...
I was trying to run HTTP client using Chibios and LWIP demo example for stm32 F4 Discovery.
I'm using sockets from LWip.
I wrote client thread which connects (lwip_connect), then sends HTTP request to server (lwip_write), then reads the response (lwip_read).
After running it:
a) connects ...