<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I think the issue is the last empty ‘send’.<div class=""><br class=""></div><div class="">Really not sure why it is working for me, and not for you. Anyway, I’ve committed these changes to master, as well as a fix for that end case. Can you try now?</div><div class=""><div><br class=""></div><div>Regards, Mark.</div><div><br class=""><blockquote type="cite" class=""><div class="">On 30 Jan 2018, at 2:10 AM, Greg D. <<a href="mailto:gregd2350@gmail.com" class="">gregd2350@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
<div text="#000000" bgcolor="#FFFFFF" class="">
Hi Mark,<br class="">
<br class="">
Bingo! Well, mostly. Changes made fixed the corruption on both
Parameter and Feature list fetching, both of which now complete back
to the Android app. Changes pushed to my github fork.<br class="">
<br class="">
But there's still a disconnect. This one looks like a buffer size
limit being hit, given that the log ends mid-string. I tried
setting the log level to 'warn', and the disconnect still occurs, so
it's not due to the large text output. Or, is the disconnect
intended after these fetches, and the message truncation just a
consequence of our log buffering system? The server reconnects
automatically, after a short delay.<br class="">
<br class="">
Greg<br class="">
<br class="">
<br class="">
<div dir="ltr" class=""><tt class="">OVMS > </tt><tt class=""><br class="">
</tt><tt class="">V (112065) ovms-server-v2:
OvmsServerV2MongooseCallback(MG_EV_RECV)</tt><tt class=""><br class="">
</tt><tt class="">I (112065) ovms-server-v2: Incoming Msg: MP-0 C1</tt><tt class=""><br class="">
</tt><tt class="">I (112065) ovms-server-v2: Send MP-0 c1,0,0,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,1,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,2,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,3,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,4,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,5,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,6,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,7,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,8,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,9,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,10,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,11,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,12,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,13,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,14,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,15,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,16,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,17,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,18,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,19,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,20,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,21,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,22,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,23,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,24,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,25,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112075) ovms-server-v2: Send MP-0 c1,0,26,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112085) ovms-server-v2: Send MP-0 c1,0,27,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112095) ovms-server-v2: Send MP-0 c1,0,28,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112095) ovms-server-v2: Send MP-0 c1,0,29,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112095) ovms-server-v2: Send MP-0 c1,0,30,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112095) ovms-server-v2: Send MP-0 c1,0,31,32,0</tt><tt class=""><br class="">
</tt><tt class="">I (112095) ovms-server-v2: Send </tt><tt class=""><br class="">
</tt><tt class="">V (112365) ovms-server-v2:
OvmsServerV2MongooseCallback(MG_EV_CLOSE)</tt><tt class=""><br class="">
</tt><tt class="">E (112365) ovms-server-v2: Status: Error: Disconnected
from OVMS Server V2</tt><tt class=""><br class="">
</tt><tt class="">OVMS > </tt><br class="">
<br class="">
</div>
<br class="">
<br class="">
<div class="moz-cite-prefix">Mark Webb-Johnson wrote:<br class="">
</div>
<blockquote type="cite" cite="mid:94DE5396-750A-49B5-9CCB-214CE1E07C5F@webb-johnson.net" class="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
There is data corruption on the second line here:
<div class=""><br class="">
</div>
<div class="">
<blockquote type="cite" class="">
<div text="#000000" bgcolor="#FFFFFF" class="">
<div dir="ltr" class=""><tt class="">I (353350698)
ovms-server-v2: Send MP-0 c3,0,0,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350698) ovms-server-v2: Send (��?
c3,0,1,32,********</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send MP-0
c3,0,2,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send MP-0
c3,0,3,32,</tt><tt class=""><br class="">
</tt></div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">and on subsequent lines, more.</div>
<div class=""><br class="">
</div>
<div class="">When the server receives that, it will disconnect the
client.</div>
<div class=""><br class="">
</div>
<div class="">That diagnostic logging is output before encryption, so it
is something about the setup of std::ostringstream* buffer in
ovms_server_v2.cpp OvmsServerV2::ProcessCommand(). Look at
command case 3 (request parameter list).</div>
<div class=""><br class="">
</div>
<div class="">It seems that the std::ostringstream version of that code
is only used in OvmsServerV2::ProcessCommand (the others use
the string variant of it).</div>
<div class=""><br class="">
</div>
<div class="">Can you try changing those three occurrences to</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Transmit(buffer->str().c_str())</div>
<div class="">instead of</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Transmit(*buffer)</div>
<div class=""><br class="">
</div>
<div class="">Regards, Mark.</div>
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 29 Jan 2018, at 3:28 PM, Greg D. <<a href="mailto:gregd2350@gmail.com" class="" moz-do-not-send="true">gregd2350@gmail.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" class="">
<div text="#000000" bgcolor="#FFFFFF" class=""> Hi Mark,<br class="">
<br class="">
Memory was my first thought too, but there's no overt
indication of that. There's just an apparently
spontaneous close, except it always happens at exactly
the same place. This is with the module sitting on my
desk (not in the vehicle). It acts the same in the car,
but with real data. Tapping "Features" on the V2 client
is similar. This is with the module connected to the
local network via wifi. <br class="">
<br class="">
I tried taking out SSH Server and SD support from the
build config, to save RAM, but no change to the
results. No change with a fresh fetch of Master from
Github just now, either. Any idea what I can change
(menuconfig, module config, logging), to reveal more
info?<br class="">
<br class="">
Greg<br class="">
<br class="">
<br class="">
<div dir="ltr" class=""><tt class="">OVMS > log level
verbose</tt><tt class=""><br class="">
</tt><tt class="">Logging level for * set to verbose</tt><tt class=""><br class="">
<br class="">
(Tapped "Parameters" here)<br class="">
<br class="">
</tt><tt class="">V (353350698) ovms-server-v2:
OvmsServerV2MongooseCallback(MG_EV_RECV)</tt><tt class=""><br class="">
</tt><tt class="">I (353350698) ovms-server-v2:
Incoming Msg: MP-0 C3</tt><tt class=""><br class="">
</tt><tt class="">I (353350698) ovms-server-v2: Send
MP-0 c3,0,0,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350698) ovms-server-v2: Send
(��? c3,0,1,32,********</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
MP-0 c3,0,2,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
MP-0 c3,0,3,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,4,32,</tt><tt class=""><a href="http://tmc.openvehicles.com/" class="" moz-do-not-send="true">tmc.openvehicles.com</a></tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,5,32,hologram</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
MP-0 c3,0,6,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
MP-0 c3,0,7,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
4��? c3,0,8,32,ROADSTER_834</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
@��? c3,0,9,32,*************</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,10,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,11,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
`��? c3,0,12,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
`��? c3,0,13,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
`��? c3,0,14,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
`��? c3,0,15,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
`��? c3,0,16,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,17,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,18,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,19,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,20,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,21,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,22,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,23,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,24,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,25,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,26,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,27,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,28,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,29,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,30,32,</tt><tt class=""><br class="">
</tt><tt class="">I (353350708) ovms-server-v2: Send
���? c3,0,31,32,</tt><tt class=""><br class="">
</tt><tt class="">V (353350928) ovms-server-v2:
OvmsServerV2MongooseCallback(MG_EV_CLOSE)</tt><tt class=""><br class="">
</tt><tt class="">E (353350928) ovms-server-v2:
Status: Error: Disconnected from OVMS Server V2</tt><tt class=""><br class="">
</tt><tt class="">OVMS > </tt><tt class=""><br class="">
</tt><br class="">
<br class="">
</div>
<div class="moz-cite-prefix">Mark Webb-Johnson wrote:<br class="">
</div>
<blockquote type="cite" cite="mid:56712CC7-59AE-4AB6-8BA6-C062B97F09CF@webb-johnson.net" class="">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" class="">
Greg,
<div class=""><br class="">
</div>
<div class="">I think this is a different issue. I
used to have this all the time, but since switching
ovms_server_v2 to mongoose, I haven’t seen it. The
features and parameters calls send a relatively
large amount of data car->server. I think it is
related to free RAM.</div>
<div class=""><br class="">
</div>
<div class="">Regards, Mark.<br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 29 Jan 2018, at 2:55 AM, Greg D
<<a href="mailto:gregd2350@gmail.com" class="" moz-do-not-send="true">gregd2350@gmail.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Are the disconnects really the
result of network drops? I recently
"discovered" the Features and Parameters
tabs in the V2 app (I'm still new at this)
and notice that the server disconnects after
some number of records have been sent. The
server reconnects about 30 seconds later,
but neither tab ever completes. Seems like
there is an error along the way that kills
the connection. 100% repeatable.<br class="">
<br class="">
Greg<br class="">
<br class="">
<br class="">
<div class="gmail_quote">On January 28, 2018
10:13:40 AM PST, Stephen Casner <<a href="mailto:casner@acm.org" class="" moz-do-not-send="true">casner@acm.org</a>>
wrote:
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex;
border-left: 1px solid rgb(204, 204,
204); padding-left: 1ex;">
<pre class="k9mail">I handled wifi shutdowns cleanly when I first implemented telnet and
ssh as their own tasks. Now that they are under Mongoose, it is out
of my control. The socket is owned by the Mongoose code.
-- Steve
On Sun, 28 Jan 2018, Michael Balzer wrote:
<blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> I've begun working on the webserver and noticed something that may
be correlated to this: sockets don't get closed when losing the
connection. The effect is visible on both web and telnet server (ssh
not tested). To reproduce, switch the Wifi network with an open
connection, the port will not be available until timeout.
Regards,
Michael
</blockquote></pre>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
<br class="">
</div>
_______________________________________________<br class="">
OvmsDev mailing list<br class="">
<a href="mailto:OvmsDev@lists.teslaclub.hk" class="" moz-do-not-send="true">OvmsDev@lists.teslaclub.hk</a><br class="">
<a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br class="">
<fieldset class="mimeAttachmentHeader"></fieldset>
<br class="">
<pre wrap="" class="">_______________________________________________
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 class="">
</div>
_______________________________________________<br class="">OvmsDev mailing list<br class=""><a href="mailto:OvmsDev@lists.teslaclub.hk" class="">OvmsDev@lists.teslaclub.hk</a><br class="">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev<br class=""></div></blockquote></div><br class=""></div></body></html>