-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canable device hangs after desktop application crash (= stop without disonnecting) #165
Comments
|
You mean you first start the app, kill the app, and restart the app, then it's not receiving data? |
Linux (Ubuntu)
I created a simple example (cf below) that connect, read an sdo and stop without disconnecting.
I can't but if needed, some of my colleagues have a setup that could do that |
Exactly ! |
Thanks. I don't have a canopen device here, can you create the matching other side, too? |
Thanks for your help. |
If you are on Linux, using the |
with socketan you can create a 'vcan0' interface, and use https://github.com/CANopenNode/CANopenLinux to create a node that listens on that interface. I only do this about once every 2 years, don't remember the finer details |
My working theory is there's a problem with re-init of python-can when using the |
No indeed, that was just a suggestion to create a test setup without any actual canopen device |
Thanks to both of you.
|
I've setup your new test script, and it's running in a |
Interesting, before your comment I was thinking it looked like when you send 3 frames that fill up the hardware FIFO but there is no other device sending an ACK. Tempted to blame python-can , but the errors you got may point to the device getting into a broken state. Thanks for confirming you are testing the latest build from master. I would +1 on marc's request for a wireshark trace - wonder what's going on here |
Every run of the test script starts with a
and is answered with a
in the bad case, the response times out after ~1s:
Here's a wireshark capture. I'm not sure who triggers the first 3 request/response cycles, it may be wireshark. In the beginning I played with different sleeps, after 34s the test runs with a 3s sleep between the runs. The capture ends with the timed out |
Here a cleaner capture, again with 3s sleep between the test program calls. The candlelight is running current master firmware. It fails with the same problem. |
I can reproduce the |
dumb question, what dependency am I missing ?
Switching instead to the commented line |
|
ACK - I suggested to use
The |
thanks. I had only looked for it in my distro's packages.
Skimming throught the ST USB stack, I don't see how that could be possible ? there's no dynamic allocation, and the string descriptor requests are handled pretty much like all other control requests. Their handling of the "len" argument is a bit dubious at times (casting to/from *uint16) but I imagine we would be seeing more problems if it was flawed. |
hi guys, did you crack the case eventually? :) |
No, I currently don't have time to chase that bug. |
Same here unfortunately. the next steps would be to hook up a debugger, reproduce the problem, then examine the device state (USB periph registers, etc), and possibly set breakpoints on the get_descriptor functions. |
Hi all,
First, thank you for this great repository.
We are facing a weird problem with our Canable-based tools using candleLight_fw.
We have built a small desktop application using python canopen that connect to our custom product over can with a Canable.
Everything works fine except if our application is not terminated properly (killing it with linux "kill" command or stopping the vscode python debugger) thus bypassing the canopen disconnect step.
In this case the Canable seems to still be running as it is still visible on USB but no CAN messages seems to reach our device.
Canopen library debug shows : "Transfer aborted by client with code 0x05040000"
Rebooting our Canable (by disconnecting / reconnecting it from USB) fix the problem.
Any idea what could be the cause of this ? Any workaround we could use to avoid needing to disconnect / reconnect manually ?
Thanks,
The text was updated successfully, but these errors were encountered: