CMPE 183 - Netwowrking / Advanced CS topics
Linux:
-
Compile the server:
make
-
Run the server:
./bin/server
-
Clean up the object files:
make clean
Pi Pico-W:
We use cmakelists.txt and PiSDK for running on the Pi Pico-W.
-
Setup the Pico SDK
git clone -b master https://github.com/raspberrypi/pico-sdk.git` cd pico-sdk git submodule update --init export PICO_SDK_PATH=$(pwd)
-
Compile the code
mkdir build cd build cmake .. make -j$(nproc)
-
Flash to the Pico W
- Hold the BOOTSEL button, connect to a computer via USB.
- Drag the .uf2 file to the RPI-RP2 drive.
To test the server you must have a stable connection to the device hosting it unless running locally.
This guide will use localhost for simplicity. If running on an external device replace this with the IP address of your device. ex: 172.16.80.251.
The port number could also differ depending on the device. Linux runs on :8080 while Pi devices run on :80
Get a basic text response:
curl http://localhost:8080/
Hello World!Get a file:
curl http://localhost:80/data/index.htmlPrimary Source: RFC 9910 Standard
Secondary Sources (HTTP 0.9/1 RFC 1945): W3 HTTP -&- DataTracker Documentation