Go Down

Topic: Very different performance of Bridge.put/get calls (Read 647 times) previous topic - next topic

hrd

Hello,

I have a Due and a Dragino Yun shield and looking at Bridge.put/get performance which is totally different from time to time (see output of Serial Monitor as attachment) using following code:

Code: [Select]

#include <Bridge.h>

void setup() {
  // put your setup code here, to run once:
  SerialUSB.begin(9600);
  while(!SerialUSB);
  SerialUSB.print("Starting Bridge...");
  Bridge.begin();
  SerialUSB.println("done!");

}

void loop() {
  // put your main code here, to run repeatedly:
 
  char cVAL[1];
  long int iStartMillis = millis();
  Bridge.put("KEY","1");
  long int iDeltaMillis = millis() - iStartMillis;
  SerialUSB.println("iDeltaMillis(put):" + String(iDeltaMillis));
 
  iStartMillis = millis();
  Bridge.get("KEY",cVAL,1);
  iDeltaMillis = millis() - iStartMillis;
  SerialUSB.println("iDeltaMillis(get):" + String(iDeltaMillis));
 
  delay(1000);

}



What I'm doing wrong or what is wrong?

Thx!

items_ch

Quote
What I'm doing wrong or what is wrong?
Unfortunately nothing!

The problem is the retry timeout of lost messages.

Look at line 175 of Bridge.cpp:
Quote
for ( ; retries < max_retries; retries++, delay(100), dropAll() /* Delay for retransmission */) {

Go Up