Readings handling

The S2GW asks the radio nodes for readings according to their log periods. It does it for all the sensors which were successfully initialised. It does not poll the nodes which failed the initialisation.

S2GW stores the readings obtained from the nodes into the S2Gateway_readings.xml file located in /home/pi/S2Gateway/S2Gateway directory on the SD card.

Once it is time to send the data to B3, the records are read from the file, transmitted to B3 and then deleted from the file if their reception is confirmed by B3. Every reading has a counter numer to prevent deletion of the data which were not sent to B3.

If S2GW has connection to B3, the size of the file is 1 to 2KB as its records are constantly transmitted to B3.

If there is no contact with B3, S2GW stores up to 2000 readings in a single file and once this limit is reached, a new file is created named S2Gateway_readings_nnnn.xml where nnnn = 0001, 0002 etc.

After the contact with B3 is restored, S2GW sends all the stored readings to B3. The latest readings are sent first.

Last updated