Hello,
I did another speed test to complete my research. Maybe this can be useful even for other users.
I created a simple application that runs on the Electric Imp that let the me understand how fast the agent can communicate with the device. Of course it’s an average result but it’s enough to understand what I can do and to get an idea of what I can expect.
The application in the agent side uses an event to call endlessly a function in the device that increments a global counter. Then the device checks every seconds the value of the counter and shows it on the server console.
AGENT SIDE:
function Start_Counter()
{
local NullPar = 0;
for(;;) device.send( "Increment", NullPar );
}
Start_Counter();
DEVICE SIDE:
gCounter <- 0;
function Show_Counter()
{
server.log( "The counter is: " + gCounter );
imp.wakeup( 1, Show_Counter );
}
function Increment_Counter( DummyPar )
{
gCounter++;
}
agent.on( "Increment", Increment_Counter );
imp.wakeup( 1, Show_Counter );
The average result was of about 92 increments per second so a frequency around 1 Hz.
The green line is the linear trend that this algorithm should return, and the blue line is instead what the agent really does. I believe that this it’s normal for the nature of the agent.
Hopefully this is interesting and useful for you also.