An example of the output from the xpl-rfxcom logfile (This is from one measurement only):
Code: Select all
2008-03-24_06:23:45.88672 Processed: 38ec12dc1092e012
2008-03-24_06:23:45.88676 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.1
2008-03-24_06:23:51.55019 Processed: 38ec12dc1092e012
2008-03-24_06:23:51.55023 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.1
2008-03-24_06:23:54.55840 Processed: 38ec12dc1092e012
2008-03-24_06:23:54.55843 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.1
2008-03-24_06:23:57.54961 Processed: 38ec12dc1092e012
2008-03-24_06:23:57.54968 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.1
2008-03-24_06:24:00.55784 Processed: 38ec12dc1092e012
2008-03-24_06:24:00.55788 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.1
2008-03-24_06:24:03.54903 Processed: 38ec12dc1092e012
2008-03-24_06:24:03.54907 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.1
2008-03-24_06:24:06.55728 Processed: 38ec12dc1092e012
2008-03-24_06:24:06.55731 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.1
2008-03-24_06:24:09.54851 Processed: 38ec12dc1092e012
2008-03-24_06:24:09.54855 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.1
2008-03-24_06:24:12.56535 Processed: 38ec12dc1092e012
2008-03-24_06:24:12.56538 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.1
2008-03-24_06:24:15.55750 Processed: 38ec12dc1092e012
2008-03-24_06:24:15.55753 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.1
2008-03-24_06:24:18.54879 Processed: 38ec12dc1092e012
2008-03-24_06:24:18.54882 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.1
As you can see the scale outputs the last measured weight about 11 times (I say 'about' because once in a while I have seen different amounts of readings, probably because transmitted packets get lost on the way).
If I stand on the scale within half a minute from a previous measurement, the scale will stop outputting the previous weight and start broadcasting this new measurement 11 times.
About storing measurements in a database:
- I intend to just compare the last measurement stored in the database with the current measurement. If the measurement is taken on the same day and the weight is the same, do not update anything. This should take care of duplicate values.
- When the date is the same (or different) and the weight is not the same as the last measurement, just insert a new record into the database.
I found out that the outputted weight by the scale can differ upto 400 grams when doing several consecutive measurements:
Code: Select all
2008-03-24_06:38:11.09849 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.7
2008-03-24_06:38:16.68214 Processed: 382c1cec7292201c
2008-03-24_06:38:16.68217 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.7
2008-03-24_06:38:23.73865 Processed: 389c18fc34929018
2008-03-24_06:38:23.73867 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.3
2008-03-24_06:38:30.24835 Processed: 389c18fc34929018
2008-03-24_06:38:30.24838 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.3
2008-03-24_06:38:33.24032 Processed: 389c18fc34929018
2008-03-24_06:38:33.24035 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.3
2008-03-24_06:38:36.24740 Processed: 389c18fc34929018
2008-03-24_06:38:36.24743 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.3
2008-03-24_06:38:39.23870 Processed: 389c18fc34929018
2008-03-24_06:38:39.23873 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.3
2008-03-24_06:38:47.28931 Processed: 380c19cc50920019
2008-03-24_06:38:47.28935 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.5
2008-03-24_06:38:53.41684 Processed: 380c19cc50920019
2008-03-24_06:38:53.41688 xpl-trig/sensor.basic: bnz-rfxcom.debian -> * - bwr102.01[weight]=92.5
So doing more measurements on one day (in the morning before going to work and in the evening when going to bed) should provide for a more accurate average weight.
Als het niet kapot is, niet repareren!