Enhancement requested: Consistent format responses to CLI commands and use stderr
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
The payload names no source files. Start by searching the repository for the string "Aborting due to: Timed out waiting for telemetry" to find where the CLI prints errors, and check how the process exits on that path. Done means that message goes to stderr with a non-zero exit code, and a successful run prints a success line to stderr with exit code 0. Confirm the change with a manual run of the telemetry request command.
由索引模型根据 Issue 内容生成。
描述
Bash is a great way to turn management of nodes into a workflow. For it to be truly useful, one needs to capture the responses in the terminal and be able to act on them. In a perfect world, the response to a command would be in a single line of response. Take, for example, a command to send a message. The response is four lines.
meshtastic --tcp 192.168.1.200 --dest '!b2a74524' --sendtext "Hello W2NJ Yagi 4524, W2NJ Mobile BB38 is calling to check on you." --ack --timeout 60
> Connected to radio
> Sending text message Hello W2NJ Yagi 4524, W2NJ BB38 is calling to check on you. to !b29fa658 on channelIndex:0
> Waiting for an acknowledgment from remote node (this could take a while)
> Received an ACK.
If you are reading off the terminal, that's probably okay. If you are trying to automate a process, it would look more like this:
MESSAGE="Hello ${DUT}, ${ATE} is calling to check on you."
meshtastic --tcp $ATEIP --dest $DUTID --sendtext "$MESSAGE" --ack --timeout $TIMEOUT
or better yet,
MESSAGE="Hello ${DUT}, ${ATE} is calling to check on you."
DUTREPLY=$(meshtastic --tcp $ATEIP --dest $DUTID --sendtext "$MESSAGE" --ack --timeout $TIMEOUT)
echo "Reply was $DUTREPLY"
The problem is that DUTREPLY is simply : "Connected to radio". What's we are really interested in is the end result on the fourth line, "Received an ACK".
Okay, maybe I could figure out how to capture the fourth line of reply. But there isn't alway a fourth line of reply. In the case below, all of the stdout goes to a file. The Meshatstic application doesn't take advantage of the stderr facility.
meshtastic --tcp $ATEIP --dest $DUTID --request-telemetry 2>&1 > $DUTTELE
> Connected to radio {stdout directed to a file}
> Sending device_metrics telemetry request tAborting due to: Timed out waiting for telemetryo !b29fa658 on channelIndex:0 (this could take a while)
> Aborting due to: Timed out waiting for telemetry
Meshtastic does not currently differentiate succesful termination output from error messages. I have resorted to the kluge of looking at file sizes to figure out whether a command was successsful or not. A telemetry request that failed is 166 bytes. A Connection Refused (Error 113) output is 61 B, and so on.
My suggestion/request is that Meshtastic regulalry prints a success or exit=0 message to stderr for any normal completion. Bt default, UNIX sends both stdout and sterror to stdout. No changes to user bash scripts are required. At the conclusion of execution, Meshtastic should send to stderr an exit code of zero for successful completion, and whetever non-zero error message currently obtains. If the user desires to monitor the stderr stream, that is his or her prerogative.
This request would not require a pile of refactoring all at once. Instead, each time the code corresponding to a Meshtasitc argument is touched, add the code required to send a success or failure messages to stderr. A good place to start would be this message, "Aborting due to: Timed out waiting for telemetry." Rewrite the output as an error, give it a number, and route it to stderr.
- 主要语言
- Python
- 星标
- 855
- 派生
- 355
- 平均合并
- 3 天 3 小时
- 30 天内合并 PR
- 12
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
meshtastic/python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
meshtastic/python#972 ·
维护者通常 1 天内回复
-
Bug: Can't run on Termux可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
meshtastic/python#969 ·
维护者通常 1 天内回复
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 62/100
meshtastic/python#506 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
meshtastic/python#985 · 3 条评论 ·
维护者通常 1 天内回复
-
Undocumented `--set` choices可能已有人在做 @Cryptoteep 于 54 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
meshtastic/python#978 · 1 个 reaction ·
维护者通常 1 天内回复
查看 meshtastic/python 的全部 Issue
相似的 Issue
-
[Bug]: test_remote_realpath_uses_argument_vector fails on Windows with Python 3.13+ (ntpath.isabs)可能已有人在做 @gouyu-hou 今天认领。 未关闭triage/confirmed
难度 1/5 1 小时以内 新手友好度 90/100
agentscope-ai/agentscope#4397 ·
维护者通常 2 天内回复
-
area/profiles area/sessions comp/desktop desktop/chat desktop/sessions P2 type/bug
难度 2/5 1-3 小时 新手友好度 75/100
NousResearch/hermes-agent#161712 ·
维护者通常 1 天内回复
-
[New Check]: postgresql_flexible_server_public_network_access_disabled可能已有人在做 @pouria-l 今天认领。 未关闭feature-request status/needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
prowler-cloud/prowler#13615 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
SACGF/variantgrid#2941 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
linkedin/Liger-Kernel#1730 ·
维护者通常 3 天内回复