Search found 4 matches

by pawelc06
Tue Apr 15, 2014 8:38 pm
Forum: STM32 Support
Topic: HTTP Client for Chibios with LWiP
Replies: 4
Views: 5333

Re: HTTP Client for Chibios with LWiP

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?
by pawelc06
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 ...
by pawelc06
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&#46;h>



static char *http_request =
"GET / HTTP/1&#46;1\r\nHost&#58; 192&#46;168 ...
by pawelc06
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 ...