Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible data corruption in log file #31

Open
thinrope opened this issue Feb 24, 2014 · 1 comment
Open

possible data corruption in log file #31

thinrope opened this issue Feb 24, 2014 · 1 comment

Comments

@thinrope
Copy link
Member

While investigating data from Nano with ID 2028 (https://api.safecast.org/en-US/bgeigie_imports/14580) a possible corruption was identified.
After a strangely formatted longitude, the counts jump, sometimes wildly. The longitude should have been formatted "%05ld.%04ld" per https://github.com/Safecast/bGeigieNanoKit/blob/master/bGeigieNano.ino#L754 but it has more digits, e.g. (see 4th line, 11608.429496726):

$BNRDD,2128,2014-02-21T04:38:09Z,80,10,11344,A,3213.3686,S,11608.1638,E,282.40,A,5308426,0*53
$BNRDD,2128,2014-02-21T04:38:14Z,77,6,11350,A,3213.3046,S,11608.1079,E,276.20,A,5308426,0*61
$BNRDD,2128,2014-02-21T04:38:19Z,81,10,11360,A,3213.2410,S,11608.0521,E,272.00,A,6029321,0*5B
$BNRDD,2128,2014-02-21T04:38:24Z,80,4,11364,A,3213.1803,S,11608.429496726,E,278.80,A,6029321,0*5B
$BNRDD,2128,2014-02-21T04:38:29Z,145,71,11435,A,3213.1247,S,11607.9427,E,281.30,A,6029321,0*68
$BNRDD,2128,2014-02-21T04:38:34Z,146,7,11442,A,3213.0695,S,11607.8827,E,282.00,A,6029321,0*51
$BNRDD,2128,2014-02-21T04:38:39Z,149,10,11452,A,3213.0105,S,11607.8262,E,288.30,A,5505034,0*67

It looks like lines 749 and 750 need explicit cast to long? Also unsigned long number constants should be suffixed with UL per http://arduino.cc/en/Reference/IntegerConstants

May be that is the culprit that has been hunting us?
It seems that "429496726" comes from the maximum unsigned int (2^32=4294967296") divided by 10 per https://github.com/Safecast/bGeigieNanoKit/blob/master/bGeigieNano.ino#L750 and a bit off.
It seems that the unit in question has used older firmware, 1.3.1 changed the code a bit, but still needs the above fix.

@robouden
Copy link
Contributor

Kalin,

I think you see a bug that Joe found before.
What version software was #2038 running at that time?

regards
rob

Regards,
Rob Oudendijk Yuka Hayashi
http://yr-design.biz http://oudendijk.biz http://about.me/robouden
tel +81 80-22605966 Skype: robouden Facebook:roboudenhttp://on.fb.me/QeKw2P
twitter:robouden http://bit.ly/RAiSTC

On Mon, Feb 24, 2014 at 4:38 PM, Kalin KOZHUHAROV
[email protected]:

While investigating data from Nano with ID 2028 (
https://api.safecast.org/en-US/bgeigie_imports/14580) a possible
corruption was identified.
After a strangely formatted longitude, the counts jump, sometimes wildly.
The longitude should have been formatted "%05ld.%04ld" per
https://github.com/Safecast/bGeigieNanoKit/blob/master/bGeigieNano.ino#L754but it has more digits, e.g. (see 4th line, 11608.429496726):

$BNRDD,2128,2014-02-21T04:38:09Z,80,10,11344,A,3213.3686,S,11608.1638,E,282.40,A,5308426,0_53
$BNRDD,2128,2014-02-21T04:38:14Z,77,6,11350,A,3213.3046,S,11608.1079,E,276.20,A,5308426,0_61
$BNRDD,2128,2014-02-21T04:38:19Z,81,10,11360,A,3213.2410,S,11608.0521,E,272.00,A,6029321,0_5B
$BNRDD,2128,2014-02-21T04:38:24Z,80,4,11364,A,3213.1803,S,11608.429496726,E,278.80,A,6029321,0_5B
$BNRDD,2128,2014-02-21T04:38:29Z,145,71,11435,A,3213.1247,S,11607.9427,E,281.30,A,6029321,0_68
$BNRDD,2128,2014-02-21T04:38:34Z,146,7,11442,A,3213.0695,S,11607.8827,E,282.00,A,6029321,0_51
$BNRDD,2128,2014-02-21T04:38:39Z,149,10,11452,A,3213.0105,S,11607.8262,E,288.30,A,5505034,0*67

It looks like lines 749 and 750 need explicit cast to long? Also unsigned
long number constants should be suffixed with UL per
http://arduino.cc/en/Reference/IntegerConstants

May be that is the culprit that has been hunting us?

Reply to this email directly or view it on GitHubhttps://github.com//issues/31
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants