Hi Vishal.

Re-cc'ing tinyos-help.

On Thu, Mar 27, 2008 at 11:10 PM,  <[EMAIL PROTECTED]> wrote:
> Hi David,
>
>  Thanks for the quick reply. So are you trying to say that we don't need
>  to inject the images initially to the node and whenever we want to
>  reprogram a node with certain application, we use the python tos-deluge
>  script to inject the image for that app at a desired slot and as soon
>  as the image is inserted completely into the slot, the mote reboots
>  automatically to that image.

Yes, that's the basic idea.

Keep in mind that this would require a new Deluge interface for you to
wire to so you can respond to slot update events and so on.

It may be possible to do this at present by wiring to internal Deluge
interfaces (see the code under tos/lib/net/Deluge), but I wouldn't
recommend that unless you want to fix your app every time Deluge's
internals get reworked :-)

>
>  Few doubts regarding this:
>  1 - Do we have the option of specifying the nodeid and slot number for
>  the image through python tos-deluge script?
>  2 - Suppose we just rebooted to slot2 for application2. slot 1 still
>  contains app1. Now if I again want to switch to slot1, do I have to
>  again insert the same image in slot1 which is already there using
>  python tos-deluge script?
>

No, the Deluge system is epidemic. All the motes will get the same
image in the same slot. The idea is for all motes in your network,
even remote ones (ie, only reachable by multi-hop), to get the updated
image. Also, for motes which were offline to get the new image when
they come online. This all takes place in a distributed/parallel way.
It isn't overseen by the basestation except for the initial "inject"
and "disseminate" commands. You need to decide if this behaviour is
appropriate for your mote network.

When you run tos-deluge you specify an action
(reprogram/disseminate/etc) and a slot number. The Deluge protocol
takes care of the delivery. Then your apps need to decide when to
reprogram, and using which slot.

>  2 - Suppose we just rebooted to slot2 for application2. slot 1 still
>  contains app1. Now if I again want to switch to slot1, do I have to
>  again insert the same image in slot1 which is already there using
>  python tos-deluge script?

slot1 will still contain app1 while you're running app2. This is so
that if any nearby motes with an old version of app1 come online then
the mote can update them to the latest version.

If you want to use just 1 slot to update a lot of different apps (eg:
conserve flash volumes or you're running short on deluge slots), then
there are a few things you can try. A few ideas:

1) Add a config flash volume, and store an app type number. When "App"
starts up, it reads a 1, 2, 3, etc value, and only starts up the logic
for App1, App2, App3, etc as needed. This has problems of it's own
(application complexity, inability to dynamically allocate memory
meaning the program needs to reserve memory for all apps instead of
the one you're running this time, etc).

or

2) Tell your motes in advance what application you're going to send
(maybe via tinyos 2 disseminate protocol), then when you disseminate
the app (into a single Deluge slot), the apps only reprogram into it
if it's the correct app.

Also for (2) you should send the program image hash along with the app
number, and check the deluge slots on the motes before reprogramming.
Furthermore, it is probably a good idea to allow some time between
steps so the different apps have time to update themselves before you
start disseminating the next app.

3) Maybe you don't need Deluge? If all your motes are within range of
the base station, and you don't want the 'epidemic'
(distributed+parallel) behaviour, then  it should be possible to roll
your own 'wireless reprogram' mote & basestation modules which update
the motes one at a time, under the control of the basestation.

>  Thanks and Regards,
>  Vishal
>

Regards,

David.
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to