<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><font face="Courier New" class="">Hello,</font></div><div class=""><font face="Courier New" class=""><br class=""></font></div><div class=""><font face="Courier New" class="">I am new to OVMS. I have a Gen2 Leaf on Dexters server. Tom has helped me set it up.</font></div><div class=""><font face="Courier New" class=""><br class=""></font></div><div class=""><font face="Courier New" class="">I found my GPS data was off up to two degrees. I’ve traced it to myatof() in utils.c.</font></div><div class=""><font face="Courier New" class="">It adds the fractional part with both positive and negative numbers, where it should subtract for negative numbers.</font></div><div class=""><font face="Courier New" class=""><br class=""></font></div><div class=""><font face="Courier New" class="">myatof() is used in SIM808 lat and long conversions, and somewhere in Twizy which I didn’t look into.</font></div><div class=""><font face="Courier New" class="">I suppose there isn’t that many SIM808 based OVMSs in the Southern or Western hemispheres?</font></div><div class=""><font face="Courier New" class=""><br class=""></font></div><div class=""><font face="Courier New" class="">It is easy to fix, but maybe going through float in the first place isn’t necessary?</font></div><div class=""><font face="Courier New" class="">Looks like there is 31bits of information coming out of the GPS where float will drop this to 23bits.</font></div><div class=""><font face="Courier New" class="">I’ve started rewriting gps2latlon() to use a long long (64bit) integer multiply and divide.</font></div><div class=""><font face="Courier New" class="">I see reference to SIM808 and 908 on an arduino shield, so I might have a look to see what they have done.</font></div><div class=""><font face="Courier New" class=""><br class=""></font></div><div class=""><font face="Courier New" class=""><br class=""></font></div><div class="">
<font face="Courier New" class=""><span class="Apple-style-span" style="border-collapse: separate; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: normal; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Edward</div></div></span></div></span>
</font></div>
<br class=""></body></html>