chaitu-ycr / py_canoe

Python 🐍 Package for controlling Vector CANoe 🛶 Tool
https://chaitu-ycr.github.io/py_canoe/
MIT License
54 stars 34 forks source link

[BUG] Occasionally diagnostic requests get stuck in pending (py_canoe 2.13) #56

Open THL2PLY opened 3 months ago

THL2PLY commented 3 months ago

Describe the bug I have a program to read data from an embedded system. I use this twice during my program, and the first time works fine every time. When it finishes that, it goes on to read some serial data and some other log data for a few seconds (I should mention that the CANoe simulation stays open in the background the entire time this is happening). When I return to CANoe to send more diagnostics requests at the end of my program, it gets stuck trying to send '10 03', and using the VSCode debugger I can see that it's stuck in the "while diag_req.pending" loop. I also get a warning from my OS saying "Server Busy" with options of "Switch to", "Retry", or "Quit". Upon clicking any of these buttons, either the CANoe GUI opens up and freezes, or it closes down and the Vector support app immediately opens, which usually breaks my program and closes it. Closing CANoe through the small icon on the windows taskbar also has the same effect.

To Reproduce Steps to reproduce the behavior:

  1. create a CANoe() instance
  2. send some diag requests
  3. leave program running while getting serial data (pyserial library) and other data (Windows Command Line)
  4. send more diag requests using the same CANoe() instance as before
  5. should get stuck on the first request.

Expected behavior I want the program to continue to send all diag requests without freezing.

Screenshots Cant paste for some reason so here are some logs:

The window I get says: "This action cannot be completed because the other program is busy. Choose 'Switch to' to activate the busy program and correct the problem"

Then with options of: "Switch to" "Retry" "Cancel"

https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQtXSOPDFSoWTCluyWmxXEGbXFo7_2R27z6_g&s

>>> First run >>> 2024-06-20 13:43:02,586 [CANOE_LOG] [INFO ] ecu_qualifier: Diagnostic Request --> 10 03 2024-06-20 13:43:02,710 [CANOE_LOG] [INFO ] ecu_qualifier: Diagnostic Response +ve <-- 50 03 00 19 01 F4 2024-06-20 13:43:03,713 [CANOE_LOG] [INFO ] ecu_qualifier: Diagnostic Request --> 27 0D 2024-06-20 13:43:03,832 [CANOE_LOG] [INFO ] ecu_qualifier: Diagnostic Response +ve <-- 67 0D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 2024-06-20 13:43:04,835 [CANOE_LOG] [INFO ] ecu_qualifier: Diagnostic Request --> 27 0E 00 00 00 00 00 00 00 00 00 00 00 00 2024-06-20 13:43:05,258 [CANOE_LOG] [INFO ] ecu_qualifier: Diagnostic Response +ve <-- 67 0E ... read part numbers ... <<< Everything works fine <<<

>>> Later using same instance a second time >>> 2024-06-20 13:44:43,715 [CANOE_LOG] [INFO ] CANoe Measurement Running Status = True 2024-06-20 13:44:43,717 [CANOE_LOG] [INFO ] Outputed "CANoe measurement already started!" in the Write Window. 2024-06-20 13:44:43,717 [CANOE_LOG] [INFO ] ecu_qualifier: Diagnostic Request --> 10 03 <<< Stuck here <<<

py_canoe (please complete the following information):

OS and Vector CANoe (please complete the following information):

Additional context My programs are running in wrapper classes to make my specific uses easier. my CANoe() object is in a wrapper class, as well as my Serial() object.

JeganJayaraj commented 2 months ago

Hi, Seems the server is busy somehow the CANoe GUI got hanged, could you try closing the application and execute it once? Also make sure there is only one CANoe instance running.