Skip to content

feat: command prompt for zephyr log#2865

Open
ert78gb wants to merge 1 commit intomasterfrom
feat-zephyr-shell-command
Open

feat: command prompt for zephyr log#2865
ert78gb wants to merge 1 commit intomasterfrom
feat-zephyr-shell-command

Conversation

@ert78gb
Copy link
Copy Markdown
Member

@ert78gb ert78gb commented Mar 22, 2026

closes: #2812

It works with the bundled firmware. Shell command to test the function is uhk connections

@kareltucek
Copy link
Copy Markdown
Collaborator

Works fine by me.

One a bit distracting thing is those prompts that are inserted even in the middle of a command, e.g.:

2026-03-23 17:22:09 | UHK 80 right | Executing following command from usb in UhkShell: 'uhk connections'
Connection info:
----------------------
Compiled peripheral count: 3
Configured peripheral count: 3
Pairing mode: 2
2026-03-23 17:22:09 | UHK 80 right | Directed advertising enabled: 1
New connection: 1
Known host connection ble addresses:
- 0 'Usb'
- 1 'Dongle I': address: E0:AE:78:DA:59:E3 (random)
- 2 'Dongle II': address: EA:5A:B8:F6:43:75 (random)
- 3 'Dongle III': address: CC:E7:0C:EA:75:FC (public)
2026-03-23 17:22:10 | UHK 80 right | - 4 'Dongle IV': address: FF:0B:38:20:85:09 (random)
- 5 'Moto': address: D4:5E:89:65:A3:F8 (public)
- 6 'Tux': address: 98:5F:41:D2:92:3A (public)
- 7 'Unregistered Ble': address: D2:14:BB:8D:AA:13 (random)
- 22 'Unregistered Ble': address: 00:00:00:00:00:00 (public)
2026-03-23 17:22:10 | UHK 80 right | - 23 'USB Device (Backup)'
All bonds:
- D2:14:BB:8D:AA:13 (random)
- 98:5F:41:D2:92:3A (public)
- FB:70:3D:95:CB:A6 (random)
- D4:5E:89:65:A3:F8 (public)
2026-03-23 17:22:10 | UHK 80 right | Current connections:
- peer 1(left (n/a, fb:70:3d:95:cb:a6)), connection 29
- peer 3(host1 (Moto, d4:5e:89:65:a3:f8)), connection 6
- n/a (n/a, ff:ff:ff:ff:ff:ff)
----------------------

Not sure what to do with them though.

  • Maybe show them only if the device is different from the one that produced the last log, or the time since last "log" is higher than 5 seconds?
  • Or include them after every newline.

Anyways, this is good enough for me.

@kareltucek
Copy link
Copy Markdown
Collaborator

kareltucek commented Mar 25, 2026

  • Furthermore, if a thing doesn't end by a newline, next block should continue on the same line. I have pushed a change which makes uhk process the shell prompt. Without this change, the command and the prompt will be shown on separate lines. (Alternative is to process command echo on Agent side. If you want to go that way, let me know - it is a one-line change)

  • When command is entered, I think the prompt should be cleared.

@ert78gb
Copy link
Copy Markdown
Member Author

ert78gb commented Apr 8, 2026

Furthermore, if a thing doesn't end by a newline, next block should continue on the same line. I have pushed a change which makes uhk process the shell prompt. Without this change, the command and the prompt will be shown on separate lines. (Alternative is to process command echo on Agent side. If you want to go that way, let me know - it is a one-line change)

Agent could echo the command, it is up to you @kareltucek or @mondalaci .
If the firmware writes the command to the shell / log then we could check the communication is proper or not.
Or better to use both . Agent echos the command and the firmware also writes it. When Agent echos the command maybe put some separators like "============" or just empty lines.

When command is entered, I think the prompt should be cleared.

I kept it because I thought it is easier to resend the same command multiple times.
@mondalaci want to implement the terminal history feature, the up and down key switching between the prev and next command history.

You don't have to rush with the answer I am starting the developments on tomorrow afternoon or Friday morning

@mondalaci
Copy link
Copy Markdown
Member

I strongly prefer Agent-side echoing for responsiveness. I think firmware-side echoing is redundant.

@kareltucek
Copy link
Copy Markdown
Collaborator

@mondalaci want to implement the terminal history feature, the up and down key switching between the prev and next command history.

That's why I think we should consider a full vt100 terminal. As long as there is some javascript terminal emulator package out there, we get all these features for free and much more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Command prompt for zephyr log.

3 participants