HttpClient initialization
Answer
2/26/16 8:12 AM
Hello,

I am trying to send HTTP requests via WIFI. I managed to connect to my access  point but in the next step I added following lines:

if (HttpClient_initialize() != RC_OK)
{
    printf("Error occurred initializing HttpClient\n");
}

It build, but after flashing, the XDK lights all three LEDs and sends this curious line:

INFO | XDK DEVICE 1: asserted at Filename C:/XDK-Workbench/SDK/xdk110/Libraries/FreeRTOS/BCDS_Customization/../FreeRTOS/source/queue.c , line no 599

No response after that. What is the solution? Or is there a possibility to send a HTTP request without HttpClient_initialize()?

Thanks,
Jürgen
 
0 (0 Votes)
HttpClient initialization
Answer
2/28/16 5:02 PM as a reply to Jürgen Schuster.
Hello Juergen,

the line means that an assertion in the called function failed (that's also the reason for the LEDs):
http://xdk.bosch-connectivity.com/xdk_docs/html/_x_d_k__operation__modes.html

Do you use the HttpExampleClient demo project? If not, please compare your code to that project. Did you, for example, initialize the the PAL and WLAN modules before the initialization of the HTTP client?

Kind regards,
Manuel
0 (0 Votes)
HttpClient initialization
Answer
2/29/16 6:09 AM as a reply to Manuel Cerny.
Hello Manuel,

In the IDE, HttpExampleClient shows an error (Symbol 'Http_StatusCode_OK' could not resolved), so first I didn't tried it. But it builds and runs as I see now. Actually, in my own project I forgot to initialize PAL like you said, with PAL it works.

Thanks for the help,
Jürgen
0 (0 Votes)
HttpClient initialization
Answer
2/29/16 9:15 AM as a reply to Jürgen Schuster.
Hello Manuel,

Because our XDK is not registrated, it has no acces to the Internet. So I connect it to a isolated WLAN router, which works. But the GET request to the router delivers the status code 0x51d. I used the - slightly modified - example HttpExampleClient, IP address is 192.168.178.1 (0x1b2a8c0). The request reaches the webserver, I tested it by sending it to another device (192.168.178.21/0x15b2a8c0), with a webserver which shows its calls. But the status in httpClientResponseCallback() is 0x51d, too. There seems to be no appropriate status code in Serval_Exceptions.h (The upper 7 bits are 0xa, which means RC_MODULE_XUDP, really?). What's that error?

Thanks,
Jürgen
0 (0 Votes)
HttpClient initialization
Answer
3/1/16 7:41 PM as a reply to Jürgen Schuster.
Hello Juergen,

the code 0x51D actually is defined in Serval_Exceptions.h

#define RC_SHIFT_SEVERITY        6
...
#define RC_SEVERITY_MINOR     (0x0 << RC_SHIFT_SEVERITY)
...
#define RC_SHIFT_MODULE          8
...
#define RC_MODULE_HTTP           (0x05 << RC_SHIFT_MODULE)
...
enum retcode_e
{
...
RC_HTTP_INVALID_RESPONSE =
        0x1D | RC_MODULE_HTTP | RC_SEVERITY_MINOR,
...
}


This means that the response from your server is received, but is probably invalid.

Kind regards,
Manuel
0 (0 Votes)
HttpClient initialization
Answer
3/2/16 8:56 AM as a reply to Manuel Cerny.
Hello Manuel,

In my SDK, there are two different files called Serval_Exceptions.h and I read the other file with:
#define RC_SHIFT_MODULE 7
There are many more files in two different versions. How can I or someone know which file is the right one?

Thanks,
Jürgen
0 (0 Votes)
HttpClient initialization
Answer
3/5/16 9:59 AM as a reply to Jürgen Schuster.
Hello Juergen,

I can't find any duplicate files in my SDK. I have only one Serval_Exceptions.h located at
[WORKBENCH-FOLDER]\SDK\xdk110\Libraries\Serval\ServalStack\api
Can you give me the complete path of the both files? And maybe some others, if you see a pattern?

Kind regards,
Manuel
0 (0 Votes)
HttpClient initialization
Answer
3/3/16 5:39 AM as a reply to Manuel Cerny.
Hello Manuel,

The paths are:
C:\XDK-Workbench\SDK\lib\ServalStack\api\ServalExceptions.h
C:\XDK-Workbench\SDK\xdk110\Libraries\Serval\ServalStack\api\ServalExceptions.h
The longer path is the new one, right? There are many files both in SDK\xdk110\... as in SDK\lib\... or SDK\platform\. May the duplicates come from previous Workbench versions?

Bye,
Jürgen
0 (0 Votes)
HttpClient initialization
Answer
3/5/16 10:01 AM as a reply to Jürgen Schuster.
Hello Juergen,

yes, you seem to have two SDK versions in parallel. You could uninstall all your workbench installations, delete the folders and reinstall the new one.

Kind regards,
Manuel
0 (0 Votes)