Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pico_w/wifi/access_point/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ target_include_directories(picow_access_point_background PRIVATE
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts
${CMAKE_CURRENT_LIST_DIR}/dhcpserver
${CMAKE_CURRENT_LIST_DIR}/dnsserver
${PICO_LWIP_CONTRIB_PATH}/apps/httpd
)

target_link_libraries(picow_access_point_background
pico_cyw43_arch_lwip_threadsafe_background
pico_stdlib
pico_lwip_http
ap_content
pico_status_led
)
# You can change the address below to change the address of the access point
pico_configure_ip4_address(picow_access_point_background PRIVATE
Expand All @@ -31,13 +35,22 @@ target_include_directories(picow_access_point_poll PRIVATE
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts
${CMAKE_CURRENT_LIST_DIR}/dhcpserver
${CMAKE_CURRENT_LIST_DIR}/dnsserver
${PICO_LWIP_CONTRIB_PATH}/apps/httpd
)
target_link_libraries(picow_access_point_poll
pico_cyw43_arch_lwip_poll
pico_stdlib
pico_lwip_http
ap_content
pico_status_led
)
# You can change the address below to change the address of the access point
pico_configure_ip4_address(picow_access_point_poll PRIVATE
CYW43_DEFAULT_IP_AP_ADDRESS 192.168.4.1
)
pico_add_extra_outputs(picow_access_point_poll)

pico_add_library(ap_content NOFLAG)
pico_set_lwip_httpd_content(ap_content INTERFACE
${CMAKE_CURRENT_LIST_DIR}/content/index.shtml
)
13 changes: 13 additions & 0 deletions pico_w/wifi/access_point/content/index.shtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html>
<head>
<title>Pico Access Point</title>
</head>
<body>
<h1>Hello from Pico W</h1>
<p>Led is <!--#led--></p>
<p></p>
<form action="/switch.cgi" method="get">
<button name="switch" value="<!--#not_led-->">Turn led <!--#not_led--></button>
</form>
</body>
</html>
10 changes: 10 additions & 0 deletions pico_w/wifi/access_point/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,14 @@
// This example uses a common include to avoid repetition
#include "lwipopts_examples_common.h"

// Enable some httpd features
#define LWIP_HTTPD_CGI 1
#define LWIP_HTTPD_SSI 1
#define LWIP_HTTPD_SSI_MULTIPART 1
#define LWIP_HTTPD_SUPPORT_POST 0
#define LWIP_HTTPD_SSI_INCLUDE_TAG 0

// Generated file containing html data
#define HTTPD_FSDATA_FILE "pico_fsdata.inc"

#endif
Loading