Hello,
i am trying to push an xml file from end device to router eligible device. Is it a good idea? should i fragment the data ?
Regards,
Siva
Solved! Go to Solution.
Hello Siva,
Glad to hear you have been progressing with your application.
Yes, Test Tool breaks the file into fragments. Take a look at the following screenshot:
What I've highlighted are the initial bytes that were send when I've initiated the transfer of two different files. The first one was too large for Test Tool (1.2 MB) and broke after the two chunks sent, and the second successfully sent the file with, by adding FF padding to multiple of 1 KB I believe.
Observations:
Best of luck,
Lilian
if you are happy with Lilian's answer can you please mark this question as answered?
Thanks - and feel free to let us know how we can support you.
Best regards,
Saleem
Hello Siva,
Glad to hear you have been progressing with your application.
Yes, Test Tool breaks the file into fragments. Take a look at the following screenshot:
What I've highlighted are the initial bytes that were send when I've initiated the transfer of two different files. The first one was too large for Test Tool (1.2 MB) and broke after the two chunks sent, and the second successfully sent the file with, by adding FF padding to multiple of 1 KB I believe.
Observations:
Best of luck,
Lilian
Hello Lillian,
Please look at the image below
I have generated a .bin out of my .xml and started OTA with out looking at the register address which has crashed the client as expected. I think i can flash it with original.
Is there any information about setting up new register address ? can Test tool help in modifying that ?
if it is possible, how do i read the transferred data on the client side ?
Regards,
Siva
Hi Siva,
Is there any information about setting up new register address ? can Test tool help in modifying that ?
What you encountered is not a matter of Test Tool configuration, but of the application you have on the client. What happened is that you didn't instruct the application what to do with the received chunk. By default, as mentioned in my previous comment, the function called for the chunk is "OTA_PushImageChunk", which does the following: "Places the next image chunk into the external FLASH. The CRC will not be computed." (extracted from its description). Here is where you add your function that will send on serial line the chunk to the computer.
Regards,
Lilian
Hello Siva,
should i fragment the data ?
Yes, the data should be fragmented in 1280 byte chunks, given that Thread uses IPv6. Take a look at this resource for clarification.
i am trying to push an xml file from end device to router eligible device. Is it a good idea?
Yes, Thread protocol is often used for such tasks.
A suggestion I want to give you, look how an OTA transfer is made, which basically does what you want to do, it reads a firmware and sends it to another device, the difference here being the location where the data is stored.
Let me know if I answered your questions and feel free to ask more if you need help.
All the best,
Lilian
Hello Lilian,
Thank you for replying.
I understood that data needs to be fragmented. But, i am currently using Router eligible device and end device demos on two KW41Z.
My application would be transferring an .xml file from end device to router eligible device.
Will i have to have a companion like K64F ?
Thank you,
Siva
Hello again,
My application would be transferring an .xml file from end device to router eligible device.
The two KW41Z are enough to transfer the file.
Will i have to have a companion like K64F ?
It depends on what you want to do with the file, but just for passing the file from one device to another the two KW41Z are enough.
If you want and if you are allowed, you can tell me more about what you are trying to do with this transfer and I will help you how I can.
Regards,
Lilian
Hello Lilian,
Here is what i am trying to do,
I am trying to transfer a log file (.xml) using THREAD from one computer to another. To prove this, i may have to show that transfer of .xml is possible using THREAD. Based on your replies, it is very evident that transferring .xml is very similar to OTA update where i may have to choose different registers to store the fragmented .xml (i believe that it is converted into binary before fragmenting).
I would like to take your suggestion regarding how to start with it.
Thankyou,
Siva
Hi Siva,
If you want to use the OTA approach you have to modify "OTA_PushImageChunk" function call from "OtaClient_UpgradeImage" function, found in *sdk_folder*\middleware\wireless\nwk_ip_1.2.5\examples\common\app_ota_client.c file.
Your function replacement should take the chunk and send it on serial to the destination computer. The function that helps you do this is "THCI_transmitPayload", found in *sdk_folder*\middleware\wireless\nwk_ip_1.2.5\base\thci\thci.c. Define a new OpCode in "nwkOpCode_t" enum found in *sdk_folder*\middleware\wireless\nwk_ip_1.2.5\base\interface\thci.h, so that you would know what kind of message you will get.
Now you have to reassemble the chunks into the file.xml on the destination computer.
Observations:
Another approach would be to send COAP messages. Requirements and observations:
I hope the information I provided will be helpful.
Regards,
Lilian
Hey Lilian,
The two approaches really look awesome.
I have worked on coAP transactions and was able to create my own uri path for an external analog sensor which was very interesting. I believe that i will need to perform more than one coAP transaction for one complete transfer of file. And so, i would choose the OTA approach and modify the address to store the chunks and transfer it serially to my client.
One more question out of my curiosity. Is fragmentation not a part of this operation ? Looks like we are dealing with chunks, but not on how we got them from original .xml file.
Regards,
Siva