I am currently working to improve a code to continuously send accelerometer and gyroscope values to a database. I have been given a code that already fetch data with REST services to a database.

But my problem is that even though I have edited the code in the XDk workbench, when I flash it onto the bosch XDK i can see it prints out the old code outputs like if my changes didn't changes anything inside the code.

did you rebuild your code after your editing? Otherwise you might have flashed your previous unedited code to your XDK, which would explain the behavior you describe.

Also, please be sure you edited and flashed the code within the source code of your chosen project and not by mistaken to a different project's source code, which you also could have opened in the XDK-Workbench.

So, before you flash, be sure, the edited source code belongs to your project and also you selected the right project, which is to flash within the Project Explorer and, very important, to build the chosen project before flashing it. To prevent flashing the wrong project I would always recommend to close all other projects in your workspace. In addition, before you initialize the flashing process, I recommend to send your XDK manually into the bootloader mode. This can be done by turning off the XDK, holding button one pressed and turning the XDK on again. Release button one after turning on the XDK and your XDK should connect to the XDK-Workbench in bootloader mode, ready to be flashed.

Please tell me if this was helpful, and do not hesitate to ask further questions.

And yes i have been building my project before flashing it making sure it is the correct project as well. I'm not sure what you mean by "you edited and flashed the code within the source code of your chosen project" but as i always build and flash the correct code I think i am doing it right.

I am now always making sure to be in bootloader mode, thanks for that but as the problem is still present i have decided to rewrite the entire code into a new project using the XdkApplicationTemplate as a base and called it 'Essai' in a new workspace called 'WS', and when building i get this type of error message, maybe you could help me out on this one.

"

make[1]: *** No rule to make target `/Users/philibertdebroglie/Documents/WS/Essai/debug/objects/XdkApplicationTemplate.o', needed by `/Users/philibertdebroglie/Documents/WS/Essai/debug/XdkApplicationTemplate.out'. Stop.

I assume that this error results from an issue with your project folder path.

Could you provide me a screenshot of the environment variables you are using? To access these properties, please click on the XDK-Workbench top menu File , select Properties . Within the new opened popup window, browse to C/C++ Builder , followed by a click on Environment . You will see a table of variables, values and their origin. This is exactly the information, I require. Would you post this information in a screenshot?

Please tell me if this was helpful, and do not hesitate to ask further questions.

Hello Phil, you are right, that the error results from the folders.*** target pattern contains no `%' is a badly written message from make. It means "one of your filenames had a character that could be part of a regular expression". Could you please check your folder paths again and make sure that there is no character messing with make?

In addition could you provide me a screenshot of the entire error message you receive?

Please tell me if this was helpful, and do not hesitate to ask further questions.

thank you for providing the screenshot and also for trying several things.

Regarding the error you showed me in the latest screenshot, I assume, that the error is the missing , in line 86 (Compare it to line 93).

Anyway, I suggest you to try it with a different way. The naming of the XdkApplicationTemplate.c signals me, that you are running an older version of the XDK-Workbench.

The SDK from XDK-Workbench version 3.3.1 to XDK-Workbench version 3.4.0 improved due to many changes.

By installing the latest XDK-Workbench version, the current issues might be gone.

After installing the latest XDK-Workbench, please be sure to start with a clean, new XDK-Workspace and, to prevent further issues, do not import projects from earlier XDK-Workbenches into the new Workspace. The SDK changed and could result in errors with earlier projects.

You better create a new XdkApplicationTemplate from the XDK-Workbench 3.4.0 and then adapt this to your needs.

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

Okkay I have now downloaded the 3.4.0 XDK version and started working with it. But therefore have started my project all over again. I am investing the development of HttpExampleClient and the BoschXDKCloudConnectivity projects, in order to send XDK's accelerator and gyroscope data via post function to a database stored in a cloud server.

Thank you for the help you provided me with. I might ask you some more if I face some new issues.

I have been working over the HttpExampleClient project, and i have run the project after settting my wifi configuration. And it seems to work as the console outputs shows it. But Can i observe any kind of results on the postman-echo.com website?

Furthermore, I would like to ask you, if i want to push some sensors data to a database in a cloud server, I have to use POST request using the REST API is that it ?

Hello Phil, yes you can receive a response after a successful transfer of data to the server. Depending on the serversided implementation, different data is returned. I recommend you to read the docs of the Postan Echo service here . Especially the chapter request methods is important.

Regarding your second question: This depends on the cloud server. A server that supports the REST API will accept data from the POST request. Please tell me if this was helpful, and do not hesitate to ask further questions.

So right now I am trying to send the accelerometer and gyroscope data to a database in a server.

I have started to implement the Post method by following The http exalmple and guide. However, I am quite unsure of how should I "insert" the data from the sensors into the payload ? Any tips on how i could do so correctly ?

Please note, that the buffer jsonFormat holds your actual JSON format and that the temperature and timestamp data is then serialized over the function snprintf() into the buffer http_buffer , which should be send out via your POST requests. The variable HTTP_BUFFER_SIZE holds the fixed length of the http_buffer , while the variable length holds the actual elements within the buffer.

Please tell me if this was helpful, and do not hesitate to ask further questions.

first of all, I have to please you to keep the mentioned HTTPRestClientPostInfo structure original and do not edit it at all.

.Payload = POST_REQUEST_BODY,

.PayloadLength = (sizeof(POST_REQUEST_BODY) - 1U),

These two parameters have to stay the same, otherwise the HTTPExampleCLient will not work.

The code-snippet I provided you in my last post has to be implemented inside the while-loop of the AppControllerFire() function, between the AppControllerValidateWLANConnectivity() and HTTPRestClient_Post() functions.

You have to access both members, payloadLength and also payload , of the HTTPRestClientPostInfo structure individually, like shown below:

The line uint16_t http_buffer[HTTP_BUFFER_SIZE]; has to be changed in two ways. First of all, this should not be at the beginning of the implementation file, but needs to be placed into the AppControllerFire() function. Second, the datatype of the buffer should be char and not uint16_t .

Regarding the question about the variable POST_REQUEST_BODY , are you correct, its content will be sent to the HTTP server. But through the line HTTPRestClientPostInfo.Payload = http_Buffer; , you define, that the http_buffer is sent instead of the variable POST_REQUEST_BODY . Furthermore, since you already defined a payload , you can delete the declaration static char payload[4000]; .

The definition HTTPRestClientPostInfo.PayloadLength = length -1; defines the PayloadLength , which is the element for the payload length in the HTTPRestClientPostInfo struct.

The publishBuffer refers to your http_buffer , here I just used a different name.

The error 3202 from the HttpRestClientPostResponseCallback() function refers to RC_REST_BINDING_PARSING_ERROR , which tells you, that there is an issue with parsing a JSON Data Form. I assume the issue results from the post function expecting a JSON string while your payload is a integer value. With the changes above, I assume that the error will be solved.

Please let me know if this was helpful, and do not hesitate to ask further questions.

I managed to get errors fixed and also was able to fit all the data i wanted into the http_buffer (I verified this by printing the buffer on the console).

I still get the error 3202, but it doesn't seems to prevent the code to send POST request and get answers from the server.

I have now implemented a database and am using the Xampp software that creates a local host server where my database stands, and i am trying to send my data to it.

I have joined the errors I have now. (I have tried several things into DEST_SERVER_HOST such as 127.0.0.1, 127.0.0.1:8080, 127.0.0.1:80)

I think the error i am facing is due to the fact that I have assigned an IP adress to the DEST_SERVER_HOST in the header file instead of a server name. But I don't know how to overcome this. Is there another way to access a local host server ?

I am glad to hear that you were able to fix the errors and to fill the sensor data into the http_buffer .

In regards to the error 3203 , this error code is corresponding to the serval stack enumeration RC_REST_BINDING_PARSING_ERROR . In detail, it means that the range information cannot be extracted from the HTTP response.

Since it always gets triggered by the HTTP response, it will not interfere with the sent sensor data via the POST requests and can safely be ignored. Otherwise, I would recommend inserting the range information on the server side into the HTTP header.

In regards to sending data to your notebook/pc, the IP address 127.0.0.1 is the IPv4 address for the localhost. This address can be used to access and test running server on your notebook with an installed browser such as Firefox , Google Chrome or any other browser.

It is not the IP address your notebook/pc gets assigned within your local network and that is the reason, why the XDK is unable to send the sensor data to your notebook/pc.

To solve the issue, you would need to insert the correct IP address assigned in your local network. For that, you can simply use a network program such as Network Scanner or by using the online tool whatismyip where you also get your local IP address.

Additionally, please note that your laptop/pc would need to be in the same Wi-Fi network as the XDK to receive the XDKs HTTP requests.

Thanks for the tips, I have done what you said (and Yes I was using the same wifi for my laptop and XDK sensor). Using the website you recommended I have set up the IP adress assigned by the local network in the header file but I still have some errors. After trying severals things, (setting the STATIC IP parameters, I am still facing some issues) I don't know why there are still some errros with POST request.