<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Thanks, Mark, great work!<br>
<br>
Regards,<br>
Michael<br>
<br>
<br>
Am 08.03.2016 um 09:24 schrieb Mark Webb-Johnson:<br>
</div>
<blockquote
cite="mid:E55B5900-290F-4F15-80CD-86A8EFC41585@openvehicles.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="">An update on SIM808. It is just a stop-gap solution,
but it buys us some time.</div>
<div class=""><br class="">
</div>
<div class="">The changes I’ve made / problems I’ve had:</div>
<div class=""><br class="">
</div>
<div class="">
<ol class="MailOutline">
<li class="">Power button needs to be held for 1 second to
power down/up the modem (SIM908 was much faster). Not a bad
issue, but it did waste a week going back and forth trying
to find the cause.</li>
<li class="">The SIM808 doesn’t echo LineFeed characters. That
is a pain for DIAG mode console, but doesn’t affect anything
else. Only workaround possible is to use a terminal program
that can map CR->CRLF, or CF->LF (and live with the
horrible display in DIAG mode). We’ll just develop on SIM908
modules or use a fancy terminal emulator. I guess if people
are using scripts to talk to DIAG mode, they may need some
tuning if they are expecting CRLF and just getting CR now.</li>
<li class="">GPS initialisation (this is the biggy - more
below).</li>
<li class="">Build profile in version string. This is just a
simple fix to include a #define in the build profiles, and
to include that where we show the version string. It means
that as well as the version of firmware, we can now see the
build profile. Helpful for support of new users.</li>
</ol>
</div>
<div class=""><br class="">
</div>
<div class="">The biggest issue has been with GPS initialisation.</div>
<div class=""><br class="">
</div>
<div class="">Looking at the current code:</div>
<div class=""><br class="">
</div>
<blockquote style="margin: 0 0 0 40px; border: none; padding:
0px;" class="">
<div class="">
<div class=""><font class="" face="Andale Mono">#ifdef
OVMS_INTERNALGPS</font></div>
<div class=""><font class="" face="Andale Mono">// Using
internal SIM908 GPS:</font></div>
<div class=""><font class="" face="Andale Mono">rom char
NET_INIT1[] = "AT+CGPSPWR=1;+CGPSRST=0;+CSMINS?\r";</font></div>
<div class=""><font class="" face="Andale Mono">rom char
NET_REQGPS[] = "AT+CGPSINF=2;+CGPSINF=64;+CGPSPWR=1\r";</font></div>
<div class=""><font class="" face="Andale Mono">#else</font></div>
<div class=""><font class="" face="Andale Mono">// Using
external GPS from car:</font></div>
<div class=""><font class="" face="Andale Mono">rom char
NET_INIT1[] = "AT+CSMINS?\r";</font></div>
<div class=""><font class="" face="Andale Mono">#endif</font></div>
</div>
</blockquote>
<div class=""><br class="">
So, if the build profile includes OVMS_INTERNALGPS (ie; one or
more vehicles in the profile require GPS), then we use a big
sequence of initialisations
"AT+CGPSPWR=1;+CGPSRST=0;+CSMINS?\r”. We have two issues with
this:</div>
<div class=""><br class="">
</div>
<div class="">
<ol class="MailOutline">
<li class="">We’re powering up the GPS, even if the actual
vehicle we selected doesn’t need SIM908/808 GPS. That costs
watts - and with my new fancy bench power supply I got for
OVMS v3 development (ok, cheap chinese ebay) I can now see
exactly how much ;-).</li>
<li class="">The SIM808 randomly doesn’t like AT+CGPSPWR=1 and
in particular seems to hate it 100% of the time it is
included with other options. You get an ERROR response back
from the modem, and as this is done in NET_STATE_DOINIT, it
looks like a SIM card error (but is nothing to do with SIM
card). We just never saw AT+CGPSPWR=1 fail on SIM908.</li>
</ol>
</div>
<div class=""><br class="">
</div>
<div class="">Now, as well as the #defined OVMS_INTERNALGPS to
enable the SIM908/808 GPS, we’ve also got NET_FN_INTERNALGPS in
net_fnbits which is set during vehicle module initialisation.
The first brings in the code, the second should turn it on.
Except it doesn’t. The first one turns it on.</div>
<div class=""><br class="">
</div>
<div class="">Accordingly, I’m having to change the net.{h,c}
layer to split off GPS initialisation into its own states and
use a simple AT+CGPSPWR=1 for vehicles that require SIM908/808
GPS and AT+CGPSPWR=0 for vehicles that don’t. I’ve taken the
opportunity to switch from using OVMS_INTERNALGPS to using
NET_FN_INTERNALGPS in net_fnbits as the decision as to whether
to power up the SIM908/808 GPS or not.</div>
<div class=""><br class="">
</div>
<div class="">Building and testing that has taken me the most
time. It is almost done, and I should be able to commit the code
soon.</div>
<div class=""><br class="">
</div>
<div class="">Production firmware then goes to the manufacturer in
China, and we give the go-ahead for the production run. We
should have the modules back in stock towards the end of March /
first thing in April.</div>
<div class=""><br class="">
</div>
<div class="">Regards, Mark.</div>
<div class=""><br class="">
</div>
<div class="">P.S. I can actually recommend that cheap(ish)
chinese ebay power supply. It’s available from various eBay
sellers, or <a moz-do-not-send="true"
href="http://www.banggood.com/CPS-3205C-0-32V-0-5A-Portable-Adjustable-DC-Power-Supply-180-264V-p-974495.html"
class="">banggood</a>. Controls are precise, output is rock
solid, ammeter is as accurate as my multi-meter, and it is built
like a tank.</div>
<div class=""><br class="">
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a>
<a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="50">--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
</body>
</html>