[Ovmsdev] CAN-3 broken again?

Michael Balzer dexter at expeedo.de
Tue Jan 9 04:06:56 HKT 2018


Greg,

CANopen is a general framework for CANopen devices, not specifically for the Twizy. The module provides tools to analyze and talk to CANopen nodes of any kind.
It's generally useful for reverse engineering and getting access to vehicle components.

Including the CANopen module makes no difference to the running system (except a bit of memory usage for the shell commands, see my earlier response to Mark),
unless you explicitly start a CANopen process. Without a "co … start" command, there is no CANopen task or listener present.

There is also no filtering code in CANopen that applies to anything else but the CANopen listeners.

So your issue is certainly not related to the CANopen module, it's just coincidence it seemed to make a difference in your test.

Regarding the RX performance, see my previous message. Please verify it's the bus, not the obd2ecu.

Regarding the Wifi connection triggering the problem: this seems to match the assumed performance issue of the MCP driver.

Regards,
Michael


Am 08.01.2018 um 20:49 schrieb Greg D.:
> Hi Michael,
>
> Linking the several parts to this thread...  With the clarity of a new day, I'm being a bit more methodical, changing one thing at a time.  TL:DR question: 
> What is Canopen actively doing in a system without the Twizzy even present?
>
> Continuing on my issue isolation work from last night, it appears the whole 12v / modem thing might be irrelevant.  I've reproduced the "partial hang", where
> the OBDWiz dongle gets part way through the connect sequence before CAN3 hangs.  Metrics show 5 frames received, 7 transmitted.  One frame Rx overflow.  Error
> status = 0x 2040.  If I stop and restart obdii ecu, I can repeat the hang by restarting the connect in OBDWiz.
>
> The previous build was able to start OBDWiz and it ran all night with no issues.  The only difference between this build and the previous one is that I
> included Canopen in it.  *So, first issue:  Why would including Canopen make a difference?*  I don't have any reference to Canopen in my config, and the
> Twizzy vehicle module is not included in the build (I've got a Tesla Roadster).  The OBDWiz is on CAN3; CAN2 is unconnected.  The module is on my desk, so
> nothing on CAN1, either.
>
> The system.start script is as follows:
>
>     enable ******
>     obdii ecu start can3
>     power ext12v on
>     wifi mode client
>     # power simcom on
>     vehicle module TR
>     server v2 start
>
> Note the modem enable is commented out, so the need for 12v power is shown to be irrelevant.  Wifi connectivity is effectively disabled because the only
> configured network is hidden, so it doesn't auto-connect. 
>
> *Second issue:  If I remove Canopen and change the wifi hotspot to be not hidden, CAN3 hangs at the point where Wifi auto-connects.  *As before, there appears
> to be an Rx overflow, but this time if I stop and restart obdii, everything connects and runs properly.  Wifi disconnecting doesn't affect the CAN bus, but
> when it reconnects, the hang repeats.
>
> I've verified with can trace that the frames truly aren't being received, so it's not the obd2ecu process that's hung.  Obd2ecu continues to process other
> commands normally (e.g. obdii ecu list).
>
> So, summarizing, I believe there are two issues here.  First, the CAN2/3 driver needs some work in handling receive overflows.  In theory, the CAN devices
> should be resilient enough to withstand the loss of a frame or two, and indeed, I see OBDwiz retrying the connect (as monitored by Wireshark via a CAN
> splitter cable).    Second, Canopen is getting in the way, even when it is not being used.  If I understand the ESP architecture, all CAN recipients get all
> CAN frames from all (or both?) CAN busses, and ignore the ones they don't need.  I'm guessing this filtering code in Canopen is taking too long to be transparent.
>
> Greg
>
>
>
> Michael Balzer wrote:
>> Mark,
>>
>> the Twizy implementation currently depends largely on the CANopen framework. It may be possible to build a -very- restricted version without, but the result
>> would not be used by any Twizy driver.
>>
>> The CANopen framework is also a general toolkit to discover and talk to CANopen devices, see my intro at:
>>
>> https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/blob/master/vehicle/OVMS.V3/components/canopen/doc/Howto-detect-CANopen-nodes.txt
>>
>> The RAM usage of the manager module, while not having started a bus instance, is 24 bytes for the module state plus command registry. Command registry
>> follows the approach of the CAN framework to do the interface selection as a command level. So the CANopen command registry entries consist of 2 + 3 * 13 =
>> 41 commands.
>>
>> The same command registry overhead applies to all optional components, i.e. OBD2ECU and REtools. Maybe a better solution is to make all these components
>> loadable like the vehicles. I saw you subclassed RE from pcp, was this meant to support the dynamic loading/init by means of the power control command, or is
>> there another plan on this?
>>
>> Regards,
>> Michael
>>
>>
>> Am 08.01.2018 um 01:04 schrieb Mark Webb-Johnson:
>>>
>>> With renault twizy and canopen enabled:
>>>
>>>     OVMS > module memory
>>>     ============================
>>>     Free 8-bit 78744/243064, 32-bit 29116/55900, blocks dumped = 0
>>>
>>>
>>> With renault twizy and canopen disabled:
>>>
>>>     OVMS > module memory
>>>     ============================
>>>     Free 8-bit 84928/243096, 32-bit 29720/56504, blocks dumped = 0
>>>
>>>
>>> I can’t compile with canopen disabled and renault twizy enabled.
>>>
>>> Not sure where the difference is, but it would be preferrable if these optional components didn’t consume any ram unless explicitly loaded. Using the class
>>> object model, and member variables, should make that relatively simple.
>>>
>>> Regards, Mark.
>>
>> -- 
>> Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
>> Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
>>
>>
>> _______________________________________________
>> OvmsDev mailing list
>> OvmsDev at lists.teslaclub.hk
>> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>
>
>
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.teslaclub.hk/pipermail/ovmsdev/attachments/20180108/d0661dd9/attachment-0001.html>


More information about the OvmsDev mailing list