Code not updating
Answer
11/14/18 4:03 AM

Hello everyone,

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.

Any help will be appreciated,

Thank you

Phil

0 (0 Votes)
RE: Code not updating
Answer
11/14/18 8:56 PM as a reply to Philibert de Broglie.
Hello Phil,

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.

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
11/15/18 8:20 AM as a reply to Franjo Stjepandic.

Hello Franjo,

 

First of all thank you for your quick answer and tips !

 

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.

make: *** [debug] Error 2

"

Kind regards,

 

Phil

0 (0 Votes)
RE: Code not updating
Answer
11/15/18 11:06 PM as a reply to Philibert de Broglie.
Hello Phil,

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.

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
11/16/18 3:38 AM as a reply to Franjo Stjepandic.

Hello Franjo,

 

I think the error was coming from the way I called my folders, when i changed it,  the error disapeared but still got some other errors while building the code such as "

/Users/philibertdebroglie/Documents/WS/StreamSensorDataOverREST/debug/objects/./../Platform/Utils/source/RSM_retargetStdioMessage/retargetio.d:1: *** target pattern contains no `%'.  Stop.

make: *** [debug] Error 2

"

Please Find attach the Screenshot.

 

Kind Regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
11/19/18 2:15 PM as a reply to Philibert de Broglie.
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.

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
11/20/18 8:24 AM as a reply to Franjo Stjepandic.

Hello Franjo,

 

So currently I am writting on two things, The code i was given that we have been talking about. (which won't update and shows the following error message in the console.

"

/Users/philibertdebroglie/Documents/new/Original/final_code_v1/StreamSensorDataOverREST/debug/objects/./../Platform/Utils/source/RSM_retargetStdioMessage/retargetio.d:1: *** target pattern contains no `%'.  Stop.

make: *** [clean] Error 2

"

And I also have started to write a new code on the side as it might be quicker. And i got some different erro which i dont have a clue why it appear, i will also share a screenshot.

 

I don't know how to "make sure that there is no character messing with make", where can I check this ?

Thanks for you help

Kind regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
11/20/18 4:31 PM as a reply to Philibert de Broglie.
Hello Phil,

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.

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
11/23/18 4:44 AM as a reply to Franjo Stjepandic.

Hi Franjo,

 

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.

Kind regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
11/23/18 10:15 AM as a reply to Philibert de Broglie.

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 ? 

Kind regards

Phil

0 (0 Votes)
RE: Code not updating
Answer
11/23/18 2:37 PM as a reply to Philibert de Broglie.
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.


Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
11/28/18 10:46 AM as a reply to Franjo Stjepandic.

Hello franjo,

Once again, I want to thank you for the help.

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 ? 

Kind Regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
11/28/18 4:50 PM as a reply to Philibert de Broglie.
Hello Phil,

in regards to adding sensor data to the payload, I recommend you to use a JSON string, you can build this as follows:
 
const char *jsonFormat = "{\"timestamp\":\"%d\", \"temperature\":\"%d\"}";
int Length = snprintf(http_buffer, HTTP_BUFFER_SIZE, jsonFormat,(int) timeStampValue,temperatureValue);
uint16_t payloadLength = (uint16_t) strlen(payload);

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.

Kind regards,
Franjo
+1 (1 Vote)
RE: Code not updating
Answer
11/29/18 7:25 AM as a reply to Franjo Stjepandic.

Hi Franjo,

Thank you for that hint ! it helps a lot

Writting over the HttpExampleClient code i have made several changes to achieve my needs.

So what I did is that I've copied the bit of code you gave me at the top of my code (should it be somewhere else?? ) and I get errors with this line of code "

uint16_t payloadLength = (uint16_t) strlen(payload);

"

It says the "initializer element is not constant" which I am not sure what it means, plus I have declared payload as follow: "static char payload[4000];" as it was not recognized.

 I also had to change the attribute of payload and payloadlength in this following code snipet so the POST request send the Accel and Gyroscope data, Am i doing it right ?

static HTTPRestClient_Post_T HTTPRestClientPostInfo =
        {
                .Payload = http_buffer,
                .PayloadLength = HTTP_BUFFER_SIZE,
                .Url = DEST_POST_PATH,
                .RequestCustomHeader0 = POST_REQUEST_CUSTOM_HEADER_0,
                .RequestCustomHeader1 = POST_REQUEST_CUSTOM_HEADER_1,

        }; /**< HTTP rest client POST parameters */

 

I'm still going over the code trying new things, but I think this hould be the correct way to opperate.

Thank you for your help,

kind regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
11/29/18 3:03 PM as a reply to Philibert de Broglie.
Hello Phil,

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:
 
  • HTTPRestClientPostInfo.Payload = publishBuffer;
  • HTTPRestClientPostInfo.PayloadLength = length -1;

If you have issues or any other questions, do not hesitate to ask.

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
11/30/18 9:12 AM as a reply to Franjo Stjepandic.

Hello Franjo,

Am I right when I define a the start of the code as follow

"

#define HTTP_BUFFER_SIZE  UINT8_C(6) /**< Number of Accelerometer & Gyroscope axis (x, y & z) */

uint16_t http_buffer[HTTP_BUFFER_SIZE] = { 0 };

static char payload[4000];

"

Okkay so I have changed back the parameters as you advised me to do. But doesn't it mean that the "POST_REQUEST_BODY" will be sent to the server ?

In order to access both members, payloadLength and also payload I have added the lines you gave me under the ones given before, is that right ? And what does publish buffer refers to?

I also have the following error message everytime:

"

 INFO | XDK DEVICE 1: HttpRestClientRequestSentCallback: HTTP request sent successfully.

 INFO | XDK DEVICE 1: HttpRestClientPostResponseCallback: failed to get range from message. error=3202

 INFO | XDK DEVICE 1: HttpRestClientPostResponseCallback: HTTP rest client POST was successful.

"

Also Is there anyway to see the data on the server ? I am only able to see the console outputs.

Kind Regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
11/30/18 1:55 PM as a reply to Philibert de Broglie.
Hello Phil,

the definition of the HTTP_BUFFER_SIZE is correct.

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.

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
12/4/18 2:20 AM as a reply to Franjo Stjepandic.

Hi franjo,

Thanks for your last message which was very helpful! 

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 ?

0 (0 Votes)
RE: Code not updating
Answer
12/4/18 3:54 PM as a reply to Philibert de Broglie.
Dear Phil,

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.

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
12/5/18 11:18 AM as a reply to Franjo Stjepandic.

Hey Franjo,

 

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.

Maybe you know what i am doing wrong here ?

Kind regards, 

Phil

0 (0 Votes)
RE: Code not updating
Answer
12/12/18 4:33 PM as a reply to Philibert de Broglie.
Dear Philibert,

You only need to add a static IP configuration if the Wi-Fi network you are connected to requires that. Otherwise, since your XDK is connecting to a hotspot provided by your iPhone, DHCP should normally be used in the iPhones default configuration.

In regards to your error code, the error code 1357 from the ServalStack as well is as the error code 98 is pointing to a failed HTTP request. Additionally, the error code 1387 from the ServalStack and the error code 95 are pointed to a not received HTTP response.

I assume both causes are connected to the fact that your HTTP server is not reachable. In fact, could you go more detail about how you set up the HTTP server? As I can observe on your first screenshot, you tried to implement its implementation in the application project for the XDK? Am I right so far?

If that is the case, then please note that the XDK-Workbench is only designed for the purpose to implement applications for the XDK and not for the companion components such as the HTTP server you require. This would need to be implemented in a different IDE.

Otherwise, please go more into detail about your HTTP server.

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: Code not updating
Answer
12/20/18 6:48 AM as a reply to Franjo Stjepandic.

Dear Franjo,

Thank you for your message, you were right about my http implementation.

I therefore stick to the postman-echo.com server for now as I am still testing things.

I have been able to perform the request as i wanted, but recently I have been facing some kind of errors within XDK workbench. Maybe you can help me ?

 

First of all, the "XDK devices" tab does not detect the XDK automatically I always have to press the reload button in order for it to see the device in the right mode. 

Second problem which is more important, is that whenever i flash my code to the XDK, the application doesn't launch, or at least the console doesn't show anything. (please refer to my console screenshot)

Therefore, I canno't experiment any new version of my code which is very unconvenient as you can imagine, and I don't understand why it is doing this.

 

Thank you for your help.

Kind regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
12/20/18 2:45 PM as a reply to Philibert de Broglie.
Hello Philibert,
could you try to set the XDK in bootloader mode and connect it then to the PC. Simply turn the XDK off, hold the button 1 and turn the XDK on again and release the button 1 after 1 sek.

Regarding the second issue, please try to clean the code first (clean project) and build it again.
Last but not least, I would recommend you to reinstall the workbench. But try the other solutions first please.

Please try this step and report an update.
If you have any questions, feel free to ask.

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
1/3/19 3:59 AM as a reply to Franjo Stjepandic.

Hello Franjo,

I had already set the XDK in Bootloader mode (i do this every time before flashing a code), but recently the software doesn't detect the connected devices or its mode changes on its own; i have to reload the "XDK Devices" tab in order for it to be updated. 

After following your advices I have donwloaded again the XDK 3.4.0 for my mac and unfortunately I'm still facing the same probelms. THe code is built and cleans correctly as well as the flashing process. But once the code is in the XDK the console output is stuck at " INFO | XDK DEVICE 1:  Jumping to application" even though the XDK is being changed to application mode, nothing happens from there in the console. But i think the XDK is behaving well and collecting sensors data. I guess it's the workbench that has a problem. I will probably try installing the newest XDK workbench version, which hopefully will fix the problem.

Thanks for your continuous help,

Kind regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
1/3/19 4:54 PM as a reply to Philibert de Broglie.
Hello Philibert,

thank you for the additional insight on the issue.

Could you please try a simple example from the XDK-Workbench. It would help us to understand if the issue results from your project or is a general issue with the XDK-Workbench.
Please keep me updated on your progress.

If you have any questions, feel free to ask.

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
1/4/19 11:03 AM as a reply to Franjo Stjepandic.

Hello Franjo,

 

I have tried with the "SendAccelDataOverUdpAndBle" example, and it resulted with the same problem, the console stop printing out after the " INFO | XDK DEVICE 1:  Jumping to application" line...

This was tried with the 3.4.0 version, I will install the newest one soon and hope for the problem to be then fixed.

Thanks,

Kind regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
1/4/19 4:02 PM as a reply to Philibert de Broglie.
Hello Philibert,

Do you have a J-link?
If so you could use it to set breakpoints and analyse the startup process. Documentation on the J-Link debugger can be found at here .

Aside from that could you please provide a screenshot of the console of the XDK-Workbench, the ootloader version on the XDK and the Bootloader version you build the projects with in the Preferences of the XDK-Workbench.
Additionally, could you also provide the serial number of the XDK you are using?

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
1/8/19 7:38 AM as a reply to Franjo Stjepandic.

Hello Franjo,

I have downloaded the 3.5.0 workbench but unfortunately still get the same problems.

I do not have a J-Link account. 

My bootloader version is the same as from the start 0.0.9

Please Find Attached the screenshot of the workbench after flasing the code on the XDK device.

kind regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
1/8/19 3:30 PM as a reply to Philibert de Broglie.
Hello Philibert,

Thank you for proving further information on the Bootloader version.
Unfortunately it seems, that you XDK is one of the first generation from 2015/2016 and therefore has the first and oldest bootloader version flashed onto it.
I strongly assume, that it is necessary for you to get a J-Link adapter to update the bootloader version on the XDK to solve this issue. Otherwise it will most likely persist.

If you intend to order the J-Link Lite , please inform the SEGGER sales team that you will use the J-Link Lite for the XDK. The J-Link Lite is not sold otherwise.

Please note, the investment into the J-Link is always recommend since then you are able to debug your code more effectively stepping from the different implementation steps at runtime.

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

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
1/9/19 3:43 AM as a reply to Franjo Stjepandic.

Hello Franjo,

Thanks for you reply. 

I will have a look at the J-Link thanks.

The thing is it was working fine until then, I was using the same Bootloader version and suddenly it just bugged out, which i find weird.

Kind Regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
1/9/19 4:55 PM as a reply to Philibert de Broglie.
Dear Philibert,

I am always glad to help. In regards to the now starting flashed XDK application. Did you make lately an update of your macOS? Furthermore, I would like to analyze this in greater detail, could you please tell me which kind of macOS you are currently using?

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
1/11/19 3:11 AM as a reply to Franjo Stjepandic.

Hi Franjo,

Yes i deed a Mac Os upgrade recently and I have been thinking it could be the reason of these problems as they happenend to occur after that upgrade. I am now using Mac OS Mojave 10.14.2

I have been able to read the XDK workbench outputs by using the Usb serial port on the terminal window, but it seems that i'm facing my first problem again... The code is not updating to its latest version, though I am using the latest version of the workbench.

Kind regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
1/11/19 9:04 AM as a reply to Philibert de Broglie.

Hi Franjo,

I have now started working on a windows machine as it might be my mac that was the problem.

I have written my code again and I am now facing that weird issue I never had before (i have checked my code is the same to the other one). I am using the 3.5.0 workbench.

Please find attached the picture

Kind regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
1/11/19 3:24 PM as a reply to Philibert de Broglie.
Hello Philibert,

About your first post regarding the OS,
I assume that the update might cause an issue with application privileges for the XDK-Workbench,
resulting in a blocked communication to the XDK.

To be certain I will take a detailed look into this too.

About the missing declarations,
Did you verify that you included all of the requirements for the sensor setup, such as the interface XDK_SensorHandle.h ?
The errors you are receiving from the compiler of the XDK-Workbench is indicating that.

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: Code not updating
Answer
1/14/19 4:58 AM as a reply to Franjo Stjepandic.

Hello Franjo,

Thank you for all your advices and help.

I was missing the "XDK_SensorHandle.h" but it dind't seem to changes anything as i still get the same errors. I have added a few more, but I have joined a snippet of the interfaces header files so maybe you will find the missing one. Also is there somewhere I could find all the header files available for the XDK ? 

Also, I am in India and therefore if I want to print out the timestamp should i use a different sntp than "0.de.pool.ntp.org" ? 

Kind regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
1/14/19 5:08 PM as a reply to Philibert de Broglie.
Dear Philibert,

The inclusion of XDK_Sensor.h should solve the issue with the missing references. Here I have to made a slight correction to my last post, the references for the functions Sensor_Setup() , Sensor_Enable() and Sensor_GetData() are established with the inclusion of the interface XDK_Sensor.h instead of the interface Xdk_SensorHandle.h .

The interface XDK_SensorHandle.h is used to establish the references for the advanced functionality of each XDK sensor, except the noise sensor.

Furthermore, it is also included within the implementation file Sensor.c and does not need to be added exclusively to the includes of your XDK application.

Nevertheless, the inclusion of XDK_Sensor.h should solve your issue with the undefined references. Did you ensure to save the project, before you attempt a new build? Otherwise, did you tried to clean the project first and then build it again?

In regards to the SNTP server, you can use the SNTP server which suits your usecase best. The SNTP server 0.de.pool.ntp.org is only configured due to demonstration purpose.

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: Code not updating
Answer
1/17/19 6:42 AM as a reply to Franjo Stjepandic.

Dear Franjo,

As you might have seen it in the above screenshot, "XDK_Sensor.h" was already included in my code from the start, this is why I don't get where the error message is coming from as it appear I have included all the necessary. Also I am always saving the code after any change and cleaning the project before I build it.

I have managed to get rid of thoses errors by writting the code over again in the "XdKApplicationTemple" project template. The code works perfectly fine.

But once I tried inserting current time in the code I got some mistake in the SDK folders (please find attached the screenschot).

kind regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
1/17/19 3:17 PM as a reply to Philibert de Broglie.
Hello Philibert,

Thank you for clarifying. It might appear that a project setting got corrupted and that is the inclusion was not recognized. But I am glad to hear that porting your source code to a clean XdkApplicationTemplate .

Furthermore, could you please elaborate about what you mean with a mistake in the SDK folders.
The first line in the console of your provided screenshot states, that there is an undefined reference to the function _gettimeofday . This is the cause, why the make process is failing.

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: Code not updating
Answer
1/18/19 6:27 AM as a reply to Franjo Stjepandic.

Dear Franjo,

Last error was due to a wrong declaration of a variable I didn't notice at first but is now fixed. I will have a look on some other threads to get the correct way of getting the current time. 

Maybe you could advise me some threads?

I am basically trying to get the XDK position from it's acceleration using simple physical laws (p= p0 + V0*t + 0.5*A*t^2) and need a time base as the position is calculated with difference in time between the two measurements.

I also want to printout the timestamp of the actual date and time.

Thank you for your advices.

kind regards,

Phil

0 (0 Votes)
RE: Code not updating
Answer
1/18/19 2:33 PM as a reply to Philibert de Broglie.
Hello Philibert,

You could do this in a number of different ways, depending on accuracy requirement and connectivity.

If you have a reliable Wi-Fi connectivity available the easiest solution would be the SNTP module, which provides you with an accurate time and date.

The second solution, if you, for example, moved in a wider area, you can use functions of the FreeRTOS system.
Using vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement )
would provide the easiest solution for creating steady time the increments.
However, this will not be quite as accurate as the system clock drifts with temperature.
I'd also suggest you look at such implementations with FreeRTOS as keyword as there are more platforms besides the XDK using that.
Another place where you could find code using the FreeRTOS system clock would be the implementation file SNTP.c you can find inside


SDK > xdk110 > Common > source > utility .

Then you still are required to initialize your application with a date as you described which unfortunately cannot be done other than with SNTP.

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
1/22/19 11:19 AM as a reply to Franjo Stjepandic.

Hello Franjo,

 

Thank you for your tips and explanations. I have decided to go for the sntp method as i need accuracy. And i found some useful tips on other threads.

The Thing is, it prints it out in terms of seconds is there a way to have it in terms of 00:00:00 ? 

Also is it possible to use a timer that starts when asks and ends only when the programs stops  ? 

I have a small problem that i cant fix at the moment, when i send my data to my aws instance it works fine and i get my http post response. ( screenshot)

 

But when i try it with https then the workbench bugs out and It keeps disconnecting my device (this only happens with this code so it is not a cable problem). (screenshot)

 

Could you help me with this ?

 

Kind regards,

 

Phil

0 (0 Votes)
RE: Code not updating
Answer
1/22/19 3:59 PM as a reply to Philibert de Broglie.
Hello Philibert,

I am glad to hear that you are making progress.
If you need to have the time from application start in seconds, just declare the start time upon application start and subtract to receive the time elapsed.
I assume the provided response is the response you receive when you sent data out to your AWS instance using HTTP instead of HTTPS.

However, if you switch to HTTPS, you face the issue that the XDK is restarting only after a few seconds when rebooting after the application is flashed. Is that correct?

Kind regards,
Franjo
0 (0 Votes)
RE: Code not updating
Answer
3/26/19 10:27 AM as a reply to Franjo Stjepandic.

********

Hi Franjo,

Yes i deed a Mac Os upgrade recently and I have been thinking it could be the reason of these problems as they happenend to occur after that upgrade. I am now using Mac OS Mojave 10.14.2

I have been able to read the XDK workbench outputs by using the Usb serial port on the terminal window, but it seems that i'm facing my first problem again... The code is not updating to its latest version, though I am using the latest version of the workbench.

Kind regards,

Phil

********

 

Hello,

I'm still facing this problem and it doesn't seems fixed. So I'm using the latest Workbench Version for MacOS (10.14.x) and the application still stops at "Jumping to application".

Bootloader Version is 1.1.0 

Where is the diffrence between Windows Workbench and MacOS Workbench? If I flash the application with my Mac and show the output with a Windows PC it works fine.

0 (0 Votes)
RE: Code not updating
Answer
3/26/19 3:55 PM as a reply to Henric Breuer.
NVM Workbench 3.6 solved the problem. Thanks!
0 (0 Votes)