wafa jaballah | 1 Jan 2010 09:36
Picon

Re: PowerTossim2

Hi,

I have Tinyos-2.1  and Python 2.5.1 .
I don't know if Ptossim2 is compatible with tinyos-2.1 and Python 2.5.1.

So, I donwloaded  the tinyos-2.x-contrib/cedt from CVS.
I followed the  PTOSSIM installation instructions.
But when I type " make mica2 sim-energy"  in order to simulate TestMCU application.
I find many errors related to
/opt/tinyos-2.x-contrib/tos/chips/cc1000/sim/CC1000SendReceiveP.nc:
372 : nx_struct has no member named 'ack'
/opt/tinyos-2.x-contrib/tos/chips/cc1000/sim/CC1000SendReceiveP.nc:671:
conflincting types for 'Packet.getPoyload'
/opt/tinyos-2.x/tos/interfaces/Packet.nc:115: previous declaration of 'Packet.getPayload'
/opt/tinyos-2.x-contrib/tos/chips/cc1000/sim/CC1000SendReceiveP.nc:688: 'getPayload' is not in interface 'Receive'
/opt/tinyos-2.x-contrib/tos/chips/cc1000/sim/CC1000SendReceiveP.nc:'getPayloadLength' is not in interface'Receive'
/opt/tinyos-2.x-contrib/tos/chips/cc1000/sim/CC1000SendReceiveP.nc:700: conflicting types for 'Send.getPayload'
/opt/tinyos-2.x/tos/chips/cc1000/CC1000CsmaRadioC.nc:91no match
/opt/tinyos-2.x/tos/chips/cc1000/CC1000CsmaRadioC.nc:105: cannot find 'CC1000Squelch'


The problem is related to CC1000SendReceiveP and  CC1000CsmaRadioC.

It compiles succesfully "make micaz sim".

How can I resolve it ?
Thanks,


2009/12/31 Viktor Zsoldos <gecko003 <at> gmail.com>
Hi,

You were correct, the powertossim2 is there, just read the README. You
will need tinyos 2.02, and python 2.4 to make it work.

Good luck,
Viktor

wafa jaballah wrote:
> Hi,
>
> In order to estimate energy consumption in tinyos-2.x, I want to use
> PowerTossim 2.
> under  *//tinyos-2.x-contrib/cedt//* but I don't find it.
> Is there an available link to donwload PowerTossim2?
>
> Thanks,
>
>
> --
> Wafa Ben Jaballah
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help <at> millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help




--
Wafa Ben Jaballah

<div><div dir="ltr">Hi,<br><br>I have Tinyos-2.1&nbsp; and Python 2.5.1 .<br>I don't know if Ptossim2 is compatible with tinyos-2.1 and Python 2.5.1.<br><br>So, I donwloaded&nbsp; the tinyos-2.x-contrib/cedt from CVS. <br>I followed the&nbsp; PTOSSIM installation instructions.<br>
But when I type " make mica2 sim-energy"&nbsp; in order to simulate TestMCU application.<br>I find many errors related to <br>/opt/tinyos-2.x-contrib/tos/chips/cc1000/sim/CC1000SendReceiveP.nc:<br>372 : nx_struct has no member named 'ack'<br>
/opt/tinyos-2.x-contrib/tos/chips/cc1000/sim/CC1000SendReceiveP.nc:671:<br>conflincting types for 'Packet.getPoyload'<br>/opt/tinyos-2.x/tos/interfaces/Packet.nc:115: previous declaration of 'Packet.getPayload'<br>
/opt/tinyos-2.x-contrib/tos/chips/cc1000/sim/CC1000SendReceiveP.nc:688: 'getPayload' is not in interface 'Receive'<br>/opt/tinyos-2.x-contrib/tos/chips/cc1000/sim/CC1000SendReceiveP.nc:'getPayloadLength' is not in interface'Receive'<br>
/opt/tinyos-2.x-contrib/tos/chips/cc1000/sim/CC1000SendReceiveP.nc:700: conflicting types for 'Send.getPayload'<br>/opt/tinyos-2.x/tos/chips/cc1000/CC1000CsmaRadioC.nc:91no match<br>/opt/tinyos-2.x/tos/chips/cc1000/CC1000CsmaRadioC.nc:105: cannot find 'CC1000Squelch'<br><br><br>The problem is related to CC1000SendReceiveP and&nbsp; CC1000CsmaRadioC. <br><br>It compiles succesfully "make micaz sim".<br><br>How can I resolve it ?<br>Thanks,<br><br><br><div class="gmail_quote">2009/12/31 Viktor Zsoldos <span dir="ltr">&lt;<a href="mailto:gecko003 <at> gmail.com">gecko003 <at> gmail.com</a>&gt;</span><br><blockquote class="gmail_quote">Hi,<br><br>
You were correct, the powertossim2 is there, just read the README. You<br>
will need tinyos 2.02, and python 2.4 to make it work.<br><br>
Good luck,<br>
Viktor<br><div>
<div></div>
<div class="h5">
<br>
wafa jaballah wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; In order to estimate energy consumption in tinyos-2.x, I want to use<br>
&gt; PowerTossim 2.<br>
&gt; under &nbsp;*//tinyos-2.x-contrib/cedt//* but I don't find it.<br>
&gt; Is there an available link to donwload PowerTossim2?<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Wafa Ben Jaballah<br>
&gt;<br>
</div>
</div>&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Tinyos-help mailing list<br>
&gt; <a href="mailto:Tinyos-help <at> millennium.berkeley.edu">Tinyos-help <at> millennium.berkeley.edu</a><br>
&gt; <a href="https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help" target="_blank">https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help</a><br><br>
</blockquote>
</div>
<br><br clear="all"><br>-- <br>Wafa Ben Jaballah<br><br>
</div></div>
张扬奇[ArchiCheung] | 1 Jan 2010 13:29
Picon

how to install tinyOS 2.0 Application in the MSP430F5418 MPU?

Hi Everyone,
   I Choose the TI MSP430F5418 as the MPU to controll  the RF Module.
Now I have some problems,The Tinyos 2.0 Default msp430-gcc does not support MSP430F5418,when I complie a program ,it says as fallow:
 
msp430-gcc -mmcu=msp430x5418 -O2 -Wall -g   -c -o main.o main.c
cc1: MCU msp430x5418 not supported
Known MCU names:
   msp1
   msp2
   msp430x110
   msp430x112
   msp430x1101
   msp430x1111
   msp430x1121
   msp430x1122
   msp430x1132
   msp430x122
   msp430x123
   msp430x1222
   msp430x1232
   msp430x133
   msp430x135
   msp430x1331
   msp430x1351
   msp430x147
   msp430x148
   msp430x149
   msp430x1471
   msp430x1481
   msp430x1491
   msp430x155
   msp430x156
   msp430x157
   msp430x167
   msp430x168
   msp430x169
   msp430x1610
   msp430x1611
   msp430x1612
   msp430x2001
   msp430x2011
   msp430x2002
   msp430x2012
   msp430x2003
   msp430x2013
   msp430x2101
   msp430x2111
   msp430x2121
   msp430x2131
   msp430x2234
   msp430x2254
   msp430x2274
   msp430x311
   msp430x312
   msp430x313
   msp430x314
   msp430x315
   msp430x323
   msp430x325
   msp430x336
   msp430x337
   msp430x412
   msp430x413
   msp430x415
   msp430x417
   msp430x423
   msp430x425
   msp430x427
   msp430x4250
   msp430x4260
   msp430x4270
   msp430xE423
   msp430xE425
   msp430xE427
   msp430xW423
   msp430xW425
   msp430xW427
   msp430xG437
   msp430xG438
   msp430xG439
   msp430x435
   msp430x436
   msp430x437
   msp430x447
   msp430x448
   msp430x449
   msp430xG4616
   msp430xG4617
   msp430xG4618
   msp430xG4619
(null):0: confused by earlier errors, bailing out
make: *** [main.o] Error 1
 
Now,how can I do to install tinyOS 2.0 in the MSP430F5418.
Thank you!
 
sincerely
 
2010-01-01
Archi Cheung
<div>
<div>Hi Everyone,</div>
<div>&nbsp;&nbsp; I Choose the TI MSP430F5418 as the MPU to controll &nbsp;the 
RF Module.</div>
<div>Now I have some problems,The&nbsp;Tinyos 2.0 Default&nbsp;msp430-gcc does 
not support MSP430F5418,when I complie a program ,it says as fallow:</div>
<div>&nbsp;</div>
<div>msp430-gcc&nbsp;-mmcu=msp430x5418&nbsp;-O2&nbsp;-Wall&nbsp;-g&nbsp;&nbsp;&nbsp;-c&nbsp;-o&nbsp;main.o&nbsp;main.c</div>
<div>cc1:&nbsp;MCU&nbsp;msp430x5418&nbsp;not&nbsp;supported</div>
<div>Known&nbsp;MCU&nbsp;names:</div>
<div>&nbsp;&nbsp;&nbsp;msp1</div>
<div>&nbsp;&nbsp;&nbsp;msp2</div>
<div>&nbsp;&nbsp;&nbsp;msp430x110</div>
<div>&nbsp;&nbsp;&nbsp;msp430x112</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1101</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1111</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1121</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1122</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1132</div>
<div>&nbsp;&nbsp;&nbsp;msp430x122</div>
<div>&nbsp;&nbsp;&nbsp;msp430x123</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1222</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1232</div>
<div>&nbsp;&nbsp;&nbsp;msp430x133</div>
<div>&nbsp;&nbsp;&nbsp;msp430x135</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1331</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1351</div>
<div>&nbsp;&nbsp;&nbsp;msp430x147</div>
<div>&nbsp;&nbsp;&nbsp;msp430x148</div>
<div>&nbsp;&nbsp;&nbsp;msp430x149</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1471</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1481</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1491</div>
<div>&nbsp;&nbsp;&nbsp;msp430x155</div>
<div>&nbsp;&nbsp;&nbsp;msp430x156</div>
<div>&nbsp;&nbsp;&nbsp;msp430x157</div>
<div>&nbsp;&nbsp;&nbsp;msp430x167</div>
<div>&nbsp;&nbsp;&nbsp;msp430x168</div>
<div>&nbsp;&nbsp;&nbsp;msp430x169</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1610</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1611</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1612</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2001</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2011</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2002</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2012</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2003</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2013</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2101</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2111</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2121</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2131</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2234</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2254</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2274</div>
<div>&nbsp;&nbsp;&nbsp;msp430x311</div>
<div>&nbsp;&nbsp;&nbsp;msp430x312</div>
<div>&nbsp;&nbsp;&nbsp;msp430x313</div>
<div>&nbsp;&nbsp;&nbsp;msp430x314</div>
<div>&nbsp;&nbsp;&nbsp;msp430x315</div>
<div>&nbsp;&nbsp;&nbsp;msp430x323</div>
<div>&nbsp;&nbsp;&nbsp;msp430x325</div>
<div>&nbsp;&nbsp;&nbsp;msp430x336</div>
<div>&nbsp;&nbsp;&nbsp;msp430x337</div>
<div>&nbsp;&nbsp;&nbsp;msp430x412</div>
<div>&nbsp;&nbsp;&nbsp;msp430x413</div>
<div>&nbsp;&nbsp;&nbsp;msp430x415</div>
<div>&nbsp;&nbsp;&nbsp;msp430x417</div>
<div>&nbsp;&nbsp;&nbsp;msp430x423</div>
<div>&nbsp;&nbsp;&nbsp;msp430x425</div>
<div>&nbsp;&nbsp;&nbsp;msp430x427</div>
<div>&nbsp;&nbsp;&nbsp;msp430x4250</div>
<div>&nbsp;&nbsp;&nbsp;msp430x4260</div>
<div>&nbsp;&nbsp;&nbsp;msp430x4270</div>
<div>&nbsp;&nbsp;&nbsp;msp430xE423</div>
<div>&nbsp;&nbsp;&nbsp;msp430xE425</div>
<div>&nbsp;&nbsp;&nbsp;msp430xE427</div>
<div>&nbsp;&nbsp;&nbsp;msp430xW423</div>
<div>&nbsp;&nbsp;&nbsp;msp430xW425</div>
<div>&nbsp;&nbsp;&nbsp;msp430xW427</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG437</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG438</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG439</div>
<div>&nbsp;&nbsp;&nbsp;msp430x435</div>
<div>&nbsp;&nbsp;&nbsp;msp430x436</div>
<div>&nbsp;&nbsp;&nbsp;msp430x437</div>
<div>&nbsp;&nbsp;&nbsp;msp430x447</div>
<div>&nbsp;&nbsp;&nbsp;msp430x448</div>
<div>&nbsp;&nbsp;&nbsp;msp430x449</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG4616</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG4617</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG4618</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG4619</div>
<div>(null):0:&nbsp;confused&nbsp;by&nbsp;earlier&nbsp;errors,&nbsp;bailing&nbsp;out</div>
<div>make:&nbsp;***&nbsp;[main.o]&nbsp;Error&nbsp;1</div>
<div>&nbsp;</div>
<div>Now,how can I do to install tinyOS 2.0 in the MSP430F5418.</div>
<div>Thank you!</div>
<div>&nbsp;</div>
<div>sincerely</div>
<div>&nbsp;</div>
<div align="left">2010-01-01 
</div>
<div><span>Archi 
Cheung</span></div>
</div>
satyam trivedi | 1 Jan 2010 16:37
Picon

Re: how to install tinyOS 2.0 Application in the MSP430F5418 MPU?

Hi


First of all you need to update your compiler tool chain(mspgcc), that you can do with updating binutils.
Second thing I have seen people updating tinyOS MSPGCC tool chain for 2 series, but for 5 series I have not found  successful attempts. 

All the best
Satyam 
2010/1/1 张扬奇[ArchiCheung] <zhangyq <at> robot.nankai.edu.cn>
Hi Everyone,
   I Choose the TI MSP430F5418 as the MPU to controll  the RF Module.
Now I have some problems,The Tinyos 2.0 Default msp430-gcc does not support MSP430F5418,when I complie a program ,it says as fallow:
 
msp430-gcc -mmcu=msp430x5418 -O2 -Wall -g   -c -o main.o main.c
cc1: MCU msp430x5418 not supported
Known MCU names:
   msp1
   msp2
   msp430x110
   msp430x112
   msp430x1101
   msp430x1111
   msp430x1121
   msp430x1122
   msp430x1132
   msp430x122
   msp430x123
   msp430x1222
   msp430x1232
   msp430x133
   msp430x135
   msp430x1331
   msp430x1351
   msp430x147
   msp430x148
   msp430x149
   msp430x1471
   msp430x1481
   msp430x1491
   msp430x155
   msp430x156
   msp430x157
   msp430x167
   msp430x168
   msp430x169
   msp430x1610
   msp430x1611
   msp430x1612
   msp430x2001
   msp430x2011
   msp430x2002
   msp430x2012
   msp430x2003
   msp430x2013
   msp430x2101
   msp430x2111
   msp430x2121
   msp430x2131
   msp430x2234
   msp430x2254
   msp430x2274
   msp430x311
   msp430x312
   msp430x313
   msp430x314
   msp430x315
   msp430x323
   msp430x325
   msp430x336
   msp430x337
   msp430x412
   msp430x413
   msp430x415
   msp430x417
   msp430x423
   msp430x425
   msp430x427
   msp430x4250
   msp430x4260
   msp430x4270
   msp430xE423
   msp430xE425
   msp430xE427
   msp430xW423
   msp430xW425
   msp430xW427
   msp430xG437
   msp430xG438
   msp430xG439
   msp430x435
   msp430x436
   msp430x437
   msp430x447
   msp430x448
   msp430x449
   msp430xG4616
   msp430xG4617
   msp430xG4618
   msp430xG4619
(null):0: confused by earlier errors, bailing out
make: *** [main.o] Error 1
 
Now,how can I do to install tinyOS 2.0 in the MSP430F5418.
Thank you!
 
sincerely
 
2010-01-01
Archi Cheung

_______________________________________________
Tinyos-help mailing list
Tinyos-help <at> millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help



--
Satyam Trivedi
WSN Solution Architect
Indrion Technologies, Bangalore
India
<div>
<p>Hi</p>
<div><br></div>
<div>First of all you need to update your compiler tool chain(mspgcc), that you can do with updating binutils.<br>Second thing I have seen people updating tinyOS MSPGCC tool chain for 2 series, but for 5 series I have not found &nbsp;successful attempts.&nbsp;</div>
<div><br></div>
<div>All the best</div>
<div>Satyam&nbsp;<br><div class="gmail_quote">2010/1/1 &#24352;&#25196;&#22855;[ArchiCheung] <span dir="ltr">&lt;<a href="mailto:zhangyq <at> robot.nankai.edu.cn">zhangyq <at> robot.nankai.edu.cn</a>&gt;</span><br><blockquote class="gmail_quote">

<div>
<div>Hi Everyone,</div>
<div>&nbsp;&nbsp; I Choose the TI MSP430F5418 as the MPU to controll &nbsp;the 
RF Module.</div>
<div>Now I have some problems,The&nbsp;Tinyos 2.0 Default&nbsp;msp430-gcc does 
not support MSP430F5418,when I complie a program ,it says as fallow:</div>
<div>&nbsp;</div>
<div>msp430-gcc&nbsp;-mmcu=msp430x5418&nbsp;-O2&nbsp;-Wall&nbsp;-g&nbsp;&nbsp;&nbsp;-c&nbsp;-o&nbsp;main.o&nbsp;main.c</div>
<div>cc1:&nbsp;MCU&nbsp;msp430x5418&nbsp;not&nbsp;supported</div>
<div>Known&nbsp;MCU&nbsp;names:</div>
<div>&nbsp;&nbsp;&nbsp;msp1</div>
<div>&nbsp;&nbsp;&nbsp;msp2</div>
<div>&nbsp;&nbsp;&nbsp;msp430x110</div>
<div>&nbsp;&nbsp;&nbsp;msp430x112</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1101</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1111</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1121</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1122</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1132</div>
<div>&nbsp;&nbsp;&nbsp;msp430x122</div>
<div>&nbsp;&nbsp;&nbsp;msp430x123</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1222</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1232</div>
<div>&nbsp;&nbsp;&nbsp;msp430x133</div>
<div>&nbsp;&nbsp;&nbsp;msp430x135</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1331</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1351</div>
<div>&nbsp;&nbsp;&nbsp;msp430x147</div>
<div>&nbsp;&nbsp;&nbsp;msp430x148</div>
<div>&nbsp;&nbsp;&nbsp;msp430x149</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1471</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1481</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1491</div>
<div>&nbsp;&nbsp;&nbsp;msp430x155</div>
<div>&nbsp;&nbsp;&nbsp;msp430x156</div>
<div>&nbsp;&nbsp;&nbsp;msp430x157</div>
<div>&nbsp;&nbsp;&nbsp;msp430x167</div>
<div>&nbsp;&nbsp;&nbsp;msp430x168</div>
<div>&nbsp;&nbsp;&nbsp;msp430x169</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1610</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1611</div>
<div>&nbsp;&nbsp;&nbsp;msp430x1612</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2001</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2011</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2002</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2012</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2003</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2013</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2101</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2111</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2121</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2131</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2234</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2254</div>
<div>&nbsp;&nbsp;&nbsp;msp430x2274</div>
<div>&nbsp;&nbsp;&nbsp;msp430x311</div>
<div>&nbsp;&nbsp;&nbsp;msp430x312</div>
<div>&nbsp;&nbsp;&nbsp;msp430x313</div>
<div>&nbsp;&nbsp;&nbsp;msp430x314</div>
<div>&nbsp;&nbsp;&nbsp;msp430x315</div>
<div>&nbsp;&nbsp;&nbsp;msp430x323</div>
<div>&nbsp;&nbsp;&nbsp;msp430x325</div>
<div>&nbsp;&nbsp;&nbsp;msp430x336</div>
<div>&nbsp;&nbsp;&nbsp;msp430x337</div>
<div>&nbsp;&nbsp;&nbsp;msp430x412</div>
<div>&nbsp;&nbsp;&nbsp;msp430x413</div>
<div>&nbsp;&nbsp;&nbsp;msp430x415</div>
<div>&nbsp;&nbsp;&nbsp;msp430x417</div>
<div>&nbsp;&nbsp;&nbsp;msp430x423</div>
<div>&nbsp;&nbsp;&nbsp;msp430x425</div>
<div>&nbsp;&nbsp;&nbsp;msp430x427</div>
<div>&nbsp;&nbsp;&nbsp;msp430x4250</div>
<div>&nbsp;&nbsp;&nbsp;msp430x4260</div>
<div>&nbsp;&nbsp;&nbsp;msp430x4270</div>
<div>&nbsp;&nbsp;&nbsp;msp430xE423</div>
<div>&nbsp;&nbsp;&nbsp;msp430xE425</div>
<div>&nbsp;&nbsp;&nbsp;msp430xE427</div>
<div>&nbsp;&nbsp;&nbsp;msp430xW423</div>
<div>&nbsp;&nbsp;&nbsp;msp430xW425</div>
<div>&nbsp;&nbsp;&nbsp;msp430xW427</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG437</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG438</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG439</div>
<div>&nbsp;&nbsp;&nbsp;msp430x435</div>
<div>&nbsp;&nbsp;&nbsp;msp430x436</div>
<div>&nbsp;&nbsp;&nbsp;msp430x437</div>
<div>&nbsp;&nbsp;&nbsp;msp430x447</div>
<div>&nbsp;&nbsp;&nbsp;msp430x448</div>
<div>&nbsp;&nbsp;&nbsp;msp430x449</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG4616</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG4617</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG4618</div>
<div>&nbsp;&nbsp;&nbsp;msp430xG4619</div>
<div>(null):0:&nbsp;confused&nbsp;by&nbsp;earlier&nbsp;errors,&nbsp;bailing&nbsp;out</div>
<div>make:&nbsp;***&nbsp;[main.o]&nbsp;Error&nbsp;1</div>
<div>&nbsp;</div>
<div>Now,how can I do to install tinyOS 2.0 in the MSP430F5418.</div>
<div>Thank you!</div>
<div>&nbsp;</div>
<div>sincerely</div>
<div></div>&nbsp;</div>
<div align="left">2010-01-01 
</div>
<div><span>Archi 
Cheung</span></div>
<br>_______________________________________________<br>
Tinyos-help mailing list<br><a href="mailto:Tinyos-help <at> millennium.berkeley.edu">Tinyos-help <at> millennium.berkeley.edu</a><br><a href="https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help" target="_blank">https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help</a><br>
</blockquote>
</div>
<br><br clear="all"><br>
-- <br>Satyam Trivedi<br>WSN Solution Architect<br>Indrion Technologies, Bangalore<br>India<br>
</div>
</div>
Echedey Lorenzo | 1 Jan 2010 16:47
Picon
Gravatar

I cannot find my C mig struct

Hi friends,

I want to use the same nx_struct that I use in my telosb sensorial application in my C based listener where I record all the received data:

mig c -c-prefix=TELOSBAPP_H -target=telosb Telosbapp.h mystruct_t -o OUTmystruct_t.h


So I get two files, one .c and one .h with an enum and some functions to get and set data in the structure. But I can't find any C structure to use in those files nor I don't know how to do it. I can see for instance in the prettylisten C example of the SDK ( /opt/tinyos-2.x/support/sdk/c/sf/prettylisten.c )  that it uses the tmsg_t by default. I think I am not matching received values with my C mig structure because I have not linked it in any way. What am I doing wrong? How can I use my mig generated struct (and where is it) with prettylisten?

Thanks a lot and Happy New Year.

--
--------------------------------------------
| Echedey Lorenzo Arencibia  |
--------------------------------------------

<div><p>Hi friends,<br><br>I want to use the same nx_struct that I use in my telosb sensorial application in my C based listener where I record all the received data:<br><br clear="all">mig c -c-prefix=TELOSBAPP_H -target=telosb Telosbapp.h mystruct_t -o OUTmystruct_t.h<br><br><br>So I get two files, one .c and one .h with an enum and some functions to get and set data in the structure. But I can't find any C structure to use in those files nor I don't know how to do it. I can see for instance in the prettylisten C example of the SDK ( /opt/tinyos-2.x/support/sdk/c/sf/prettylisten.c )&nbsp; that it uses the tmsg_t by default. I think I am not matching received values with my C mig structure because I have not linked it in any way. What am I doing wrong? How can I use my mig generated struct (and where is it) with prettylisten?<br><br>Thanks a lot and Happy New Year.<br><br>-- <br>--------------------------------------------<br>| Echedey Lorenzo Arencibia &nbsp;|<br>--------------------------------------------<br></p></div>
Guillermo De Cesco | 1 Jan 2010 17:11
Picon

Re: I cannot find my C mig struct

Hi,

because of the difference in architecture between PC and motes, even between motes, you cant cast the message payload to your struct because in the mote the struct will have a size and padding different than it will or could have in PC platform. So here is why MIG is usefull, you make your message based on tmsg_t and fill the fields of your struct using the functiones provided in the .c file. The same way you read the fields of your struct inside the tmsg_t with the functions provided to read or get.

hope this help.

-Bill

On Fri, Jan 1, 2010 at 12:47 PM, Echedey Lorenzo <echedey <at> gmail.com> wrote:
Hi friends,

I want to use the same nx_struct that I use in my telosb sensorial application in my C based listener where I record all the received data:

mig c -c-prefix=TELOSBAPP_H -target=telosb Telosbapp.h mystruct_t -o OUTmystruct_t.h


So I get two files, one .c and one .h with an enum and some functions to get and set data in the structure. But I can't find any C structure to use in those files nor I don't know how to do it. I can see for instance in the prettylisten C example of the SDK ( /opt/tinyos-2.x/support/sdk/c/sf/prettylisten.c )  that it uses the tmsg_t by default. I think I am not matching received values with my C mig structure because I have not linked it in any way. What am I doing wrong? How can I use my mig generated struct (and where is it) with prettylisten?

Thanks a lot and Happy New Year.

--
--------------------------------------------
| Echedey Lorenzo Arencibia  |
--------------------------------------------

_______________________________________________
Tinyos-help mailing list
Tinyos-help <at> millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help



--
Ing. Guillermo De Cesco
Invenio Ingenieria srl.
tel: (54)2944 442119
cel:(54)2944 15534750
web: www.invenioing.com
Av. Pioneros 4163 Dpto 6. CP(R8402AMH)
San Carlos de Bariloche.
Rio Negro, Argentina.
<div>
<p>Hi, <br><br>because of the difference in architecture between PC and motes, even between motes, you cant cast the message payload to your struct because in the mote the struct will have a size and padding different than it will or could have in PC platform. So here is why MIG is usefull, you make your message based on tmsg_t and fill the fields of your struct using the functiones provided in the .c file. The same way you read the fields of your struct inside the tmsg_t with the functions provided to read or get.<br><br>hope this help.<br><br>-Bill<br><br></p>
<div class="gmail_quote">On Fri, Jan 1, 2010 at 12:47 PM, Echedey Lorenzo <span dir="ltr">&lt;<a href="mailto:echedey <at> gmail.com">echedey <at> gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">
Hi friends,<br><br>I want to use the same nx_struct that I use in my telosb sensorial application in my C based listener where I record all the received data:<br><br clear="all">mig c -c-prefix=TELOSBAPP_H -target=telosb Telosbapp.h mystruct_t -o OUTmystruct_t.h<br><br><br>So I get two files, one .c and one .h with an enum and some functions to get and set data in the structure. But I can't find any C structure to use in those files nor I don't know how to do it. I can see for instance in the prettylisten C example of the SDK ( /opt/tinyos-2.x/support/sdk/c/sf/prettylisten.c )&nbsp; that it uses the tmsg_t by default. I think I am not matching received values with my C mig structure because I have not linked it in any way. What am I doing wrong? How can I use my mig generated struct (and where is it) with prettylisten?<br><br>Thanks a lot and Happy New Year.<br><br>-- <br>--------------------------------------------<br>| Echedey Lorenzo Arencibia &nbsp;|<br>--------------------------------------------<br><br>_______________________________________________<br>
Tinyos-help mailing list<br><a href="mailto:Tinyos-help <at> millennium.berkeley.edu">Tinyos-help <at> millennium.berkeley.edu</a><br><a href="https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help" target="_blank">https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help</a><br>
</blockquote>
</div>
<br><br clear="all"><br>
-- <br>Ing. Guillermo De Cesco<br>Invenio Ingenieria srl.<br>tel: (54)2944 442119<br>cel:(54)2944 15534750<br>web: <a href="http://www.invenioing.com">www.invenioing.com</a><br>Av. Pioneros 4163 Dpto 6. CP(R8402AMH)<br>San Carlos de Bariloche.<br>
Rio Negro, Argentina.<br>
</div>
MIchael Schippling | 1 Jan 2010 21:48

Re: Help with external interrupts on custom MICA2 based mote - attaching some more files...

I'm a little lazy so I don't want to read through all your code, but...

First make sure you have set the PE5 pin as an input with interrupt
enabled, and that nothing...say the micasb board's light sensor
power control...is also trying to use that pin. And check that those
peripheral interrupts are enabled elsewhere if necessary, see
the relevant ATMEGA manual sections.

Second it looks at first blush that your interrupt routine is correct,
but compare it to other examples by searching for TOSH_SIGNAL
and TOSH_INTERRUPT. Also I'm not sure why you have the
comment and code "// disable interrupts" at the end as I would think
that you might need to re-enable them.

Third I have a working interrupt handler for the timer in:
    http://www.etantdonnes.com/Motes/AVR128timers.zip
which might have some exemplar value.

MS

Suresh Mathew wrote:
> Hi,
>
> Due to certain constraints, my project is forced to work on TinyOS1.1. 
> My aim is to wake-up the main micro-controller based on an external 
> interrupt. PortE's 5th pin is being used as the external interrupt. To 
> know if the code is working, I have setup the code in such a way that 
> - each time the external interrupt is generated, the yellow and green 
> LEDs are supposed to toggle. Also, I have included a timer (ONE_SHOT) 
> to the system which makes sure that once the timer fires, the LEDs 
> toggle  5 seconds later.
>
> The external interrupt is level triggered; it has been configured such 
> that if it's logic 0, then the interrupt is generated. Else if it's a 
> logic 1, then no interrupt generated. At present, the external 
> interrupt is not being detected. The analog value of the voltage being 
> fed into the circuit is 3V (VCC for the ATMEGA128 uC is 3.3V). Could 
> you please tell me whether there's anything wrong with the code? Am I 
> missing some configuration? How do I know whether PORTE5 is no longer 
> a general I/O pin but an external interrupt pin?
>
> I have attached all of the necessary files.
>
> Thanks,
> Suresh
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help <at> millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Suresh Mathew | 1 Jan 2010 23:07
Picon
Favicon

Re: Help with external interrupts on custom MICA2 based mote - attaching some more files...

Hi Michael,

Thank you so much for your response!

As you mentioned, I have set up PE5 as an input pin using the commands - cbi(PORTE,5);
and cbi(DDRE,5). Interrupts have been enabled using sei() and sbi(EIMSK,5). I am guessing I have done those things correctly. Also, PE5 is a general I/O port. Is there any extra step that I should be doing to make sure that PE5 is now an external interrupt?

I still have some questions -

  1. How do I know whether the board's light sensor power control is also trying to use the pin? As far as my code goes, it's standalone and it's doesn't use the light sensor power control. Put another way, how do I ensure that PE5 is not being used by anything else but my application?
  2. I have been referring to the sections on Interrupts, I/O ports and External interrupts in the ATMEGA manual. Could you please explain what you mean by peripheral interrupts? How do I enable these peripheral interrupts?
  3. In the code that you sent, the HPL interface is being used to write and read to I/O ports. At the moment, I am not using any such interface. Is it necessary to use such an interface to write to an I/O port. Shouldn't the "cbi" and "sbi" commands take care of that? This has been one of the biggest points of contention for me.
  4. Is the Timer still active when the system is in deep sleep mode?
I know this is a simple enough problem, but it's been evading me over a week! :(

Help!
- Suresh

On Fri, Jan 1, 2010 at 3:48 PM, MIchael Schippling <schip <at> santafe.edu> wrote:
I'm a little lazy so I don't want to read through all your code, but...

First make sure you have set the PE5 pin as an input with interrupt
enabled, and that nothing...say the micasb board's light sensor
power control...is also trying to use that pin. And check that those
peripheral interrupts are enabled elsewhere if necessary, see
the relevant ATMEGA manual sections.

Second it looks at first blush that your interrupt routine is correct,
but compare it to other examples by searching for TOSH_SIGNAL
and TOSH_INTERRUPT. Also I'm not sure why you have the
comment and code "// disable interrupts" at the end as I would think
that you might need to re-enable them.

Third I have a working interrupt handler for the timer in:
  http://www.etantdonnes.com/Motes/AVR128timers.zip
which might have some exemplar value.

MS


Suresh Mathew wrote:
Hi,

Due to certain constraints, my project is forced to work on TinyOS1.1. My aim is to wake-up the main micro-controller based on an external interrupt. PortE's 5th pin is being used as the external interrupt. To know if the code is working, I have setup the code in such a way that - each time the external interrupt is generated, the yellow and green LEDs are supposed to toggle. Also, I have included a timer (ONE_SHOT) to the system which makes sure that once the timer fires, the LEDs toggle  5 seconds later.

The external interrupt is level triggered; it has been configured such that if it's logic 0, then the interrupt is generated. Else if it's a logic 1, then no interrupt generated. At present, the external interrupt is not being detected. The analog value of the voltage being fed into the circuit is 3V (VCC for the ATMEGA128 uC is 3.3V). Could you please tell me whether there's anything wrong with the code? Am I missing some configuration? How do I know whether PORTE5 is no longer a general I/O pin but an external interrupt pin?

I have attached all of the necessary files.

Thanks,
Suresh


------------------------------------------------------------------------

_______________________________________________
Tinyos-help mailing list
Tinyos-help <at> millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


<div>
<p>Hi Michael,<br><br>Thank you so much for your response!<br><br>As you mentioned, I have set up PE5 as an input pin using the commands - cbi(PORTE,5);<br>and cbi(DDRE,5). Interrupts have been enabled using sei() and sbi(EIMSK,5). I am guessing I have done those things correctly. Also, PE5 is a general I/O port. Is there any extra step that I should be doing to make sure that PE5 is now an external interrupt?<br><br>I still have some questions -<br></p>
<ol>
<li>How do I know whether the board's light sensor power control is also trying to use the pin? As far as my code goes, it's standalone and it's doesn't use the light sensor power control. Put another way, how do I ensure that PE5 is not being used by anything else but my application?</li>
<li>I have been referring to the sections on Interrupts, I/O ports and External interrupts in the ATMEGA manual. Could you please explain what you mean by peripheral interrupts? How do I enable these peripheral interrupts?</li>
<li>In the code that you sent, the HPL interface is being used to write and read to I/O ports. At the moment, I am not using any such interface. Is it necessary to use such an interface to write to an I/O port. Shouldn't the "cbi" and "sbi" commands take care of that? This has been one of the biggest points of contention for me.</li>
<li>Is the Timer still active when the system is in deep sleep mode?<br>
</li>
</ol>I know this is a simple enough problem, but it's been evading me over a week! :(<br><br>Help!<br>- Suresh<br><br><div class="gmail_quote">
On Fri, Jan 1, 2010 at 3:48 PM, MIchael Schippling <span dir="ltr">&lt;<a href="mailto:schip <at> santafe.edu">schip <at> santafe.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">
I'm a little lazy so I don't want to read through all your code, but...<br><br>
First make sure you have set the PE5 pin as an input with interrupt<br>
enabled, and that nothing...say the micasb board's light sensor<br>
power control...is also trying to use that pin. And check that those<br>
peripheral interrupts are enabled elsewhere if necessary, see<br>
the relevant ATMEGA manual sections.<br><br>
Second it looks at first blush that your interrupt routine is correct,<br>
but compare it to other examples by searching for TOSH_SIGNAL<br>
and TOSH_INTERRUPT. Also I'm not sure why you have the<br>
comment and code "// disable interrupts" at the end as I would think<br>
that you might need to re-enable them.<br><br>
Third I have a working interrupt handler for the timer in:<br>
 &nbsp; <a href="http://www.etantdonnes.com/Motes/AVR128timers.zip" target="_blank">http://www.etantdonnes.com/Motes/AVR128timers.zip</a><br>
which might have some exemplar value.<br><br>
MS<br><br><br>
Suresh Mathew wrote:<br><blockquote class="gmail_quote">
<div>
<div></div>
<div class="h5">
Hi,<br><br>
Due to certain constraints, my project is forced to work on TinyOS1.1. My aim is to wake-up the main micro-controller based on an external interrupt. PortE's 5th pin is being used as the external interrupt. To know if the code is working, I have setup the code in such a way that - each time the external interrupt is generated, the yellow and green LEDs are supposed to toggle. Also, I have included a timer (ONE_SHOT) to the system which makes sure that once the timer fires, the LEDs toggle &nbsp;5 seconds later.<br><br>
The external interrupt is level triggered; it has been configured such that if it's logic 0, then the interrupt is generated. Else if it's a logic 1, then no interrupt generated. At present, the external interrupt is not being detected. The analog value of the voltage being fed into the circuit is 3V (VCC for the ATMEGA128 uC is 3.3V). Could you please tell me whether there's anything wrong with the code? Am I missing some configuration? How do I know whether PORTE5 is no longer a general I/O pin but an external interrupt pin?<br><br>
I have attached all of the necessary files.<br><br>
Thanks,<br>
Suresh<br><br><br>
</div>
</div>
------------------------------------------------------------------------<br><br>
_______________________________________________<br>
Tinyos-help mailing list<br><a href="mailto:Tinyos-help <at> millennium.berkeley.edu" target="_blank">Tinyos-help <at> millennium.berkeley.edu</a><br><a href="https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help" target="_blank">https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help</a><br>
</blockquote>
<br>
</blockquote>
</div>
<br>
</div>
Guillermo De Cesco | 2 Jan 2010 01:03
Picon

Re: I cannot find my C mig struct

Hi,

suppose you have the following structure defined in mote's side:

 typedef nx_struct SequencedIdPacket{
        nx_uint8_t  moteId;
        nx_uint16_t sqnumber;
        nx_uint8_t  data[ ];
}SequencedIdPacket_t;

, suppose this packet is in tinyos AM message payload, in order to decode the received packet in PC side you have to do as follow (in C code, this differs if you are usisng Java or C#):

      int len, i;
      uint8_t msg_type;
      uint8_t msg_len;
      uint8_t moteId;  
      //HERE I GET A PACKET FROM SERIALFORWARDER MAY BE DIFERENT IF YOU CONNECT DIRECTLY TO SERIAL
      //PORT.
      uint8_t *packet = read_sf_packet(fd, &len);
            
      if (!packet)
            exit(0);

      if (len >= 1 + SPACKET_SIZE && packet[0] == SERIAL_TOS_SERIAL_ACTIVE_MESSAGE_ID){
     
      tmsg_t *msg = new_tmsg(packet + 1, len - 1);

      if (!msg)
           exit(0);

      //THIS IS THE SAME AS EXPLAINED BELOW BUT FOR THE FIELDS OF TINYOS MSG PACKET
      msg_type = spacket_header_type_get(msg);
      msg_len  = spacket_header_length_get(msg);
     
      free(msg);
      //HERE IS WHERE YOU ACTUALLY HAVE A POINTER TO THE BEGINNING OF YOUR DATA
      //AS SEEN BELOW YOU HAVE TO USE THE FUNCTION PROVIDED TO GET THE FIELDS OF THE PACKET
      //iN THIS CASE I AM READING THE MOTES ID
      msg = new_tmsg(packet + 1 + SPACKET_SIZE,len - 1 - SPACKET_SIZE);
      moteId   = seqidpacket_moteId_get(msg);
 .......
----------------------------------------
Notes:
SPACKET_SIZE and SERIAL_TOS_SERIAL_ACTIVE_MESSAGE_ID are defined "serialpacket.h" and correspond to the serial
protocol comunication of tinyos.

prettylisten.c prints Tinyos msg header info and payload in hex format as seen below:

         spacket_header_dest_get(msg),
         spacket_header_src_get(msg),
         spacket_header_length_get(msg),
         spacket_header_group_get(msg),
         spacket_header_type_get(msg));
         hexprint((uint8_t *)tmsg_data(msg) + spacket_data_offset(0), tmsg_length(msg) - spacket_data_offset(0));

         free(msg);
---------------------------------------------

, is not intuitive in fact is more clear when using object oriented languages like java or C#, where the offset and size of fields are known inside the class that reresent the network structure.

hope this bring some ligth to the problem.

-Bill

On Fri, Jan 1, 2010 at 6:22 PM, Echedey Lorenzo <echedey <at> gmail.com> wrote:
Thanks Guillermo for your answer.

The question is.. where and how do I link the generic type tmsg_t to my structure (which I suppose is the enum I see in the mig .h generated file) When I use prettylisten the data I decode is not the one I am expecting. Instead of that, I receive random values. That is why i think I am not linking my new mig struct to tmsg_t.

Kind Regards

2010/1/1 Guillermo De Cesco <decescog <at> gmail.com>

Hi,

because of the difference in architecture between PC and motes, even between motes, you cant cast the message payload to your struct because in the mote the struct will have a size and padding different than it will or could have in PC platform. So here is why MIG is usefull, you make your message based on tmsg_t and fill the fields of your struct using the functiones provided in the .c file. The same way you read the fields of your struct inside the tmsg_t with the functions provided to read or get.

hope this help.

-Bill

On Fri, Jan 1, 2010 at 12:47 PM, Echedey Lorenzo <echedey <at> gmail.com> wrote:
Hi friends,

I want to use the same nx_struct that I use in my telosb sensorial application in my C based listener where I record all the received data:

mig c -c-prefix=TELOSBAPP_H -target=telosb Telosbapp.h mystruct_t -o OUTmystruct_t.h


So I get two files, one .c and one .h with an enum and some functions to get and set data in the structure. But I can't find any C structure to use in those files nor I don't know how to do it. I can see for instance in the prettylisten C example of the SDK ( /opt/tinyos-2.x/support/sdk/c/sf/prettylisten.c )  that it uses the tmsg_t by default. I think I am not matching received values with my C mig structure because I have not linked it in any way. What am I doing wrong? How can I use my mig generated struct (and where is it) with prettylisten?

Thanks a lot and Happy New Year.

--
--------------------------------------------
| Echedey Lorenzo Arencibia  |
--------------------------------------------

_______________________________________________
Tinyos-help mailing list
Tinyos-help <at> millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help



--
Ing. Guillermo De Cesco
Invenio Ingenieria srl.
tel: (54)2944 442119
cel:(54)2944 15534750
web: www.invenioing.com
Av. Pioneros 4163 Dpto 6. CP(R8402AMH)
San Carlos de Bariloche.
Rio Negro, Argentina.



--
--------------------------------------------
| Echedey Lorenzo Arencibia  |
--------------------------------------------



--
Ing. Guillermo De Cesco
Invenio Ingenieria srl.
tel: (54)2944 442119
cel:(54)2944 15534750
web: www.invenioing.com
Av. Pioneros 4163 Dpto 6. CP(R8402AMH)
San Carlos de Bariloche.
Rio Negro, Argentina.
<div>
<p>Hi,<br><br>suppose you have the following structure defined in mote's side:<br><br>&nbsp;typedef nx_struct SequencedIdPacket{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nx_uint8_t&nbsp; moteId;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nx_uint16_t sqnumber;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nx_uint8_t&nbsp; data[ ];<br>
}SequencedIdPacket_t;<br><br>, suppose this packet is in tinyos AM message payload, in order to decode the received packet in PC side you have to do as follow (in C code, this differs if you are usisng Java or C#):<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int len, i;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  uint8_t msg_type;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uint8_t msg_len;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uint8_t moteId;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //HERE I GET A PACKET FROM SERIALFORWARDER MAY BE DIFERENT IF YOU CONNECT DIRECTLY TO SERIAL<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //PORT.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uint8_t *packet = read_sf_packet(fd, &amp;len);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!packet)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(0);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (len &gt;= 1 + SPACKET_SIZE &amp;&amp; packet[0] == SERIAL_TOS_SERIAL_ACTIVE_MESSAGE_ID){<br>&nbsp;&nbsp;&nbsp; &nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tmsg_t *msg = new_tmsg(packet + 1, len - 1);<br><br>&nbsp;&nbsp;&nbsp; &nbsp; if (!msg)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(0);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //THIS IS THE SAME AS EXPLAINED BELOW BUT FOR THE FIELDS OF TINYOS MSG PACKET<br>&nbsp;&nbsp;&nbsp; &nbsp; msg_type = spacket_header_type_get(msg);<br>&nbsp;&nbsp;&nbsp; &nbsp; msg_len&nbsp; = spacket_header_length_get(msg);<br>&nbsp;&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp;&nbsp; &nbsp; free(msg);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //HERE IS WHERE YOU ACTUALLY HAVE A POINTER TO THE BEGINNING OF YOUR DATA<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //AS SEEN BELOW YOU HAVE TO USE THE FUNCTION PROVIDED TO GET THE FIELDS OF THE PACKET<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //iN THIS CASE I AM READING THE MOTES ID <br>
&nbsp;&nbsp;&nbsp; &nbsp; msg = new_tmsg(packet + 1 + SPACKET_SIZE,len - 1 - SPACKET_SIZE);<br>&nbsp;&nbsp;&nbsp; &nbsp; moteId&nbsp;&nbsp; = seqidpacket_moteId_get(msg);<br>&nbsp;.......<br>----------------------------------------<br>Notes:<br>SPACKET_SIZE and  SERIAL_TOS_SERIAL_ACTIVE_MESSAGE_ID are defined "serialpacket.h" and correspond to the serial<br>
protocol comunication of tinyos. <br><br>prettylisten.c prints Tinyos msg header info and payload in hex format as seen below:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; spacket_header_dest_get(msg),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;spacket_header_src_get(msg),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;spacket_header_length_get(msg),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;spacket_header_group_get(msg),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;spacket_header_type_get(msg));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; hexprint((uint8_t *)tmsg_data(msg) + spacket_data_offset(0), tmsg_length(msg) - spacket_data_offset(0));<br><br>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; free(msg);<br>
---------------------------------------------<br><br>, is not intuitive in fact is more clear when using object oriented languages like java or C#, where the offset and size of fields are known inside the class that reresent the network structure.<br><br>hope this bring some ligth to the problem.<br><br>-Bill<br><br></p>
<div class="gmail_quote">On Fri, Jan 1, 2010 at 6:22 PM, Echedey Lorenzo <span dir="ltr">&lt;<a href="mailto:echedey <at> gmail.com">echedey <at> gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">Thanks Guillermo for your answer.<br><br>The question is.. where and how do I link the generic type tmsg_t to my structure (which I suppose is the enum I see in the mig .h generated file) When I use prettylisten the data I decode is not the one I am expecting. Instead of that, I receive random values. That is why i think I am not linking my new mig struct to tmsg_t.<br><br>Kind Regards<br><br><div class="gmail_quote">2010/1/1 Guillermo De Cesco <span dir="ltr">&lt;<a href="mailto:decescog <at> gmail.com" target="_blank">decescog <at> gmail.com</a>&gt;</span><div>
<div></div>
<div class="h5">
<br><blockquote class="gmail_quote">

Hi, <br><br>because of the difference in architecture between PC and motes, even between motes, you cant cast the message payload to your struct because in the mote the struct will have a size and padding different than it will or could have in PC platform. So here is why MIG is usefull, you make your message based on tmsg_t and fill the fields of your struct using the functiones provided in the .c file. The same way you read the fields of your struct inside the tmsg_t with the functions provided to read or get.<br><br>hope this help.<br><br>-Bill<br><br><div class="gmail_quote">
<div>
<div></div>
<div>On Fri, Jan 1, 2010 at 12:47 PM, Echedey Lorenzo <span dir="ltr">&lt;<a href="mailto:echedey <at> gmail.com" target="_blank">echedey <at> gmail.com</a>&gt;</span> wrote:<br>
</div>
</div>
<blockquote class="gmail_quote">
<div>
<div></div>
<div>
Hi friends,<br><br>I want to use the same nx_struct that I use in my telosb sensorial application in my C based listener where I record all the received data:<br><br clear="all">mig c -c-prefix=TELOSBAPP_H -target=telosb Telosbapp.h mystruct_t -o OUTmystruct_t.h<br><br><br>So I get two files, one .c and one .h with an enum and some functions to get and set data in the structure. But I can't find any C structure to use in those files nor I don't know how to do it. I can see for instance in the prettylisten C example of the SDK ( /opt/tinyos-2.x/support/sdk/c/sf/prettylisten.c )&nbsp; that it uses the tmsg_t by default. I think I am not matching received values with my C mig structure because I have not linked it in any way. What am I doing wrong? How can I use my mig generated struct (and where is it) with prettylisten?<br><br>Thanks a lot and Happy New Year.<br><br>-- <br>--------------------------------------------<br>| Echedey Lorenzo Arencibia &nbsp;|<br>--------------------------------------------<br><br>
</div>
</div>_______________________________________________<br>
Tinyos-help mailing list<br><a href="mailto:Tinyos-help <at> millennium.berkeley.edu" target="_blank">Tinyos-help <at> millennium.berkeley.edu</a><br><a href="https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help" target="_blank">https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help</a><br>
</blockquote>
</div>
<br><br clear="all"><br>

-- <br>Ing. Guillermo De Cesco<br>Invenio Ingenieria srl.<br>tel: (54)2944 442119<br>cel:(54)2944 15534750<br>web: <a href="http://www.invenioing.com" target="_blank">www.invenioing.com</a><br>Av. Pioneros 4163 Dpto 6. CP(R8402AMH)<br>

San Carlos de Bariloche.<br>
Rio Negro, Argentina.<br>
</blockquote>
</div>
</div>
</div>
<br><br clear="all"><br>-- <br>--------------------------------------------<br>| Echedey Lorenzo Arencibia &nbsp;|<br>--------------------------------------------<br>
</blockquote>
</div>
<br><br clear="all"><br>-- <br>Ing. Guillermo De Cesco<br>Invenio Ingenieria srl.<br>tel: (54)2944 442119<br>cel:(54)2944 15534750<br>web: <a href="http://www.invenioing.com">www.invenioing.com</a><br>
Av. Pioneros 4163 Dpto 6. CP(R8402AMH)<br>San Carlos de Bariloche.<br>Rio Negro, Argentina.<br>
</div>
Manjunath Doddavenkatappa | 2 Jan 2010 04:33
Picon
Favicon

Re: Is tinyos-1.x compatible with micaz


Hi,

 	If you are starting to use TinyOS, I suggest you to start using 
2.x. However, the problem in your case could be that you might not have
installed avr-tools.

TelosB is build of TI MSP340 MCU and since you might have installed 
msp430-tools,"make telosb" always work. Whereas micaZ is built of AVR 
AtMega128L.

Regards,
Manjunath D

################################################################################################################
***************************************************************************************************************

On Thu, 31 Dec 2009, ymj011 wrote:

> Hi all,
> I am studying tinyos and have a question about it. I try to intall the Blink programme on a micaz mote, it
always fail. While if I install the Blink programme on a telosb, it work well. Is the tinyos-1.x compatible
with micaz?
> My Os is xubuntos, and the Blink programme locates in the directory of "opt/Tinyos-1.x/apps/Blink"
> Thanks you!
> Yin
>
Mido | 2 Jan 2010 19:12
Picon

Do events preempt other events?

Hi,

I'd always assumed that events can preempt events.

For example, in the below code, the event AMSend.sendDone should preempt
Timer1.fired (as Timer1.fired runs for a long time). 

However, this is not happening. 
Things do not change when I move the code inside Timer1.fired to a task, and
post this task from Timer1.fired.

So, do events preempt other events?

One more question:
Section 1.2.1 of the TinyOS programming book (2nd edition), mentions
"Low-level interrupt code". 
How can I find the interrupt code that is related certain events such as
Timer.fired, AMSend.sendDone, and Sensor.readDone.

Thanks.

event void Boot.booted() {call AMControl.start(); }
event void AMControl.startDone(error_t err) {if (err == SUCCESS) {call
Timer0.startPeriodic(900); call Timer1.startPeriodic(1000); } else {call
AMControl.start();} }
event void AMControl.stopDone(error_t err) { }
event void Timer0.fired() 
{
if (!busy) 
{
	BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)(call
Packet.getPayload(&pkt, NULL));
	btrpkt->nodeid = TOS_NODE_ID;
	btrpkt->counter = counter;
	if (call AMSend.send(AM_BROADCAST_ADDR, &pkt,
sizeof(BlinkToRadioMsg)) == SUCCESS) {busy = TRUE;}
}
}
event void AMSend.sendDone(message_t* msg, error_t error) {   if (&pkt ==
msg) {busy = FALSE;}}
event void Sensor.readDone(error_t result, uint16_t data)  {}

event void Timer1.fired() 
{
t=269;p=40;
for (t=0;t<100;t++){for (i=0;i<10000;i++){n+=p;n=0;n*=p+5;}}call
Leds.led0Toggle();
}


Gmane