Skip to content

feat(wifi): Add get/set hostname to STA and AP (and menus) #469

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

Merged
merged 3 commits into from
Jul 8, 2025

Conversation

finger563
Copy link
Contributor

@finger563 finger563 commented Jul 8, 2025

Description

  • Add get/set_hostname to espp::WifiSta and espp::WifiAp
  • Add hostname (get/set) to espp::WifiStaMenu and espp::WifiApMenu

Motivation and Context

Allows run-time reconfiguration of hostname (which can also be set via LWIP menuconfig settings).

How has this been tested?

Build and run example on qtpy esp32s3 and test get/set hostname command to make sure it works - also tested with nslookup and ping on host computer.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

CleanShot 2025-07-08 at 09 36 11

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

@finger563 finger563 requested a review from Copilot July 8, 2025 14:40
@finger563 finger563 self-assigned this Jul 8, 2025
@finger563 finger563 added enhancement New feature or request cli wifi labels Jul 8, 2025
Copy link

github-actions bot commented Jul 8, 2025

✅Static analysis result - no issues found! ✅

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces hostname configuration capabilities to both the WiFi station and access point components, exposing get/set operations at runtime via the CLI menus.

  • Added get_hostname and set_hostname methods to WifiSta and WifiAp
  • Exposed new hostname commands in WifiStaMenu and WifiApMenu
  • Updated documentation comments around the new methods

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
wifi_sta_menu.hpp Inserted hostname menu entries for STA get/set
wifi_sta.hpp Defined get_hostname / set_hostname for STA
wifi_ap_menu.hpp Inserted hostname menu entries for AP get/set
wifi_ap.hpp Defined get_hostname / set_hostname for AP
Comments suppressed due to low confidence (1)

components/wifi/include/wifi_ap_menu.hpp:52

  • There’s a missing comma between the command name and the lambda. It should be "hostname", [this] to compile correctly.
        "hostname" [this](std::ostream &out) -> void {

@finger563 finger563 merged commit 71f61b7 into main Jul 8, 2025
84 of 85 checks passed
@finger563 finger563 deleted the feat/wifi-hostname branch July 8, 2025 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli enhancement New feature or request wifi
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant