Repository navigation
Conversation
changeScreen() rebuilds the CAN line combo on every screen change. The rebuild reset the selection to "CAN Line 1 Auto", which reconnected the ECU at 500K, and it connected currentIndexChanged again each time while only disconnecting the (unused) clicked signal. The extra connections made one change trigger several reconnects in a row. Remember the selected index, rebuild the combo with signals blocked, disconnect currentIndexChanged before reconnecting it, and restore the selection. Needed for ECUs that only answer at 250K, e.g. the EDC16CP33 on an Espace IV ph2 (Auto selects 500K there). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
I'm not sure if this is correct with the merge of fix/issue_1888 and also in the pull request #1887 |
#1889 (fix for #1888) and #1887 fix different things:
Reconnects still happen after #1889, for example:
So both #1886 and #1887 are still needed. #1886 and #1887 are independent of #1889 and of each other: #1886 stops the screen change from resetting the CAN line and reconnecting, and #1887 makes sure any reconnect that does happen reopens the session. |
|
ok 👍 |
|
So this is ready to merge? |
|
Thanks for the detailed explanation and the CLIP excerpt. Agreed on CAN2: if there's no CLIP vehicle with brp=1 on the second network, the "CAN Line 2@250K/125K" entries are indeed superfluous. (Your excerpt also nicely shows brp=1 on the 6/14 network, which matches my Espace IV ph2 at 250K.) This PR doesn't change which entries exist, though; it's only about what happens to the selection when you change screens. ELM log (unmodified After selecting @250K again at 15:36:11, it reconnects about 12 times with Reproduction without a car, using the
This behaviour has been there since |
|
|
That would be a separate change from this PR, and it wouldn't remove the problem: on STN adapters the combo stays, and my vLinker FS is one (STN1170 v4.3.2, so Also, the "CAN Line 1 Auto/@500K/@250K" entries aren't CAN2: they switch the normal 6/14 line between If the maintainers want to restrict or rename the CAN line options, I'd suggest a separate issue/PR for that. This one only keeps the selection across screen changes and stops the repeated reconnects. |

Problem
Some cars run their diagnostic CAN bus at 250 kbit/s instead of 500 kbit/s. For example, on a Renault Espace IV ph2 the bus at the OBD socket is at 250K, and "CAN Line 1 Auto" connects at 500K, so every request fails with CAN ERROR. The workaround is to select "CAN Line 1@250K" in the toolbar, but that only lasts until you open another screen:
So in practice it's impossible to work with an ECU that needs a manually selected CAN speed.
Cause
changeScreen() calls set_can_combo(), which clears and refills the combo box. That resets the selection to index 0 ("Auto") and fires currentIndexChanged, which reconnects at that speed. The function also disconnects the wrong signal (clicked instead of currentIndexChanged) before connecting it again. Each screen change therefore adds another connection, and one change ends up triggering several reconnects.
Fix
set_can_combo() now:
Changing screens no longer changes the CAN speed or triggers reconnects. Choosing a different speed still reconnects once, as before.
Tested on a Renault Grand Espace IV ph2 (EDC16CP33 over CAN at 250K, vLinker FS): the selection stays on "CAN Line 1@250K" across screen changes, with a single reconnect when selecting it.
Goes together with PR #1887