[Ovmsdev] v3 hardware disconnecting from v2 server

Mark Webb-Johnson mark at webb-johnson.net
Mon Jan 29 16:01:49 HKT 2018


There is data corruption on the second line here:

> I (353350698) ovms-server-v2: Send MP-0 c3,0,0,32,
> I (353350698) ovms-server-v2: Send (��? c3,0,1,32,********
> I (353350708) ovms-server-v2: Send MP-0 c3,0,2,32,
> I (353350708) ovms-server-v2: Send MP-0 c3,0,3,32,

and on subsequent lines, more.

When the server receives that, it will disconnect the client.

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).

It seems that the std::ostringstream version of that code is only used in OvmsServerV2::ProcessCommand (the others use the string variant of it).

Can you try changing those three occurrences to
	Transmit(buffer->str().c_str())
instead of
	Transmit(*buffer)

Regards, Mark.

> On 29 Jan 2018, at 3:28 PM, Greg D. <gregd2350 at gmail.com> wrote:
> 
> Hi Mark,
> 
> 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.  
> 
> 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?
> 
> Greg
> 
> 
> OVMS > log level verbose
> Logging level for * set to verbose
> 
>   (Tapped "Parameters" here)
> 
> V (353350698) ovms-server-v2: OvmsServerV2MongooseCallback(MG_EV_RECV)
> I (353350698) ovms-server-v2: Incoming Msg: MP-0 C3
> I (353350698) ovms-server-v2: Send MP-0 c3,0,0,32,
> I (353350698) ovms-server-v2: Send (��? c3,0,1,32,********
> I (353350708) ovms-server-v2: Send MP-0 c3,0,2,32,
> I (353350708) ovms-server-v2: Send MP-0 c3,0,3,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,4,32,tmc.openvehicles.com <http://tmc.openvehicles.com/>
> I (353350708) ovms-server-v2: Send ���? c3,0,5,32,hologram
> I (353350708) ovms-server-v2: Send MP-0 c3,0,6,32,
> I (353350708) ovms-server-v2: Send MP-0 c3,0,7,32,
> I (353350708) ovms-server-v2: Send 4��? c3,0,8,32,ROADSTER_834
> I (353350708) ovms-server-v2: Send @��? c3,0,9,32,*************
> I (353350708) ovms-server-v2: Send ���? c3,0,10,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,11,32,
> I (353350708) ovms-server-v2: Send `��? c3,0,12,32,
> I (353350708) ovms-server-v2: Send `��? c3,0,13,32,
> I (353350708) ovms-server-v2: Send `��? c3,0,14,32,
> I (353350708) ovms-server-v2: Send `��? c3,0,15,32,
> I (353350708) ovms-server-v2: Send `��? c3,0,16,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,17,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,18,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,19,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,20,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,21,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,22,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,23,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,24,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,25,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,26,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,27,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,28,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,29,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,30,32,
> I (353350708) ovms-server-v2: Send ���? c3,0,31,32,
> V (353350928) ovms-server-v2: OvmsServerV2MongooseCallback(MG_EV_CLOSE)
> E (353350928) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
> OVMS > 
> 
> 
> Mark Webb-Johnson wrote:
>> Greg,
>> 
>> 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.
>> 
>> Regards, Mark.
>> 
>>> On 29 Jan 2018, at 2:55 AM, Greg D <gregd2350 at gmail.com <mailto:gregd2350 at gmail.com>> wrote:
>>> 
>>> 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.
>>> 
>>> Greg
>>> 
>>> 
>>> On January 28, 2018 10:13:40 AM PST, Stephen Casner <casner at acm.org <mailto:casner at acm.org>> wrote:
>>> 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:
>>> 
>>>  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
> 
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20180129/d9ad288c/attachment.htm>


More information about the OvmsDev mailing list