You are on page 1of 3

1.InstallJava TinyOS2.1requirestheJava6JDKinordertomakeuseofitsPCtomotecommunication libraries.IfyoudonothaveJava6installed,runthefollowingfromacommandline: $sudoaptgetinstallsunjava6jdk YouwillneedtomakethejavaandjavaccommandspointtotheinstalledJava6ifyou havemultipleJavaversionsinstalled.Otherwise,youwillgeterrorswhentryingtocompile orruntheTinyOSJavalibraries.TomakejavapointtoJava6,runthefollowingandselect Java6: $sudoupdatealternativesconfigjava Forthejavacompilercommand,javac,run: $sudoupdatealternativesconfigjavac 2.ToEDITSources.list $sudogedit/etc/apt/sources.list*Kindlytakeacopyofsourcefilebeforeeditingit:) Inthefilesources.

listthatwouldbeopenedaddthefollowinglinesattheendofthefile andsave andclosethefileafterwards: #tinyosInstallation $debhttp://tinyos.stanford.edu/tinyos/dists/ubuntu<distribution>main *Set<distribution>={edgy,feisty,gutsy,hardy,jaunty,karmic,lucid}dependingonyour Ubuntudistribution.Next,weupdatetherepositorycachefromaterminalwindow: Eg:ForUbuntu12.04debhttp://tinyos.stanford.edu/tinyos/dists/ubuntulucidmain

3.Updatetheaptgetrepositoryusingthiscommand: $sudoaptgetupdate

4.InstallTinyOSthroughaptget $sudoaptgetinstalltinyos2.1.1 5.Inordertoexecutethecompilethenesccodesyoumayneedtochangethe ownershipofTinyOSrootdirectorytoyouruser. $sudochownvayya:vayyaR/opt/tinyos2.1.1/ 6.Installpythondevelopmentpackage(headers)(*optionalonlyforTOSSIM) $sudoaptgetinstallpythondev 7.Now,weconfigureenvironmentvariablesandinstalltheTinyOSJavatoolset.Add thefollowingtoyour.bashrcfile:

exportTOSROOT=/opt/tinyos2.1.1 exportTOSDIR=$TOSROOT/tos exportCLASSPATH=$TOSROOT/support/sdk/java/tinyos.jar:.:$CLASSPATH exportMAKERULES=$TOSROOT/support/make/Makerules exportPATH=/opt/msp430/bin:$PATH 8.InstalltheJavatoolsby: $sudotosinstalljni Itsshowlikethis:Installing64bitJavaJNIcodein/usr/lib/jvm/java6openjdk amd64/jre/lib/amd64.... done 9.InstallingJavadocs Goto/opt/tinyos2.1.1/support/sdk/java $make $makeinstall $makejavadoc 10.CompilingandinstallingmyfirstTinyOSprogram Gotoopt/tinyos2.1.1/apps/Blinkandcompilethecodeusingcommandmake. $makemicaz ItOutputas:mkdirpbuild/micaz compilingBlinkAppCtoamicazbinary nccobuild/micaz/main.exeOsfnescseparator=__WallWshadowWnescall target=micazfnesccfile=build/micaz/app.cboard=micasb DDEFINED_TOS_AM_GROUP=0x22parammaxinlineinsnssingle=100000 DIDENT_APPNAME=\"BlinkAppC\"DIDENT_USERNAME=\"seshagiri\" DIDENT_HOSTNAME=\"ATI\"DIDENT_USERHASH=0x9ec8e428L DIDENT_TIMESTAMP=0x50b486edLDIDENT_UIDHASH=0xef33ececLfnesc dump=wiringfnescdump='interfaces(!abstract())'fnesc dump='referenced(interfacedefs,components)'fnescdumpfile=build/micaz/wiring check.xmlBlinkAppC.nclm compiledBlinkAppCtobuild/micaz/main.exe 2048bytesinROM 51bytesinRAM

avrobjcopyoutputtarget=srecbuild/micaz/main.exebuild/micaz/main.srec avrobjcopyoutputtarget=ihexbuild/micaz/main.exebuild/micaz/main.ihex writingTOSimage

You might also like