<div dir="ltr">Resolv the problem. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Mark Webb-Johnson <<a href="mailto:mark@webb-johnson.net">mark@webb-johnson.net</a>> ezt írta (időpont: 2019. nov. 7., Cs, 7:41):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><br></div>Tamás, I’ve committed this fix to our simcom driver (relatively easy as we only support SIM5360 currently). It is on <a href="http://api.openvehicles.com" target="_blank">api.openvehicles.com</a> OTA as:<div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>3.2.005-102-g1a4364f</div></blockquote><div><br></div><div>Please try and let us know if it resolves this for you.</div><div><br></div><div>Regards, Mark.</div><div><br></div><div>P.S. Thanks for noticing and raising this so quickly.<br><div><br><blockquote type="cite"><div>On 7 Nov 2019, at 2:27 PM, Mark Webb-Johnson <<a href="mailto:mark@webb-johnson.net" target="_blank">mark@webb-johnson.net</a>> wrote:</div><br><div><div style="word-wrap:break-word;line-break:after-white-space">Like this (experiment):<div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">$ ./<a href="http://t.pl" target="_blank">t.pl</a></span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">UTC original = Wed Mar 22 20:28:27 2000</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">UTC adjusted = Wed Nov  6 20:28:27 2019</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"><br></span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">$ cat <a href="http://t.pl" target="_blank">t.pl</a></span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">#!/usr/bin/perl</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"><br></span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">use POSIX qw(strftime);</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">use Time::Local;</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"><br></span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">my @original = (27,28,20,22,3-1,2000-1900,0);</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"><br></span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">print "UTC original = ", strftime("%a %b %e %H:%M:%S %Y",@original),"\n";</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">my $jdt = timegm(@original);</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">my $ajdt = $jdt + (1024 * 7 * 86400);</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"><br></span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($ajdt);</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">print "UTC adjusted = ", strftime("%a %b %e %H:%M:%S %Y",($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)),"\n";</span></font></div></div></blockquote><div><div><br></div><div>@Tamás: Does the above adjustment show the correct date/time (Wed Nov  6 20:28:27 2019 UTC)?</div><div><br></div><div>Regards, Mark.</div><div><br><blockquote type="cite"><div>On 7 Nov 2019, at 2:13 PM, Mark Webb-Johnson <<a href="mailto:mark@webb-johnson.net" target="_blank">mark@webb-johnson.net</a>> wrote:</div><br><div><div style="word-wrap:break-word;line-break:after-white-space"><div><br></div>The issue is that we don’t have week numbers from the GPS (and presumably week to date is non-trivial).<div><br></div><div>We get the date/time from the NMEA RMC message, then pass it into this to convert to a julian date/time:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">/**</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"> * utc_to_timestamp:</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"> *  convert GPS date & time (UTC) to timestamp</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"> *   date: "ddmmyy"</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"> *   time: "hhmmss"</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"> */</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">static unsigned long utc_to_timestamp(const char* date, const char* time)</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">  {</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">  int day, month, year, hour, minute, second;</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"><br></span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">  day = (date[0]-'0')*10 + (date[1]-'0');</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">  month = (date[2]-'0')*10 + (date[3]-'0');</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">  year = (date[4]-'0')*10 + (date[5]-'0');</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"><br></span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">  hour = (time[0]-'0')*10 + (time[1]-'0');</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">  minute = (time[2]-'0')*10 + (time[3]-'0');</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">  second = (time[4]-'0')*10 + (time[5]-'0');</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px"><br></span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">  return</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">    (JdFromYMD(2000+year, month, day) - JDEpoch) * (24L * 3600)</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">      + ((hour * 60L + minute) * 60) + second;</span></font></div><div><font face="Andale Mono"><span style="font-style:normal;font-size:14px">  }</span></font></div></div></blockquote><div><div><br></div><div>Perhaps sufficient to add 1024 * 7 * 86400 to that?</div><div><br></div><div>Regards, Mark.</div><div><br><blockquote type="cite"><div>On 7 Nov 2019, at 1:44 PM, Stephen Casner <<a href="mailto:casner@acm.org" target="_blank">casner@acm.org</a>> wrote:</div><br><div><div>Mark,<br><br>You don't need the condition "date <2019-11-03", just always add 1024<br>weeks to the current time value coming from the modem.<br><br>                                                        -- Steve<br><br>On Thu, 7 Nov 2019, Mark Webb-Johnson wrote:<br><br><blockquote type="cite">Damn:<br><br><a href="https://www.cika.com/soporte/Information/GSMmodules/GPS-week-rollover_Simcom.pdf" target="_blank">https://www.cika.com/soporte/Information/GSMmodules/GPS-week-rollover_Simcom.pdf</a> <<a href="https://www.cika.com/soporte/Information/GSMmodules/GPS-week-rollover_Simcom.pdf" target="_blank">https://www.cika.com/soporte/Information/GSMmodules/GPS-week-rollover_Simcom.pdf</a>><br><br>I think we can do a fix in the SIMCOM module that if the date <2019-11-03 then offset it somehow? Any ideas?<br><br>Regards, Mark.<br><br><blockquote type="cite">On 7 Nov 2019, at 1:09 PM, Stephen Casner <<a href="mailto:casner@acm.org" target="_blank">casner@acm.org</a>> wrote:<br><br>This page mentions the problem:<br><br><a href="https://techship.com/news/gps-week-roll-over-issue-during-epoch-restart/" target="_blank">https://techship.com/news/gps-week-roll-over-issue-during-epoch-restart/</a><br><br>Quoting there:<br><br>   For the Qualcomm MDM9x15 series (4G/LTE Cat 3) and MDM6200<br>   (3G/HSPA+) series chipsets there is a offset used, so the GPS week<br>   roll over will occur 1054+1023 weeks since launch of the GPS, and<br>   more precisely in beginning of November 2019 (UTC 23:59:42<br>   November 2, 2019)<br><br>   [snip]<br><br>   3G/HSPA+ modules based on Qualcomm MDM6200 series chipsets:<br>   Huawei EM820W / MU609 series<br>   Telit DE910 series<br>   Simcom SIM5320 series<br><br>This sounds like the hardware/firmware won't be fixed.  Perhaps the<br>solution for OVMS is just to put an offset as a workaroud.  That will<br>work for the next 1024 weeks.<br><br>                                                       -- Steve<br><br>On Wed, 6 Nov 2019, Stephen Casner wrote:<br><br><blockquote type="cite">Sorry, I did not read carefully.  The item you mentioned is just an<br>antenna.  The GPS implementation is in the modem module, correct?<br>That's where the correction is needed.<br><br>                                                       -- Steve<br><br>On Thu, 7 Nov 2019, Tamás Kovács wrote:<br><br><blockquote type="cite">I use a universal gps connected to ovms, not the car own gps. (<br><a href="https://www.fasttech.com/products/1020200" target="_blank">https://www.fasttech.com/products/1020200</a>)<br><br>Stephen Casner <<a href="mailto:casner@acm.org" target="_blank">casner@acm.org</a>> ezt írta (időpont: 2019. nov. 7., Cs, 0:42):<br><br><blockquote type="cite">Tamás,<br><br>This looks like the GPS sensor did not handle the rollover of the<br>10-bit week-number field in April, 2019.  So the timestamps are off by<br>1024 * 7 * 24 * 60 * 60 seconds.  Here is the US government alert about<br>this problem:<br><br><br><a href="https://www.us-cert.gov/sites/default/files/documents/Memorandum_on_GPS_2019.pdf" target="_blank">https://www.us-cert.gov/sites/default/files/documents/Memorandum_on_GPS_2019.pdf</a><br><br>This problem was recently discovered for the Garmin GPS 18x LVC<br>sensors in the Tesla Roadster 2.5 (but not in the earlier 1.5 version<br>like I have, which has the older GPS 18 LVC sensor):<br><br><br><a href="https://teslamotorsclub.com/tmc/threads/caution-annual-service-car-power-down-gps-issue.163328/" target="_blank">https://teslamotorsclub.com/tmc/threads/caution-annual-service-car-power-down-gps-issue.163328/</a><br><br>There is a firmware update to fix this for the GPS 18x LVC.  Perhaps<br>there is one for the GPS sensor in the Mitsubishi as well.<br><br>                                                       -- Steve<br><br>On Wed, 6 Nov 2019, Tamás Kovács wrote:<br><br><blockquote type="cite">I have a problem with utc time, the time is correct but the date is not<br>valid. I use 3.2.005-99-g88cfeef9 version with modification of Mitsubishi<br>i-MiEV.<br><br>OVMS# me li utc<br>m.time.utc                               953756768Sec<br>I (900675) housekeeping: 2000-03-22 21:27:06 CET (RAM: 8b=82812-86452<br></blockquote>32b=27308)<br><blockquote type="cite">I (981115) webserver: HTTP POST /api/execute<br>I (981115) webcommand: HttpCommandStream[0x3fa32958]: 1984428 bytes<br>free, executing: time<br>OVMS# time<br>Time Zone:  CET-1CEST,M3.5.0,M10.5.0/3<br>UTC Time:   2000-03-22 20:28:27 UTC<br>Local Time: 2000-03-22 21:28:27 CET<br>Provider:   gsm-nmea<br><br>PROVIDER             STRATUM  UPDATE TIME<br>*gsm-nmea                  2       0 Wed Mar 22 20:28:27 2000<br><br><br>--<br>Üdvözlettel:<br>Kovács Tamás_______________________________________________<br></blockquote>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.openvehicles.com" target="_blank">OvmsDev@lists.openvehicles.com</a><br><a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br><br></blockquote><br><br>--<br>Üdvözlettel:<br>Kovács Tamás<br></blockquote></blockquote>_______________________________________________<br>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.openvehicles.com" target="_blank">OvmsDev@lists.openvehicles.com</a><br><a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br></blockquote><br></blockquote>_______________________________________________<br>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.openvehicles.com" target="_blank">OvmsDev@lists.openvehicles.com</a><br><a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br></div></div></blockquote></div><br></div></div></div></blockquote></div><br></div></div>_______________________________________________<br>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.openvehicles.com" target="_blank">OvmsDev@lists.openvehicles.com</a><br><a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br></div></blockquote></div><br></div></div>_______________________________________________<br>
OvmsDev mailing list<br>
<a href="mailto:OvmsDev@lists.openvehicles.com" target="_blank">OvmsDev@lists.openvehicles.com</a><br>
<a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" rel="noreferrer" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Üdvözlettel:<br>Kovács Tamás<br><br></div>