Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

SDK • Re: Pico W webserver example in C

$
0
0
Hi,

You can try running a Mongoose example to get a working baseline for your project. Mongoose is a lightweight networking library, well-documented, and a great fit for running a simple C webserver on the Pico W.

To give you a quick project that you can try, go to https://mongoose.ws/wizard/#/output?boa ... =baremetal (you will see a folder structure with the files contained by the project) and select the destination directory from the settings tab to download the project to your local machine.

Then, open it with VS Code (or use the make utility inside the terminal), build the project, and flash the binary to your board. You should see logs on the serial console, including the WiFi status and the IP address (don't forget to configure wifi AP name and password via the WIZARD_WIFI_NAME and WIZARD_WIFI_PASS defines in mongoose/mongoose_glue.h file). You can then connect to the assigned IP address from a browser to see the webserver running.

Heads up: I am part of the Mongoose development team. Hope this helps you get started.
I downloaded the project you suggested and changed the WiFi name and password. I built the application and downloaded it using a second Pico as a debugger. I checked my broadband router and sure enough I saw a device named "mip" in the WiFi list. If I halted target execution then, after a while, this entry was greyed out. So it is connected. However looking at the details of this connection entry I can see that there is a MAC address but no IP address. I assumed (probably a bad thing) that this project is set up for DHCP. I checked the Build options and tried turning both "lwIP network stack" and "MG_ENABLE_TCPIP" alternately. I started to debug what might be gong on but though this was a bit pointless as it should work out of the box. So if you have any pointers that would be great. I can use the printf() command to send debug information through the USB port. Is there any way of pushing the log information out that way? Many thanks.

Statistics: Posted by squin — Sun Feb 08, 2026 7:59 pm



Viewing all articles
Browse latest Browse all 8374

Trending Articles