Author Topic: Anyone can help me !!!!  (Read 2634 times)

Noble

  • RFduino Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Anyone can help me !!!!
« on: September 18, 2014, 06:39:41 AM »
Hi,

Thank you for trying helping me.

My question is how to measure or calculate latency and throughput of Bluetooth by using two RFduino?

Thanks


Regards
Noble

edorphy

  • RFduino Full Member
  • ***
  • Posts: 86
  • Karma: +0/-0
    • View Profile
Re: Anyone can help me !!!!
« Reply #1 on: September 21, 2014, 09:24:56 PM »
Explain your setup a little more, are you connecting these two rfduinos via Gzll or connecting a single iPhone to two rfduinos?

Noble

  • RFduino Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Anyone can help me !!!!
« Reply #2 on: September 22, 2014, 01:58:58 AM »
Thank you Edorphy for reply,

I will try using Gzll at the first.

I am trying to using 2 RFduino talk together via Gzll. what I want is:

1. sending a packet of data from RF1 to RF2, then RF2 response to the RF1.
2. RF1 is connected with the oscilloscope (I need to set a output pin for the data recording).
3. The out pin in the RF1 will show the time of sending packet and time of receiving packet. So it will help me to measure the latency.
4. my second test will be measuring throughput (same schematic).

I hope if it is clear to know what I am going to do.

Thank you for your help

Regards
Noble

edorphy

  • RFduino Full Member
  • ***
  • Posts: 86
  • Karma: +0/-0
    • View Profile
Re: Anyone can help me !!!!
« Reply #3 on: September 22, 2014, 08:05:19 PM »
You could make use of micros() and millis() which are arduino built in methods for getting timestamps.

RF1
Send - take time stamp
OnReceive - take second timestamp

RF2
OnReceive - Send

Latency will be tough to measure. I'm not familiar enough with GZLL to tell you if you could do this.

With BLE, there is a "connection interval" which would give you some sort of indication of the latency.

Code: [Select]

unsigned long t_0, t_1, d_t;

//Send
t_0 = micros();
...

//OnReceive
t_1 = micros();

d_t = t_1 - t_0;



Repeat this say 1000 times and average up the d_t, divide by 1 million (micros in second), then you should be able to calculate throughput then. Bits or bytes per second.

Noble

  • RFduino Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Anyone can help me !!!!
« Reply #4 on: September 23, 2014, 06:41:45 AM »
Thank you edorphy I understand how to measure latency the latency and throughput.

may I ask you a question about how can the 2RF will discover each other (how they will connect).

I tried to communicate between them many times and I was not got any results.

The only way I can see is with Gzll, but it is not easy as well between 2RF. What is your suggestion for that?

Thanks


Regards
Noble

GunnarRacing

  • RFduino Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: Anyone can help me !!!!
« Reply #5 on: September 24, 2014, 07:31:32 PM »
Quote
The only way I can see is with Gzll, but it is not easy as well between 2RF. What is your suggestion for that?

That question came up before and the "answer", at least in the interim is GZLL.

...\Arduino\hardware\arduino\RFduino\libraries\RFduinoGZLL\examples

I have tested some modules with the RSSI example. You can set it up to use just one slave/device.

Rick.

Noble

  • RFduino Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Anyone can help me !!!!
« Reply #6 on: October 01, 2014, 03:41:43 AM »
Thank you,

I will try it and let you know guys about the result,

regards

Noble

Noble

  • RFduino Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Anyone can help me !!!!
« Reply #7 on: October 10, 2014, 06:26:13 AM »
Hi All,

I start writing the code for the RF1 is:
Code: [Select]
// RFduino one

 #include <RFduinoBLE.h>

 
  unsigned long t1, t2, t3;
 
  byte A=1;                       
  // pin for Button B on the RGB Shield
 
  int button_b=3;               
  // debounce time (in ms)
 
 // ----------------------------------------------------------------------
 void setup() {
   
   pinMode(button_b, INPUT);
   
   Serial.begin(9600);
   
   RFduinoBLE.begin();
 {

   RFduinoBLE.sendByte(A);
   
   t1= micros();

 }
}
 


 //--------------------------------------------------------------------------
 void loop() {

  Serial.print("t3: ");
  t3=t2-t1;
  //prints time since program started
  void RFduinoBLE_onReceive();
 
  Serial.println(t3);
 }

and for the RF2 is:

Code: [Select]
// RFduino two

 #include <RFduinoBLE.h>

 
  unsigned long t1, t2, t3;
 
  byte A=1;                       
  // pin for Button B on the RGB Shield
 
  int button_b=3;               
  // debounce time (in ms)
 
 // ----------------------------------------------------------------------
 void setup() {
   
  // pinMode(button_b, INPUT);
   
   Serial.begin(9600);
   
   RFduinoBLE.begin();
 {

   RFduinoBLE.sendByte(A);
   
   t2= micros();

 }
}
 


 //--------------------------------------------------------------------------
 void loop() {

  //Serial.print("t3: ");
  //t3=t2-t1;
  //prints time since program started
  void RFduinoBLE_onReceive();
 
  //Serial.println(t3);
 }


My problem is:
1. how can I repeat sending 1000 times and stop counting after that?
2. how can I check the time interval t3 (sending - reciving) in second?
Could you please try to check in general as well.

Thanks

 

anything