A silent expander gets more tries, and a failed start says more in the log
A user on a Cardputer Zero could not connect his Cap. MeshTerm stopped with "nothing answers at 0x43 on /dev/i2c-1", and no log said more than the dialog did. His Cap is the older Cap LoRa868, which carries no expander at all. Support for that board follows separately. What this commit changes is what MeshTerm knows when the next board stays silent. The expander gets more than one try. The first read still comes after POWER_SETTLE_S, which is sufficient on the boards we have. A board with a slower power rail refuses that read and answers a moment later, and that must not read as an absent board. The node now tries again until PI4IO_WAIT_S is spent. A board that is ready still answers at once, so nothing waits. The log of that failure carries the error of the bus. The sentence the user reads cannot carry it, because a refused address and a broken bus are the same thing to that user. They are not the same thing to us, and only the log can tell them apart afterwards. The node also writes its wiring to its own log. A board problem is reported with that file, and the wiring can come from a profile that the reporter wrote, so the file must say which pins the node used. The startup picker writes a failed connection to meshterm.log at WARNING. It wrote nothing before, on the reasoning that the dialog already says all that the log would say. That holds while the dialog is up. A user who reports a problem sends the log file long after it is gone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
63e31c334b
commit
bf79f9975c
3 files changed
+110
-7
No files matched your search
@@ -63,7 +63,7 @@ from ..core.discovery import (
|
||||
tcp_device,
|
||||
)
|
||||
from ..core.spiradio import spi_radios, without_radio_ports
|
||||
from ..persistence.logging import log_file_for
|
||||
from ..persistence.logging import get_logger, log_file_for
|
||||
from .logo import load_logo
|
||||
from .menus import Lane, align_icons, column_header
|
||||
from .tui import Choice, DeleteRequest, KeyRequest, Separator
|
||||
@@ -332,7 +332,10 @@ async def _smoke_test(
|
||||
continue
|
||||
except DeviceCommandError as exc:
|
||||
# A different failure that the user can act on (not a PIN). Show its remedy, then
|
||||
# go back to the list.
|
||||
# go back to the list. The log keeps the failure also when the dialog says all
|
||||
# that the log would say, because a user who reports a problem sends the log file,
|
||||
# and the dialog is gone long before that.
|
||||
get_logger().warning("%s did not connect (%s): %s", name, type(exc).__name__, exc)
|
||||
notice = connect_failure_text(exc)
|
||||
notice.append("\nChoose another device.")
|
||||
await ui.notify_startup(notice, title="Can't connect yet", banner=load_logo())
|
||||
|
||||
Reference in new issue
Block a user