Error with simple HTTP Request
Answer
10/10/18 1:51 PM

Hello, 

i tried the simple http request example from https://developer.appropos.de/xdk/protocols/http/

Using it as is, i got a response

INFO | XDK DEVICE 1: HTTP RESPONSE: 503 [text/html]
 INFO | XDK DEVICE 1: <html><body><h1>503 Service Unavailable</h1>
 INFO | XDK DEVICE 1: No server is available to handle this request.
 INFO | XDK DEVICE 1: </body></html>

 

Changing line 

Ip_convertOctetsToAddr(23, 22, 14, 18, &destAddr);

to 

Ip_convertOctetsToAddr(192,168,178,25, &destAddr);

which is a local server just returning "Hallo Welt"

results in

Failed to send HTTP request!

I extended the script at this particular line by

Retcode_RaiseError(status);

and it results in 

INFO | XDK DEVICE 1: Failed to send HTTP request!
 INFO | XDK DEVICE 1: Error in Unclassified package.
 INFO | XDK DEVICE 1: 	Package ID: 0	Module ID: 0	Severity code: 0	Error code: 1357

 

Any help appreaciated

 

kind regards

sven

0 (0 Votes)
RE: Error with simple HTTP Request
Answer
10/11/18 3:19 PM as a reply to Sven Kabitzki.
Hello Sven,

Due to your earlier HTTP response 503, which means the XDK was able to send a request, your code seems to be fine. Furthermore, the return code 1357 stands for RC_HTTP_SEND_ERROR which is listed within the file Serval_Exceptions.h .

In that regard, can you ensure that your local web server is connected to the same Wi-Fi network with the XDK? Additionally, did you test, if your local web server is reachable with another client except the XDK?

Please note, that your XDK needs to be connected to the same Wi-Fi network like your local web server and that the web server is reachable and ready to listen to requests.

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Votes)
RE: Error with simple HTTP Request
Answer
10/15/18 8:54 AM as a reply to Franjo Stjepandic.

Hello Franjo, 

 

thanks for your response. 

>In that regard, can you ensure that your local web server is connected to the same Wi-Fi network with >the XDK? Additionally, did you test, if your local web server is reachable with another client except the >XDK? 

I have a Hotspot configured on my laptop to which the xdk connects. 

Via this connection the first request (the sample) works.

the second request to a local xampp apache webserver doesnt. The xampp apache runs on the same laptop (its a complete local installation).

a third request to an inubit installation within a connected network doesnt work too. 

All Webservers are reachable by the laptop where the hotspot is configured to to which the xdk is connected. 

 

any suggestions ??

kind regards

sven

0 (0 Votes)
RE: Error with simple HTTP Request
Answer
10/15/18 3:07 PM as a reply to Sven Kabitzki.
Hello Sven,

thank you for getting more into detail.

On that behalf, could you share additional information about your method to test if the first request goes through? Do you use a timer task to send requests periodically or do you use only one request at all?

To establish a connection to your XAMPP apache server, which runs on your laptop, an additional configuration might be necessary, such as the host header. This could also come to play for the Inubit installation.

Furthermore, I assume you tried to reach the web servers with the same laptop that opens the hotspot? If this is true, is there a possibility to try a scenario with a third client?

Kind regards,
Franjo
0 (0 Votes)