Hi Edward,

welcome :)

I do notice some offset from road maps once in a while. So go ahead optimizing gps2latlon(), maybe that's the offset source.

The atof() function should be fixed regardless of the GPS conversion, I'll take care of that.

Regards,
Michael


Am 23.01.2017 um 08:12 schrieb Edward Cheeseman:
Hello,

I am new to OVMS. I have a Gen2 Leaf on Dexters server. Tom has helped me set it up.

I found my GPS data was off up to two degrees. I’ve traced it to myatof() in utils.c.
It adds the fractional part with both positive and negative numbers, where it should subtract for negative numbers.

myatof() is used in SIM808 lat and long conversions, and somewhere in Twizy which I didn’t look into.
I suppose there isn’t that many SIM808 based OVMSs in the Southern or Western hemispheres?

It is easy to fix, but maybe going through float in the first place isn’t necessary?
Looks like there is 31bits of information coming out of the GPS where float will drop this to 23bits.
I’ve started rewriting gps2latlon() to use a long long (64bit) integer multiply and divide.
I see reference to SIM808 and 908 on an arduino shield, so I might have a look to see what they have done.


Edward



_______________________________________________
OvmsDev mailing list
OvmsDev@lists.teslaclub.hk
http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26