Skip to content

Allow response to be specified in makefsdata script#3000

Merged
kilograham merged 3 commits into
raspberrypi:developfrom
peterharperuk:makefsdata_captive_portal
Jun 19, 2026
Merged

Allow response to be specified in makefsdata script#3000
kilograham merged 3 commits into
raspberrypi:developfrom
peterharperuk:makefsdata_captive_portal

Conversation

@peterharperuk

@peterharperuk peterharperuk commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Currently the header contents are hardcoded.
This prevents using the makefsdata script to implement a captive portal as we have to send a redirect when a 404 result would be returned.

When loading file contents, look for a file with the same name with a "hdr" and use its contents for the header.

We can then use this for the access point example which can then be much simpler.

Fixes #2646

@peterharperuk peterharperuk added this to the 2.2.1 milestone Jun 10, 2026
@peterharperuk peterharperuk requested a review from kilograham June 10, 2026 18:15
Comment thread src/rp2_common/pico_lwip/tools/makefsdata.py
Comment thread src/rp2_common/pico_lwip/tools/makefsdata.py Outdated
@peterharperuk peterharperuk changed the title Allow headers to be specified in makefsdata script Allow response to be specified in makefsdata script Jun 11, 2026
Currently the response contents are hardcoded.
This prevents using the makefsdata script to implement a captive
portal where we have to send a redirect when a 404 result would be
returned.

When loading file contents, look for a file with the same name with
a "response" extension and use its contents for the response.

We can then use this for the access point example which can then be
simplified.

Fixes raspberrypi#2646
Only return on zero contents if a .response file is found.
@peterharperuk peterharperuk force-pushed the makefsdata_captive_portal branch from 5d55c08 to 2794b1a Compare June 11, 2026 09:52
Comment thread src/rp2_common/pico_lwip/tools/makefsdata.py Outdated
Co-authored-by: Andrew Scheller <lurch@durge.org>
@peterharperuk

Copy link
Copy Markdown
Contributor Author

@kilograham There are a couple of example PR's that need this...

raspberrypi/pico-examples#754
raspberrypi/pico-examples#701

@kilograham kilograham merged commit 7db5fb5 into raspberrypi:develop Jun 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants