Skip to content
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

Ctxlink_wifi_options #2059

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

sidprice
Copy link
Contributor

This PR adds Wi-Fi management for ctxLink using GDB and a new monitor command.

With the original releases of ctxLink some users had issues using the HTTP and WPS provisioning features of ctxLink.

Also, after provisioning some users found it hard to discover the IP address of ctxLink, this is required to connect to the probe.

The new monitor command is "wifi".

To inspect the current Wi-Fi status the following command is used:

mon wifi

This will display either "Not Connected," or the SSID, Signal Strength (RSSI), and IP address of the connected Access Point.

To connect to a Wi-Fi Access Point the following command is used, substituting the SSID and PassPhrase settings of the AP:

mon wifi SSID,Passphrase

Spaces are accepted for these two parameters, however, there should be no space before or after the ",".

Your checklist for this pull request

Closing issues

None.

@sidprice sidprice force-pushed the ctxlink_wifi_options branch 3 times, most recently from 758729a to 4e6ea5c Compare January 19, 2025 22:26
@dragonmux dragonmux added this to the v2.1 release milestone Jan 20, 2025
@dragonmux dragonmux added Enhancement General project improvement Foreign Host Board Non Native hardware to runing Black Magic firmware on labels Jan 20, 2025
@sidprice sidprice force-pushed the ctxlink_wifi_options branch from 4e6ea5c to 791891e Compare January 20, 2025 15:49
@sidprice sidprice force-pushed the ctxlink_wifi_options branch 2 times, most recently from 29b352a to 447e76d Compare February 8, 2025 17:39
Display is incorrect, needs to treat input bytes
as hex.
This is required to keep the wi-fi stack operational, the BMF
code blocks in this function at times and therefore, wi-fi
is not serviced.
Required for new network "forget" command.
Embedded spaces not being processed correctly.
@sidprice sidprice force-pushed the ctxlink_wifi_options branch from 447e76d to eabddff Compare February 8, 2025 17:40
@Misaka0x2730
Copy link
Contributor

Hi!
First off, apologies if I’m stepping on your toes—I don’t mean to meddle in something that might be out of my scope.
I just wanted to suggest that there might be another way to achieve what you’re aiming for without modifying command.c.
Please, check the platform's custom command feature (PLATFORM_HAS_CUSTOM_COMMANDS), and you can find an example in my project here: https://github.com/Misaka0x2730/MioLink/blob/main/firmware/source/bmp/platform_commands.c#L38C17-L38C34
It could help keep the core code untouched while still delivering the same functionality.

@sidprice
Copy link
Contributor Author

@Misaka0x2730 Hello!

This was previously suggested by @ALTracer, and is a good idea. Since this PR is a feature update it is awaiting review and merging until after the next release. Hopefully, during this period I can adopt the suggestion.

@sidprice
Copy link
Contributor Author

I am not sure this is such a good idea since it prevents grouping the custom commands logically in the command list. Plus, there are quite a few other custom commands already in the command list, e.g. TraceSWO & RTT.

I think unless the maintainers (@dragonmux ) feel it is required I am going to leave the added command for this PR as it is.

@Misaka0x2730
Copy link
Contributor

I agree that @dragonmux is the one who’ll ultimately decide here.
However, I want to clarify my thoughts on “custom” commands. For instance, TraceSWO and RTT are supported by many (if not most) platforms—so they’re hardly “custom” in the sense of belonging to just one.
By contrast, Wi-Fi is specific to your platform, which I believe aligns more with the idea of platform-specific commands.

@perigoso
Copy link
Contributor

I agree that these should be platform commands at least for now, though not having control over the grouping is unfortunate.
I have some ideas to rework to the command system but until then we are limited with what we can do. Do note that this only affects the print on the help command and doesn't affect functionality

@sidprice
Copy link
Contributor Author

@perigoso Thanks for your input. I would be happy to review the platform commands should the command table/architecture change in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement General project improvement Foreign Host Board Non Native hardware to runing Black Magic firmware on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants