LowPowerLab Forum

Software support => Pi Gateway => Topic started by: razor on June 26, 2016, 05:46:24 PM

Title: Gateway Vs. PiGateway burst messages
Post by: razor on June 26, 2016, 05:46:24 PM
Hi

I'm trying to get a single Node with multiple sensors pushing updates to the PiGateway and I'm stuck with kind of sampling behavior from the PiGateway.

1 - Why is the pIGateway not able to handle all the packets like the Gateway sketch ?
When I have the basic Node sketch pushing speedy updates:
- all are received and shown in the console with the Gateway
- "random" are received and shown with the PiGateway

It looks like the PiGateway is sampling every second only the packets coming (the "random" behavior).

This is an issue with my Node as due to the large number of metrics to reports, I'm forced to send 3x packets.
The first packet arrive but not the two following. :-\
From the Gateway sketch, all the 3 are received.

When I look at the differences between the sketches, I see in the readSerialLine a default 1sec timeout and this is where the gap is.
Is it possible to tweak that to ensure the PiGateway is more open to receive burst packets ?

I'd like to know if someone found a way to push several consecutive packet or to send Struct to a PiGateway ?

thanks
Title: Re: Gateway Vs. PiGateway burst messages
Post by: razor on June 30, 2016, 04:52:28 PM
Solution found:

I changed in the PiGateway code:
inputLen = readSerialLine(input,10,64,50);

this overwrite the default 1000ms to 50ms delay on the VTY.
So far this is working well, I think this will not have any impact as long as the Pi is good in CPU and don't take too much time to talk on Serial.

So to send more data to the PiGateway I cascade the IF sendwithretry with a delay of 60ms after each packet.

As the rate of the node in burst is 1 packet every 60ms but the PiGateway Serial timeout is 50ms,
the PiGateway is ready on time for all the packets.
;)