Recently, I've implemented a socket based communications library for base
station communications.
There is much work on using ipv6 for communicating with motes and using
sockets on the base stations makes sense for that. However, ipv6 is
significantly more expensive for communicating with motes and it makes sense
to have the option of using a lighter weight protocol (such as AM) for
communications.
It would be nice to be able to write base station apps once, independently
of any underlying communications protocol. LibMoteNet provides this
ability. It currently allows one to build a base station app that can
communicate using either AM or ipv6. What protocol is being used is
specified at run time using a connection string that specifies an endpoint
addressable entity. Further, libmotenet, allows one to make use of the
well known berkeley socket programming API for base station applications,
regardless of the underlying protocol one is using to communicate.
The LibMoteNet library is implemented as a superset and is fully backward
compatible with the existing libmote communications library.
I'd like to bring this code into the main svn trunk where I think it would
be of most use and certainly easier to find. But before that happens we
need to see if there is sufficient interest in the community to break the
inclusion threshold. A bit of a chicken and egg problem.
So if you are writing a base station app, possibly doing so at first using
Active Messaging (SerialActiveMessage), but think you might transition to
IPv6, then libmotenet allows you to write the program once, easily, using
well known socket constructs. Even if you are just working with AM
communications, writing code using libmotenet is significantly clearner than
using libmote and using serial active message headers.
Because Libmotenet hides the particulars of communications from the base
station app, the network architecture can easily be modified to consist of
an AM cloud connected via a gateway to say an IPv6 network. All of this is
transparent to the BaseStation app and the end mote. This makes base
station apps more independent of the underlying communications architecture.
libmotenet includes:
- uses sockaddr constructs
- supports either IPv6 addresses (AF_INET6) or AM addresses (AF_AM).
- application doesn't deal with any encapsulations (handled in the
library).
- supports RAW if you really do need to look at the encapsulation
- uses berkeley sockets so leverages a well known programming paradigm.
- Cleaner applications then using libmote.
I'd like to encourage its use. If a few people find it useful, then I can
bring it into the trunk making it even more available. Once it comes into
the trunk, I will update docs.tinyos.net to reflect using libmotenet and
modify the communications examples. But I don't want to do that
prematurely.
So please give it a try and let me know if you find it useful. I am fully
supporting the code so any questions or help should be directed to me.
It is available in two ways...
The code lives in the directories: *support/sdk/c/{motenet,libnet,sf}*.
There is documentation and example programs. See the READMEs.
1) A standalone copy of libmotenet can be obtained from tinyos-contrib via:
cvs -d:pserver:[email protected]:/cvsroot/tinyos checkout
-P tinyos-2.x-contrib/cire
Then look in tinyos-2.x-contrib/cire/support/sdk/c/...
2) via git:
Motenet lives on the *motenet_rel* branch off the mainline in the msp430.git
repository. The msp430.git mainline tracks the svn trunk.
mkdir working; cd working
git clone git://hinrg.cs.jhu.edu/git/cire/msp430.git
cd msp430
git checkout -t origin/motenet_rel
code is in *support/sdk/c/{motenet,libnet,sf}*
Given how git works, if one has a working git repository based on the svn
trunk, one can easily merge the motenet code into your working code.
ie.
mkdir working; cd working
git clone git://hinrg.cs.jhu.edu/git/tinyos-2.x.svn
cd tinyos-2.x
git checkout -b working_branch
do bunch of stuff on working_branch
git checkin -m"did a bunch of stuff on the working branch"
git remote add m430 git://hinrg.cs.jhu.edu/git/cire/msp430.git
git fetch
git merge remotes/msp430/motenet_rel
your working branch now has the motenet code merged into it. Lives in *
support/sdk/c/...*
--
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help