[Tinyos-help] Problem with TinyECC ecc.h and Eclipse / Yeti2 plugin
Hi, I want to use TinyECC in Eclipse. Where do I have to include the TinyECC-Folder that I can use it correctly? I included it in the run configurations, in the global tinyOS-Settings and in the project preferences. the plugin finds the files from ECC, but it throws me errors in ECC.h which i included in the first row. the error is: (in included file; see ECC.h: 72) data object declaration: expected a 'field declarations', common missing tokens at this place: '}', to complete expression, insert one of: '}', 'typedef', 'extern', 'static', 'auto', 'register', 'void', 'char', 'short', 'int', 'long', 'float', 'double', 'signed', 'unsigned', '_BOOL', '_Complex', 'struct', 'union', 'enum', 'const', 'restrict', 'volatile', 'inline', 'default', 'nx_struct', 'nx_union', 'command', 'event', 'async', 'norace', 'task', 'typedef name' This error is dislpayed for other rows in ECC.h, too. When I open ECC.h, there is no error showen. I attached the ECC.h and the in ECC.h included NN.h Thanks for your help! Markus /** * $Id: ECC.h,v 1.13 2007/11/02 22:36:39 aliu3 Exp $ * Ecc.h * define the data structure for ECC operation */ #ifndef _ECC_H_ #define _ECC_H_ #include NN.h #ifndef PROJECTIVE #define AFFINE #endif #ifdef PROJECTIVE //enable mixed projective coordinate addition #define ADD_MIX //enable repeated point doubling #define REPEAT_DOUBLE #endif #ifdef SLIDING_WIN //The size of sliding window, must be power of 2 (change this if you //want to use other window size, for example: 2 or 4) #define W_BITS 4 //basic mask used to generate mask array (you need to change this if //you want to change window size) //For example: if W_BITS is 2, BASIC_MASK must be 0x03; // if W_BITS is 4, BASIC_MASK must be 0x0f // if W_BITS is 8, BASIC_MASK must be 0xff #define BASIC_MASK 0xf //number of windows in one digit, NUM_MASKS = NN_DIGIT_BITS/W_BITS #define NUM_MASKS (NN_DIGIT_BITS/W_BITS) //number of points for precomputed points, NN_POINTS = 2^W_BITS - 1 #define NUM_POINTS ((1 W_BITS) - 1) #endif //the data structure define the elliptic curve struct Curve { // curve's coefficients NN_DIGIT a[NUMWORDS]; NN_DIGIT b[NUMWORDS]; //whether a is -3 uint8_t a_minus3; //whether a is zero uint8_t a_zero; uint8_t a_one; }; typedef struct Curve Curve; struct Point { // point's coordinates NN_DIGIT x[NUMWORDS]; NN_DIGIT y[NUMWORDS]; }; typedef struct Point Point; struct ZCoordinate { NN_DIGIT z[NUMWORDS]; }; typedef struct ZCoordinate ZCoordinate; //all the parameters needed for elliptic curve operation struct Params { // prime modulus NN_DIGIT p[NUMWORDS]; // Omega, p = 2^m -omega NN_DIGIT omega[NUMWORDS]; // curve over which ECC will be performed Curve E; // base point, a point on E of order r Point G; // a positive, prime integer dividing the number of points on E NN_DIGIT r[NUMWORDS]; // a positive prime integer, s.t. k = #E/r //NN_DIGIT k[NUMWORDS]; }; typedef struct Params Params; //all the parameters needed for elliptic curve operations of Tate Pairing struct TPParams { // prime modulus NN_DIGIT p[NUMWORDS]; // curve over which ECC will be performed Curve E; // group order m NN_DIGIT m[NUMWORDS]; // c = ((p^k)-1)/m NN_DIGIT c[NUMWORDS]; // point P Point P; }; typedef struct TPParams TPParams; //structure for precomputed points and slope struct PointSlope { uint8_t dbl; //TRUE for double, FALSE for add Point P; NN_DIGIT slope[NUMWORDS]; struct PointSlope * next; }; typedef struct PointSlope PointSlope; #endif /** * $Id: NN.h,v 1.9 2007/09/12 18:17:06 aliu3 Exp $ */ #ifndef _NN_H_ #define _NN_H_ // frequency (in MHz) of the imote2 processor #if CORE_FREQ == 13 #define CORE_BUS 13 #elif CORE_FREQ == 104 #define CORE_BUS 104 #elif CORE_FREQ == 208 #define CORE_BUS 208 #elif CORE_FREQ == 416 #define CORE_BUS 208 #endif //#define BARRETT_REDUCTION //#define HYBRID_MULT //hybrid multiplication //#define HYBRID_SQR //hybrd squaring //#define CURVE_OPT //optimization for SECG curves #define MODINVOPT #ifdef TEST_VECTOR #define KEY_BIT_LEN 160 #define HYBRID_MUL_WIDTH5 #else #if defined (SECP128R1) || defined (SECP128R2) #define KEY_BIT_LEN 128 #define HYBRID_MUL_WIDTH4 #else #if defined (SECP160K1) || defined (SECP160R1) || defined (SECP160R2) #define KEY_BIT_LEN 160 #define HYBRID_MUL_WIDTH5 //column width=5 for hybrid multiplication #else #if defined (SECP192K1) || defined (SECP192R1) || defined (SS192K2) || defined (SS192K2S) #define KEY_BIT_LEN 192 #define HYBRID_MUL_WIDTH4 #else #if defined (SS512K2) || defined (SS512K2S) #define BARRETT_REDUCTION #define KEY_BIT_LEN 512 #define HYBRID_MUL_WIDTH5 #endif // end of 512 #endif //end of 192 #endif //end of 160 #endif //end of 128 #endif //TEST_VECTOR //mica, mica2, micaz #ifdef PLATFORM_MICAZ #define EIGHT_BIT_PROCESSOR #define INLINE_ASM #endif //telosb #ifdef
Re: [Tinyos-help] Broadcast packet not received by all motes
Unless you have some randomisation before you transmit packets, sounds like your packets are interfering with each other. SendDone can be signaled even if packet's lost in propagation (I think..). -Original Message- From: tinyos-help-boun...@millennium.berkeley.edu [mailto:tinyos-help-boun...@millennium.berkeley.edu]on Behalf Of Simon Eberz Sent: 28 October 2010 18:42 To: tinyos-help@millennium.berkeley.edu Subject: [Tinyos-help] Broadcast packet not received by all motes Hi, I'm implementing a simple message exchange between two motes (to measure the RSSI, but this is not of interest) and send the messages as broadcasts. I'm using the TinyOS Basestation application with the Listen-Tool to check which messages have been sent. Here's the problem: I have two motes (call them A and B) with nearly identical code flashed to them. A sends a message (broadcast), and after that each mote will send a new broadcast after receiving a packet. All messages sent by A are also received, and thus displayed, by the BaseStation-mote, and the LEDs indicate that all messages are also received by B [otherwise only one message would be sent anyway]. But, when B sends a message, it seems to be received by A [as A responds with yet another packet], but is not displayed by the BaseStation-App. I tried to verify this by flashing a third mote with custom code, same issue. If I just call the SendProbe-method [see below] on mote B it works fine and switching motes doesn't help either. LEDs suggest that the SendDone-Event is triggered on both motes. Ultimately, it seems that the broadcasts are only received by the mote from which the last message was received (?). Is there any property of broadcasts that I am not aware of? Here is the (relevant) code I use: void SendProbe(){ probe = (ProbeMsg*)(call Packet.getPayload(pkt,NULL)); probe-source = 1; probe-counter = counter; call AMSend.send(AM_BROADCAST_ADDR, pkt, sizeof(ProbeMsg)); } event message_t * Receive.receive(message_t *msg, void *payload, uint8_t len){ if(len==sizeof(ProbeMsg)){ probe = (ProbeMsg*)payload; call Timer.startOneShot(DELAY_BETWEEN_PROBES); } return msg; } event void Timer.fired(){ SendProbe(); } Thanks for your help ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/t inyos-help Please consider the environment before printing a hard copy of this e-mail. The information contained in this e-mail is confidential. It is intended only for the stated addressee(s) and access to it by any other person is unauthorised. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this e-mail. Such unauthorised use may be unlawful. If you have received this e-mail in error, please inform us immediately on +44 (0)118 986 8601 and delete it and all copies from your system. Thales Research and Technology (UK) Limited. A company registered in England and Wales. Registered Office: 2 Dashwood Lang Road, The Bourne Business Park, Addlestone, Weybridge, Surrey KT15 2NX. Registered Number: 774298 Thales UK Limited. A company registered in England and Wales. Registered Office: 2 Dashwood Lang Road, The Bourne Business Park, Addlestone, Weybridge, Surrey KT15 2NX. Registered Number: 868273 ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Broadcast packet not received by all motes
This should not be the case, as packets are only sent as a respone and after a short waiting period (20ms). Thus, the two motes can never send at the same time. Unless you have some randomisation before you transmit packets, sounds like your packets are interfering with each other. SendDone can be signaled even if packet's lost in propagation (I think..). -Original Message- From: tinyos-help-boun...@millennium.berkeley.edu [mailto:tinyos-help-boun...@millennium.berkeley.edu]on Behalf Of Simon Eberz Sent: 28 October 2010 18:42 To: tinyos-help@millennium.berkeley.edu Subject: [Tinyos-help] Broadcast packet not received by all motes Hi, I'm implementing a simple message exchange between two motes (to measure the RSSI, but this is not of interest) and send the messages as broadcasts. I'm using the TinyOS Basestation application with the Listen-Tool to check which messages have been sent. Here's the problem: I have two motes (call them A and B) with nearly identical code flashed to them. A sends a message (broadcast), and after that each mote will send a new broadcast after receiving a packet. All messages sent by A are also received, and thus displayed, by the BaseStation-mote, and the LEDs indicate that all messages are also received by B [otherwise only one message would be sent anyway]. But, when B sends a message, it seems to be received by A [as A responds with yet another packet], but is not displayed by the BaseStation-App. I tried to verify this by flashing a third mote with custom code, same issue. If I just call the SendProbe-method [see below] on mote B it works fine and switching motes doesn't help either. LEDs suggest that the SendDone-Event is triggered on both motes. Ultimately, it seems that the broadcasts are only received by the mote from which the last message was received (?). Is there any property of broadcasts that I am not aware of? Here is the (relevant) code I use: void SendProbe(){ probe = (ProbeMsg*)(call Packet.getPayload(pkt,NULL)); probe-source = 1; probe-counter = counter; call AMSend.send(AM_BROADCAST_ADDR,pkt, sizeof(ProbeMsg)); } event message_t * Receive.receive(message_t *msg, void *payload, uint8_t len){ if(len==sizeof(ProbeMsg)){ probe = (ProbeMsg*)payload; call Timer.startOneShot(DELAY_BETWEEN_PROBES); } return msg; } event void Timer.fired(){ SendProbe(); } Thanks for your help ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/t inyos-help Please consider the environment before printing a hard copy of this e-mail. The information contained in this e-mail is confidential. It is intended only for the stated addressee(s) and access to it by any other person is unauthorised. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this e-mail. Such unauthorised use may be unlawful. If you have received this e-mail in error, please inform us immediately on +44 (0)118 986 8601 and delete it and all copies from your system. Thales Research and Technology (UK) Limited. A company registered in England and Wales. Registered Office: 2 Dashwood Lang Road, The Bourne Business Park, Addlestone, Weybridge, Surrey KT15 2NX. Registered Number: 774298 Thales UK Limited. A company registered in England and Wales. Registered Office: 2 Dashwood Lang Road, The Bourne Business Park, Addlestone, Weybridge, Surrey KT15 2NX. Registered Number: 868273 ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Broadcast packet not received by all motes
use CCA enable before sending something out. On Fri, Oct 29, 2010 at 1:44 PM, Simon Eberz s_eb...@cs.uni-kl.de wrote: This should not be the case, as packets are only sent as a respone and after a short waiting period (20ms). Thus, the two motes can never send at the same time. Unless you have some randomisation before you transmit packets, sounds like your packets are interfering with each other. SendDone can be signaled even if packet's lost in propagation (I think..). -Original Message- From: tinyos-help-boun...@millennium.berkeley.edu [mailto:tinyos-help-boun...@millennium.berkeley.edu]on Behalf Of Simon Eberz Sent: 28 October 2010 18:42 To: tinyos-help@millennium.berkeley.edu Subject: [Tinyos-help] Broadcast packet not received by all motes Hi, I'm implementing a simple message exchange between two motes (to measure the RSSI, but this is not of interest) and send the messages as broadcasts. I'm using the TinyOS Basestation application with the Listen-Tool to check which messages have been sent. Here's the problem: I have two motes (call them A and B) with nearly identical code flashed to them. A sends a message (broadcast), and after that each mote will send a new broadcast after receiving a packet. All messages sent by A are also received, and thus displayed, by the BaseStation-mote, and the LEDs indicate that all messages are also received by B [otherwise only one message would be sent anyway]. But, when B sends a message, it seems to be received by A [as A responds with yet another packet], but is not displayed by the BaseStation-App. I tried to verify this by flashing a third mote with custom code, same issue. If I just call the SendProbe-method [see below] on mote B it works fine and switching motes doesn't help either. LEDs suggest that the SendDone-Event is triggered on both motes. Ultimately, it seems that the broadcasts are only received by the mote from which the last message was received (?). Is there any property of broadcasts that I am not aware of? Here is the (relevant) code I use: void SendProbe(){ probe = (ProbeMsg*)(call Packet.getPayload(pkt,NULL)); probe-source = 1; probe-counter = counter; call AMSend.send(AM_BROADCAST_ADDR,pkt, sizeof(ProbeMsg)); } event message_t * Receive.receive(message_t *msg, void *payload, uint8_t len){ if(len==sizeof(ProbeMsg)){ probe = (ProbeMsg*)payload; call Timer.startOneShot(DELAY_BETWEEN_PROBES); } return msg; } event void Timer.fired(){ SendProbe(); } Thanks for your help ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/t inyos-help Please consider the environment before printing a hard copy of this e-mail. The information contained in this e-mail is confidential. It is intended only for the stated addressee(s) and access to it by any other person is unauthorised. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this e-mail. Such unauthorised use may be unlawful. If you have received this e-mail in error, please inform us immediately on +44 (0)118 986 8601 and delete it and all copies from your system. Thales Research and Technology (UK) Limited. A company registered in England and Wales. Registered Office: 2 Dashwood Lang Road, The Bourne Business Park, Addlestone, Weybridge, Surrey KT15 2NX. Registered Number: 774298 Thales UK Limited. A company registered in England and Wales. Registered Office: 2 Dashwood Lang Road, The Bourne Business Park, Addlestone, Weybridge, Surrey KT15 2NX. Registered Number: 868273 ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help -- Wasif Masood ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Broadcast packet not received by all motes
According to the TinyOS wiki the CC2420 radio stack, which is used by the MICAz motes, performs a CCA by default, this should not be the problem. Furthermore, not a single one out of the ~300 packets was received by the third mote, but all were received by the second one. I don't think the problem is interference or something similiar. ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] RssiDemo Mica2 RSSI to dBm
HI all, I'm using RssiDemo to measure the rssi, and I'd like to convert the value of the RSSI to dBm. I've used this conversion in the java program: rssi= msg.get_rssi(); Vrssi = (3*rssi/1024); RSSI = -50*Vrssi-45.5 ; System.out.print( Power: + RSSI + dBm ); But the maximum value that appears is -48 dBm, even if the two Mica2 are together, and the transmision power is 5dBm. I've displayed the msg.get_rssi() as well and the values are between [20 -313]. I think that the range is [1-400]. Any idea to convert these values to dBm? Or, -45.5 is the maximum value to measure? Thanks for your time. David ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] using TinyOS-2.x java sdk in Matlab
hello, I was wondering whether anyone has managed to use the TinyOS-2.x java sdk within Matlab? My main motivation is to stream sensor data (magnetic,angular rate gravity) collected from wireless motes into matlab for real-time analysis (currently working with sample rates between 20Hz-50Hz). So far I have been following the TinyOS-1.x documentation, but have found some difficulty in getting things working. regardsChris ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Broadcast packet not received by all motes
Just an idea: maybe the third mote has some low-power radio implementation (low-power listening, LPL) enabled and the sending motes somehow do not take this into account (i.e., they do not send a long-enough preamble). Cheers, Urs On 10/29/10 3:28 PM, Simon Eberz wrote: According to the TinyOS wiki the CC2420 radio stack, which is used by the MICAz motes, performs a CCA by default, this should not be the problem. Furthermore, not a single one out of the ~300 packets was received by the third mote, but all were received by the second one. I don't think the problem is interference or something similiar. ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] CTP neighbor eviction procedure
On Thu, Oct 28, 2010 at 6:16 AM, wasif masood rwmas...@gmail.com wrote: I am wondering how CTP evicts a complelety dead neighbor? because the normal procedure is this: 1- if (curr_seq - pre_seq 10) remove the neighbor if(nieghbortable full) remove the most loss neighbor now what will happen, if there is still some space in NeighborTable and its not possible to receive any packet from a neighbor because this case does not hold for any above conditions You will keep the node around. Do you see any problem with this? - om_p ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] CCA ON/OFF
Hi deeksha,wasif I'm making use of CCA by adding this below mentioned . async event void RadioBackoff.requestCca(message_t *msg){ call RadioBackoff.setCca(FALSE); } async event void RadioBackoff.requestCongestionBackoff(message_t *msg){ call RadioBackoff.setCongestionBackoff(0); } async event void RadioBackoff.requestInitialBackoff(message_t *msg){ call RadioBackoff.setInitialBackoff(0); } Thanks and Regards, Nandeesh.B On Thu, Oct 28, 2010 at 2:23 AM, wasif masood rwmas...@gmail.com wrote: make it false and comment out the next line initiating the call back, then you it should remain always false. On Thu, Oct 28, 2010 at 7:36 AM, Deeksha Rao Sahib eced...@ece.iisc.ernet.in wrote: Hi All, In tos/chips/cc2420/csma/CC2420CsmaP.nc file there is in line 72: ccaOn= TRUE ; If I changed this to FALSE, does that means disable all the backofftimes and send the packet immediately without carrier sense? if not then how to disable all the backoff times? --Deeksha -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help -- Wasif Masood ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] CTP: CtpForwardingEngineP component error
On Sat, Oct 23, 2010 at 12:25 AM, Dongyu Yang yangdy.n...@gmail.com wrote: I have tested this: when one Node (A) happened this phenomenon, I reduce the dissemination rate to once ever 10 seconds, and stop the other Nodes, this phenomenon exist still, the Node (A) can only receive the dissemination command, but can never send out data! I think it is not cased by the channel capacity, but because in Send.send() the clientPtrs[client] be set NULL; command error_t Send.send[uint8_t client](message_t* msg, uint8_t len) { .. if (call SendQueue.enqueue(qe) == SUCCESS) { if (radioOn !call RetxmitTimer.isRunning()) { post sendTask(); } clientPtrs[client] = NULL; return SUCCESS; } .. } if it do not deal with the EBUSY and FAIL state in the else condition, it will remain NULL. So the next when call Send.send() it return EBUSY, because the clientPtrs[client] only be reseted in the void packetComplete() function which be called in the event void SubSend.sendDone() as below: command error_t Send.send[uint8_t client](message_t* msg, uint8_t len) { .. if (clientPtrs[client] == NULL) { dbg(Forwarder, %s: send failed as client is busy.\n, __FUNCTION__); return EBUSY; } .. } void packetComplete(fe_queue_entry_t* qe, message_t* msg, bool success) { if (qe-client CLIENT_COUNT) { clientPtrs[qe-client] = qe; } } because the command SubSend.send() return not SUCCESS, so the event SubSend.sendDone() will not signal, so the clientPtrs[client] remain NULL. The return value is either FAIL or EBUSY in that else block. If it is FAIL, we should wait until the condition that resulted in FAIL is repaired. If it is EBUSY, that means we should wait until sendDone. I think we are handing the EBUSY case properly. There is a possibility that we are not handing all the possible cases that can result in FAIL. I understand posting sendTask solved your problem but I want to understand why it works and if there is any FAIL condition that we do not handle properly before committing the fix. Do you know what return value you were getting when this bug is triggered? If it is FAIL, what caused that FAIL return value? - om_p ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help