[Ovmsdev] Strange app behavior
mark at webb-johnson.net
Thu Jun 11 09:37:03 HKT 2020
Very bizarre. The issue was hard to track down. Seems to be strange behaviour in SSL connections with faults, where the SSL error comes in, the connection is torn down, but then a welcome message arrives for the login (after the disconnection). If the welcome login succeeds, then the vehicle App connection is associated with the FD# and causes the issue later on.
So, the server code sees a login message after the connection was disconnected 😱
2020-06-10 20:36:20.271547 +0800 info OVMS::Server::ApiV2: #253 - - new TLS connection from <redacted>
2020-06-10 20:36:20.273606 +0800 info OVMS::Server::Core: #253 - - ConnStart
2020-06-10 20:36:28.781028 +0800 error OVMS::Server::ApiV2: #253 C <redacted-car> got error: ssl3_read_bytes: ssl handshake failure
2020-06-10 20:36:28.782356 +0800 info OVMS::Server::Core: #253 C <redacted-car> CarDisconnect
2020-06-10 20:36:28.782821 +0800 info OVMS::Server::Core: #253 - - ConnFinish
Use of uninitialized value in concatenation (.) or string at plugins/system/OVMS/Server/ApiV2.pm line 631.
2020-06-10 20:36:28.783094 +0800 info OVMS::Server::ApiV2: #253 C <redacted-car> got proto #/C login
Use of uninitialized value $clienttype in concatenation (.) or string at plugins/system/OVMS/Server/Core.pm line 237.
2020-06-10 20:36:28.784261 +0800 info OVMS::Server::Core: #253 <redacted-car> CarConnect
At that stage, the fd #253 is tagged with an App connection, and never cleared (because the CarDisconnect was before the CarConnect).
Later on, that fd# can get data from the original app/car with connection issues. The source of bad data seems to be almost always the DEMO car.
Workaround is to add connection checks to the io_line and io_welcome routines, to simply return (discard) if the connection is not marked as up.
Will load this live on api.openvehicles.com now, and monitor for a few days. We now have logging for these mismatched connections (and code to avoid sending out the data in that case), so it should be easy to see if this solves the problem.
> On 9 Jun 2020, at 1:48 PM, Mark Webb-Johnson <mark at webb-johnson.net> wrote:
> I wasn’t aware of this issue, but will look into it. I can’t immediately see the cause, but it should be relatively easy to add a clean-up of the channel structures when the connection starts.
> I haven’t restarted the api.openvehicles.com <http://api.openvehicles.com/> server recently.
> Regards, Mark.
>> On 9 Jun 2020, at 1:39 PM, Stephen Casner <casner at acm.org <mailto:casner at acm.org>> wrote:
>> That sounds plausible. Since the problem ceased, I wonder if that
>> implies that the server was restarted. I'm using Mark's server.
>> -- Steve
>> On Mon, 8 Jun 2020, Michael Balzer wrote:
>>> That may have been https://github.com/openvehicles/Open-Vehicle-Server/issues/2 <https://github.com/openvehicles/Open-Vehicle-Server/issues/2>
>>> Am 08.06.20 um 19:02 schrieb Stephen Casner:
>>>> I'm running 3.2.012. This morning when I went to check the status
>>>> after charging overnight, which had completed, the iPhone app was
>>>> behaving in a very strange manner. I cycled a few times (for as long
>>>> as I watched) through three states at an interval on the order of
>>>> 10-20 seconds:
>>>> 1. 86%, ideal range 191, no charge connector icon. Those range and
>>>> SOC numbers were correct, but the charge cable was connected.
>>>> 2. 95%, ideal range 177, charge connector icon shown.
>>>> 3. 48%, don't recall the range, no charge connector icon.
>>>> When I checked the Car screen, it too was cycling among showing no
>>>> numbers, showing old gray numbers, and showing some numbers in white.
>>>> I don't recall their accuracy.
>>>> Now after I finished my morning walk the display appears stable and
>>>> correct with 86%, ideal range 190, and charge connector icon shown.
>>>> The Car screen shows just old numbers in gray except for the aux
>>>> battery voltage. Sorry I didn't have the presence of mind to grab
>>>> -- Steve
>>>> OvmsDev mailing list
>>>> OvmsDev at lists.openvehicles.com <mailto:OvmsDev at lists.openvehicles.com>
>>> Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
>>> Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
>>> OvmsDev mailing list
>>> OvmsDev at lists.openvehicles.com <mailto:OvmsDev at lists.openvehicles.com>
>> OvmsDev mailing list
>> OvmsDev at lists.openvehicles.com <mailto:OvmsDev at lists.openvehicles.com>
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OvmsDev