[Tinyos-help] help needed on uint64_t type

ivi610 ivi610 at yahoo.fr
Thu Feb 5 23:24:03 PST 2009


Hello
i had the same problem with uint64_t on zigbit modules which include an atmega1281 mcu.
i did it with an union :
something like that just check the union type in c language!
union {

uint32 a[2];
uint64 a64;
} aunion;

print( a[0])
print(a[1])

something like that sould work.
it's pseudo code but it did it for me in C.

 Cyril




________________________________
De : "tinyos-help-request at millennium.berkeley.edu" <tinyos-help-request at millennium.berkeley.edu>
À : tinyos-help at millennium.berkeley.edu
Envoyé le : Vendredi, 6 Février 2009, 0h51mn 13s
Objet : Tinyos-help Digest, Vol 70, Issue 12

Send Tinyos-help mailing list submissions to
    tinyos-help at millennium.berkeley.edu

To subscribe or unsubscribe via the World Wide Web, visit
    https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

or, via email, send a message with subject or body 'help' to
    tinyos-help-request at millennium.berkeley.edu

You can reach the person managing the list at
    tinyos-help-owner at millennium.berkeley.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tinyos-help digest..."


Today's Topics:

   1. Deluge T2 dissemination problem on XubunTOS-2.1.0
      (Mehmet Akif Antepli)
   2. Re: help needed on uint64_t type (BAI LI)
   3. Re: help needed on uint64_t type (BAI LI)
   4. Re: help needed on uint64_t type (Eric Decker)
   5. tossim acknowledgement when TOS_NODE_ID is different    from AM
      address (Jung Woo Lee)
   6. Re: tossim acknowledgement when TOS_NODE_ID is    different from
      AM address (Philip Levis)
   7. Mote-PC serial communication and SerialForwarder (Andrew C. Jung)


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

Message: 1
Date: Thu, 5 Feb 2009 22:55:00 +0200
From: Mehmet Akif Antepli <akifantepli at gmail.com>
Subject: [Tinyos-help] Deluge T2 dissemination problem on
    XubunTOS-2.1.0
To: tinyos help <tinyos-help at millennium.berkeley.edu>
Message-ID:
    <f7db91190902051255y55edbdc7rccda4ff5c0248a6a at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi,

Could anybody help me with the following? I got stuck with the
dissemination problem below!


I am working on XubunTOS-2.1 and using two motes; one is a MICAz and
the other is a TelosB mote.

I am using MICAz as base-station and trying to program TelosB using
Deluge T2 with the following steps:

1-) In order to load GoldenImage into MICAz, I use the following
command on the console opened in the GoldenImage directory;

"CFLAGS+=DDELUGE_BASESTATION make micaz install,0 mib520,/dev/ttyUSB0"

2-)  Then I load GoldenImage into TelosB, also. I use the following
command on the console opened in the GoldenImage directory;

"CFLAGS+=DDELUGE_LIGHT_BASESTATION make telosb install,1 bsl,/dev/ttyUSB2"

3-) After loading GoldenImage to both motes, I build
"/opt/tinyos-2.1.0/apps/tests/deluge/Blink" application for Telosb
whom I will insert into MICAz's flash and try to disseminate it
so that I hope I would reboot TelosB with that Blink image. I use the
following command on the console opened in the Blink directory;

"make telosb"

3-) Then, I load Blink application image (build for TelosB) as 1st
image into MICAz's flash with the following command;

"tos-deluge /dev/ttyUSB1 micaz -i 1
/opt/tinyos-2.1.0/apps/tests/deluge/Blink/build/telosb/tos_image.xml"

4-) Then I ping MICAz base-station with the following command;

"tos-deluge /dev/ttyUSB1 micaz -p 1"

and i see that MICAz is loaded with  GoldenImage and Blink application
image is on its flash as the 1st image.

Also pinging TelosB with "tos-deluge /dev/ttyUSB2 telosb -p 0" command
shows that GoldenImage is loaded.

Therefore, upto now, all the steps work. However, the problem is in
the last step!

5-) Finally, I try to disseminate Blink image and reboot telosB. I run
the following two commands;

"tos-deluge /dev/ttyUSB1 micaz -d 1"
"tos-deluge /dev/ttyUSB1 micaz -dr 1"

For both command, it got the following message,

"Command is sent"

Then, I assume that dissemination is finished and TelosB would reboot
itself. However, nothing happens on TelosB (It does not blink!)

Then, I ping TelosB and see nothing more than GoldenImage! Disseminate
does not work. Blink application image did not loaded to TelosB

I couldn't figure out the wrong thing here.

Any suggestions?

Thanks in advence,

Mehmet Akif Antepli
Graduate Student
Dept. of Electrical-Electronics Eng.
METU


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

Message: 2
Date: Fri, 6 Feb 2009 07:32:18 +1000
From: BAI LI <libai0915 at gmail.com>
Subject: Re: [Tinyos-help] help needed on uint64_t type
To: kiseop Lee <acorrd at gmail.com>
Cc: Tinyos-Help <tinyos-help at millennium.berkeley.edu>
Message-ID:
    <1254364b0902051332q63b3d89au924f312c9f4a25fb at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi All,

I just tested it. I guess prinf couldn't print 64 bits variables but low 32
btis instead. By moving the  variable 32 bits left, it can print the high 32
bits. such as a>>32. it made the debugging work a bit harder but still ok.
Anyone kowns how to print the whole variable instead breaking it into two
parts. Let me know. Thanks.

Regards,
Bai

On Thu, Feb 5, 2009 at 5:56 PM, kiseop Lee <acorrd at gmail.com> wrote:

> Hi,
> This is tested in Visual C++ in the Windows. but I don't know it in tinyos
> compiler.
> Only refer to your work...
>
>  char sql[100];
>
> __int64 var1=0x12345678ABCDABCD;
>  sprintf(sql,"%I64x",var1);   //not L. Upper case of i[ai]...
> sprintf(sql,"%I64d",var1);
>
> Best regards,
> K.S.Lee
>
>  2009/2/5 BAI LI <libai0915 at gmail.com>
>
>> Hi All,
>>
>> I have defined a uint64_t type variable as follows:
>>
>> uint64_t a;
>> a=0x0000FFFFFFFFFFFF;
>> printf("a= %lld /n",a);
>> printf("a= %llx /n",a);
>>
>> the result displayed as follows:
>>
>> a= -1
>> a= ffffffff
>>
>> The compilation didn't show any error. What is the problem? Does printf
>> support to display the uint64_t type? Any help would be appreciated!
>>
>> Regards,
>> Bai
>>
>>
>> _______________________________________________
>> Tinyos-help mailing list
>> Tinyos-help at millennium.berkeley.edu
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090206/8b3973de/attachment-0001.htm 

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

Message: 3
Date: Fri, 6 Feb 2009 07:40:06 +1000
From: BAI LI <libai0915 at gmail.com>
Subject: Re: [Tinyos-help] help needed on uint64_t type
To: Andrey Gursky <andrey.gursky at online.ua>
Cc: Tinyos-Help <tinyos-help at millennium.berkeley.edu>
Message-ID:
    <1254364b0902051340w303e4184pde9b2080920ef00f at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi Andrey,

I just tested it. it didn't work though. What the flag you used in printf?
Is that llx? Right? It still displayed low 32 bits. Confusing.

Regards,
Bai

On Fri, Feb 6, 2009 at 3:27 AM, Andrey Gursky <andrey.gursky at online.ua>wrote:

> Bai, you should explicit write ULL at the end of the such big number
> (tested in C):
> a=0x0000FFFFFFFFFFFFULL;
>
> Best wishes,
> Andrey
>
>  Hi All,
>
> I have defined a uint64_t type variable as follows:
>
> uint64_t a;
> a=0x0000FFFFFFFFFFFF;
> printf("a= %lld /n",a);
> printf("a= %llx /n",a);
>
> the result displayed as follows:
>
> a= -1
> a= ffffffff
>
> The compilation didn't show any error. What is the problem? Does printf
> support to display the uint64_t type? Any help would be appreciated!
>
> Regards,
> Bai
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090206/e90e54dc/attachment-0001.htm 

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

Message: 4
Date: Thu, 5 Feb 2009 13:43:37 -0800
From: Eric Decker <cire831 at gmail.com>
Subject: Re: [Tinyos-help] help needed on uint64_t type
To: BAI LI <libai0915 at gmail.com>
Cc: Tinyos-Help <tinyos-help at millennium.berkeley.edu>
Message-ID:
    <c4c4fa8e0902051343i664b8249hbb4ffebd0eddd753 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

I don't think the tinyos printf handles 64 bit objects.

eric


On Thu, Feb 5, 2009 at 1:32 PM, BAI LI <libai0915 at gmail.com> wrote:

> Hi All,
>
> I just tested it. I guess prinf couldn't print 64 bits variables but low 32
> btis instead. By moving the  variable 32 bits left, it can print the high 32
> bits. such as a>>32. it made the debugging work a bit harder but still ok.
> Anyone kowns how to print the whole variable instead breaking it into two
> parts. Let me know. Thanks.
>
> Regards,
> Bai
>
> On Thu, Feb 5, 2009 at 5:56 PM, kiseop Lee <acorrd at gmail.com> wrote:
>
>> Hi,
>> This is tested in Visual C++ in the Windows. but I don't know it in tinyos
>> compiler.
>> Only refer to your work...
>>
>>  char sql[100];
>>
>> __int64 var1=0x12345678ABCDABCD;
>>  sprintf(sql,"%I64x",var1);   //not L. Upper case of i[ai]...
>> sprintf(sql,"%I64d",var1);
>>
>> Best regards,
>> K.S.Lee
>>
>>  2009/2/5 BAI LI <libai0915 at gmail.com>
>>
>>> Hi All,
>>>
>>> I have defined a uint64_t type variable as follows:
>>>
>>> uint64_t a;
>>> a=0x0000FFFFFFFFFFFF;
>>> printf("a= %lld /n",a);
>>> printf("a= %llx /n",a);
>>>
>>> the result displayed as follows:
>>>
>>> a= -1
>>> a= ffffffff
>>>
>>> The compilation didn't show any error. What is the problem? Does printf
>>> support to display the uint64_t type? Any help would be appreciated!
>>>
>>> Regards,
>>> Bai
>>>
>>>
>>> _______________________________________________
>>> Tinyos-help mailing list
>>> Tinyos-help at millennium.berkeley.edu
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>
>>
>>
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
Autonomous Systems Lab
Jack Baskin School of Engineering
UCSC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090205/ab78f089/attachment-0001.htm 

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

Message: 5
Date: Thu, 5 Feb 2009 14:30:17 -0800
From: Jung Woo Lee <jungwoo.lee at stanford.edu>
Subject: [Tinyos-help] tossim acknowledgement when TOS_NODE_ID is
    different    from AM address
To: tinyos-help at millennium.berkeley.edu
Message-ID:
    <77d304040902051430p1f973df7s2aeac371b8483c99 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hello,

I found that when I set AM address to a value that is different from
TOS_NODE_ID in TOSSIM, an ack is not received in a sender.

I think it's because of a code in CpmModelC that compares TOS_NODE_ID
to AM ADDRESS:


In CpmModelC.nc
command void Model.putOnAirTo(
...
sim_gain_put(other, msg, endTime, ack && (other == dest) ...
...
dest is an AM ADDRESS and other is a node id.

When I remove (other == dest), it seemed to work fine.

Jung Woo


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

Message: 6
Date: Thu, 5 Feb 2009 14:45:11 -0800
From: Philip Levis <pal at cs.stanford.edu>
Subject: Re: [Tinyos-help] tossim acknowledgement when TOS_NODE_ID is
    different from AM address
To: Jung Woo Lee <jungwoo.lee at stanford.edu>
Cc: tinyos-help at millennium.berkeley.edu
Message-ID: <07AE6EE5-0BE6-4AA1-85DE-2441BF420886 at cs.stanford.edu>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes


On Feb 5, 2009, at 2:30 PM, Jung Woo Lee wrote:

> Hello,
>
> I found that when I set AM address to a value that is different from
> TOS_NODE_ID in TOSSIM, an ack is not received in a sender.
>
> I think it's because of a code in CpmModelC that compares TOS_NODE_ID
> to AM ADDRESS:
>
>
> In CpmModelC.nc
> command void Model.putOnAirTo(
> ...
> sim_gain_put(other, msg, endTime, ack && (other == dest) ...
> ...
> dest is an AM ADDRESS and other is a node id.
>
> When I remove (other == dest), it seemed to work fine.

Nice catch. The (other == dest) check is redundant due to the up-call  
to shouldAck. I'll check in a fix.

Phil


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

Message: 7
Date: Thu, 5 Feb 2009 18:50:13 -0500
From: "Andrew C. Jung" <cjung1021 at gmail.com>
Subject: [Tinyos-help] Mote-PC serial communication and
    SerialForwarder
To: tinyos-help at millennium.berkeley.edu
Message-ID:
    <8c96fbf60902051550t274306camf1ed6134aaacf81c at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hello...  I am new to use TinyOS.  I am following the lesson4 which is
"Mote-PC serial communication and SerialForwarder".  TinyOS 2.0.2 is
installed on ubuntu 8.10. system and I am working with Mica2.  when I type "
$ java net.tinyos.tools.Listen -comm serial@/dev/ttyUSB0:mica2", I got
following errors:

**************************************
java net.tinyos.tools.Listen -comm serial@/dev/ttyUSB0:mica2
Exception in thread "main" java.lang.NoClassDefFoundError:
net/tinyos/tools/Listen
Caused by: java.lang.ClassNotFoundException: net.tinyos.tools.Listen
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: net.tinyos.tools.Listen.  Program will exit.
*******************************************

Also, I couldn't install TestSerial application on a mote.

If anyone knows how to fix it, please help me.

Sincerely,

Andrew C. Jung
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090205/810de211/attachment.htm 

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

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

End of Tinyos-help Digest, Vol 70, Issue 12
*******************************************



      __________________________________________________________________________________________________
Ne pleurez pas si votre Webmail ferme ! Récupérez votre historique sur Yahoo! Mail ! http://fr.docs.yahoo.com/mail/transfert_mails.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090206/72be3660/attachment-0001.htm 


More information about the Tinyos-help mailing list