Skip to content

Commit a2002e3

Browse files
authored
Merge pull request #8165 from anecdata/wifi_docs
Networking docs updates: Access Point, MDNS
2 parents 2a83657 + 73af1b8 commit a2002e3

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

docs/workflows.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ MDNS is used to resolve [`circuitpython.local`](http://circuitpython.local) to a
9494
hostname of the form `cpy-XXXXXX.local`. The `XXXXXX` is based on network MAC address. The device
9595
also provides the MDNS service with service type `_circuitpython` and protocol `_tcp`.
9696

97+
Since port 80 (or the port assigned to `CIRCUITPY_WEB_API_PORT`) is used for web workflow, the `mdns`
98+
[module](https://docs.circuitpython.org/en/latest/shared-bindings/mdns/index.html#mdns.Server.advertise_service)
99+
can't advertise an additional service on that port.
100+
97101
### HTTP
98102
The web server is HTTP 1.1 and may use chunked responses so that it doesn't need to precompute
99103
content length.

shared-bindings/mdns/Server.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(mdns_server_find_obj, 1, _mdns_server_find);
171171
//| ``service_type`` and ``protocol`` can only occur on one port. Any call after the first
172172
//| will update the entry's port.
173173
//|
174+
//| If web workflow is active, the port it uses can't also be used to advertise a service.
175+
//|
174176
//| :param str service_type: The service type such as "_http"
175177
//| :param str protocol: The service protocol such as "_tcp"
176178
//| :param int port: The port used by the service"""

shared-bindings/wifi/Radio.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,12 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_station_obj, wifi_radio_stop_station);
339339
//| or exactly 64 hexadecimal characters if it is the hex form of the 256-bit key.
340340
//|
341341
//| If ``max_connections`` is given, the access point will allow up to
342-
//| that number of stations to connect."""
342+
//| that number of stations to connect.
343+
//|
344+
//| .. note::
345+
//|
346+
//| In the raspberrypi port (RP2040 CYW43), ``max_connections`` is ignored.
347+
//| """
343348
//| ...
344349
STATIC mp_obj_t wifi_radio_start_ap(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
345350
enum { ARG_ssid, ARG_password, ARG_channel, ARG_authmode, ARG_max_connections };
@@ -559,7 +564,12 @@ MP_PROPERTY_GETTER(wifi_radio_ipv4_subnet_ap_obj,
559564
//| ipv4_dns: Optional[ipaddress.IPv4Address],
560565
//| ) -> None:
561566
//| """Sets the IP v4 address of the station. Must include the netmask and gateway. DNS address is optional.
562-
//| Setting the address manually will stop the DHCP client."""
567+
//| Setting the address manually will stop the DHCP client.
568+
//|
569+
//| .. note::
570+
//|
571+
//| In the raspberrypi port (RP2040 CYW43), the access point needs to be started before the IP v4 address can be set.
572+
//| """
563573
//| ...
564574
STATIC mp_obj_t wifi_radio_set_ipv4_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
565575
enum { ARG_ipv4, ARG_netmask, ARG_gateway, ARG_ipv4_dns };

0 commit comments

Comments
 (0)