contiki over the air programming

后端 未结 2 2138
温柔的废话
温柔的废话 2021-02-10 01:17

I\'m getting started with contiki on the sky mote through a project. I\'m trying to get over the air programming to work right now.
I\'ve been looking through examples/sky-

相关标签:
2条回答
  • 2021-02-10 01:27

    I can't tell you how many times I came back to this post while I was trying to implement OTA in Contiki myself. I know this is an old question, but for anyone looking for a working example, I implemented OTA via CoAP (originally HTTP) for the CC2650, with the server being in NodeJS.

    I could be more wordy, but you can just read the tutorial: http://marksolters.com/programming/2016/06/07/contiki-ota.html

    It discusses the image architecture, transport mechanism and download validation abstractly, so the information is not really bound to the CC2650 uniquely.

    I did not use dynamic linking. I statically linked my binaries and developed a bootloader which writes them to a known flash address. I've never seen elfloader work in Contiki.

    • Here's the Contiki example source: https://github.com/msolters/contiki/tree/master/examples/cc26xx-ota-bootloader
    • Here's the OTA server source: https://github.com/msolters/ota-server

    Hopefully this helps!

    0 讨论(0)
  • 2021-02-10 01:43

    To get over the air (OTA) Programming working, your own codebase needs to work on top of another layer ( thus other users mentioning too look into the shell examples ).

    It is comparable to the Windows kernel that runs an executable and needs to update.

    1: Kernel downloads foo and saves this on its filesystem.
    2: The kernel terminates the old foo program and starts the new foo program after some required file validation.
    3: If everything is ok, the old foo program gets removed.

    Now as you can see that at the time of updating your program needs to be twice on the same device ( the old one and the new one ).

    I hope this gives more insight in how OTA programming works.

    So i will try to answer your questions one by one now:

    1) To distribute the files to all other nodes, deluge is used. Now using deluge is indeed quite tricky to use. The following post in the mailing list of contiki gives a basic idea what the code example for sky does. http://permalink.gmane.org/gmane.os.contiki.devel/4884 .

    2) Every mote needs a shell needs to run that runs the deluge application. And one sink node ( the one transmitting the newest file ) needs to call the deluge_dessiminate() function to distribute (dessiminate) the new program.

    3) The code will be stored in the coffee file system. Deluge will automatically ( behind the scenes of deluge_dessiminate and the deluge app on your sky node ) save the new file on the flash of the sky node. After this is done, you need to run this program by using the ELF loader. Since you need your program to be an ELF compiled file to be run by the contiki ELF_LOADER.

    4) I think you mean ROM? But yes, you need extra code to support OTA programming and you need twice the space of the size of your application. All of the modules you say you need you probably need to program yourself on the shell side. file verification can be done by CRC checking your file.

    This is indeed a lot of work and I suggest doing this is small steps.
    1: Run a program using the ELF loader that is saved on the coffee file system.
    2: dessiminate (deluge) your own (random) file from a sink node to the other nodes
    3: dessiminate an ELF file.
    4: run a deluge_dessiminated file using ELF loader.

    and 5: Create a tutorial for the other guys and share the knowledge!

    I hope this will help you in any way.

    0 讨论(0)
提交回复
热议问题