ESP32-S3 Lab · Day 30 of 30

Put your board
on the network

Day thirty — the last leg. The ESP32-S3 joins your Wi-Fi, opens port 80, and waits for your computer to dial in. When a line you type on one machine appears on the other, your board has become what this course promised on day one: a device on the network, with an address, a door, and something to say.

About 30 minutesArduino firstMicroPython optionalFinal day — no wiring
Agent assist code TSK-DAY30-TCPIP

Hand this to an agent so it can pull the lesson packet and coach you step by step.

01 First, know the pieces

What you need

Three things on the bench, plus one download for your computer — Processing, which arrives in the steps. Tap Define on anything unfamiliar; the answer opens as a field note you can read and dismiss without losing your place.

Official manual photo of the ESP32-S3 development board.
Manual photo

ESP32-S3 board

The brain — today it joins your network and listens.

Official manual screenshot of the Arduino IDE interface.
Manual screenshot

Arduino IDE

Uploads the sketch and opens Serial Monitor.

Official manual page showing the WiFi Server sketch and its Serial Monitor output.
Manual sketch

Official sketch

Sketch_24.2_WiFiServer.ino

02 One action at a time

Build it

All the wiring days led here — today the path is code, one download, and a conversation across your own network. Tap each step as you go to keep your place.

0 / 8 done
  1. Open Sketch_24.2_WiFiServer.ino in Arduino IDE.

  2. Replace the two ******** placeholders with your own Wi-Fi name and password — the same network your computer is on.

  3. On your computer, install Processing from processing.org/download.

  4. In Processing, add the ControlP5 library — Sketch → Import Library → Add Library, then search ControlP5.

  5. Back in the sketch folder, open the bundled sketchWiFi/sketchWiFi.pde in Processing and click Run.

  6. Upload the Arduino sketch, then open Serial Monitor at 115200 and watch the board join your network and print its IP address and port 80.

  7. In sketchWiFi, choose TCP CLIENT mode, enter the board's printed IP and port 80, and connect.

  8. Type a line in sketchWiFi and press Enter — it lands in Serial Monitor. Answer from Serial Monitor's send box — it lands in sketchWiFi.

Two machines, one line.

Text is crossing your own network between computer and board. Head to Test & debug to confirm the exchange — the last check of the voyage.

03 Read just enough code

Read the code

The sketch does two jobs. setup() joins your Wi-Fi as a station, prints the address the router assigned, and starts the server; loop() is a relay, carrying each line from the network to the monitor and each line from the monitor to the network. Switch to MicroPython to see the same idea in raw sockets.

Sketch_24.2_WiFiServer.ino
#define port 80
WiFiServer  server(port);

WiFi.begin(ssid_Router, password_Router);
server.begin(port);

WiFiClient client = server.accept();               // listen for incoming clients
Serial.println(client.readStringUntil('\n')); // print it out the serial monitor
client.print(Serial.readStringUntil('\n')); // print it out the client.
WiFi.begin(ssid_Router, password_Router)Joins your router's network as a station — the router hands the board an IP address.
server.begin(port)Starts listening at port 80 — a numbered door other machines can knock on.
client.print(Serial.readStringUntil('\n'))Reads the line you typed in Serial Monitor and sends it down the network to the computer.

04 Understand, don't memorise

How two machines talk over a network

Yesterday the board earned an address on your network. Today it puts that address to work and holds a real conversation with another machine. Every connection on the internet — every page you load, every message you send — is the same four-beat exchange you are about to run entirely inside your own router.

Join

The board gets an address

In station mode the board joins your Wi-Fi and the router hands it an IP address — its number on the network, printed to Serial Monitor for you to copy.

Listen

It opens a port

Calling server.begin() makes the board wait at port 80 — a numbered door at that address. Ports are how one machine can host many services at once, each behind its own door.

Dial

The other machine calls in

Your computer takes the client role. It dials the exact IP and port the monitor printed, the board accepts, and the two are now joined.

Stream

One reliable line, both ways

Once joined, both ends read and write the same stream of bytes. TCP re-sends anything that goes missing and hands each side the bytes in the order they were sent, so you just watch whole lines of text arrive intact.

The model server listens at an address and port → client dials that address and port → one reliable stream, in order, both ways

Day 29 gave it the address

Yesterday the board joined the network and the router handed it a number. Today it opens a door at that number and offers a service that answers when dialled — an address, a port, and something listening.

Why the stream is reliable

Networks drop and shuffle pieces of data all the time. TCP hides that for you — it numbers each chunk, re-sends anything that goes missing, and reassembles them in order before your code ever sees them. You read clean text in the right sequence, and every web server in the world leans on exactly this.

One address, many doors

A port is a number that picks which service you mean at an address. The board answers on 80 here, while other ports could serve other things — which is how a single machine hosts many services at once without them getting tangled.

05 Know it worked

Test & debug

Success and recovery sit side by side, so you never have to go hunting when something looks off.

What you should see
Serial Monitor115200 baud
Connecting to YourNetworkName.....WiFi connected.IP address: 192.168.1.42IP port: 80Client connected.hello from the chart tableClient Disconnected.

Your address will differ — always dial the one your monitor just printed. The middle lines are whatever the two machines say to each other.

If it doesn't
  • Dots forever? Re-check the Wi-Fi name and password in the sketch, confirm the network has a 2.4 GHz band, then press the board's reset button.
  • Processing can't connect? Both machines must be on the same network — and use the IP the monitor just printed, since it changes between networks.
  • ControlP5 error on Run? Install the library from Processing's Add Library window, then run the sketch again.
  • Nothing arrives? Connect before typing, and end every line with Enter.

06 Make the idea yours

Try this: dial your board from your phone

One last experiment, and it needs nothing but the phone in your pocket. A web browser is a TCP client — the same role sketchWiFi just played. Point one at your board, watch the two talk, then teach the board to answer on its own. It fits inside today's 30 minutes, and it closes the course.

Let your phone dial in

On your phone, joined to the same Wi-Fi, open a browser and go to http:// followed by the board's printed IP address. The browser dials port 80 — exactly what sketchWiFi did — and the request it sends lands in Serial Monitor as a line beginning GET /. Your phone just spoke to your board the way it speaks to any website.

Make it answer back

With the browser still waiting, type a line into Serial Monitor's send box and press Enter — it travels back down the same connection to your phone. Then, in the sketch, check each incoming line and have the board client.print("aye\n") whenever the line contains "ahoy". A two-word protocol that answers on its own, and it's yours.

07 Learn it with a hand on the tiller

Coach me through it

Every lesson ships with a code and a machine-readable packet, so an agent can guide you with full context.

Lesson code

TSK-DAY30-TCPIP

How the agent should behave: guide one step at a time, wait for you to confirm, explain terms on request, and check credentials, the 2.4 GHz band, and the printed IP before changing code.

Keep your place

Finished Day 30?

Mark it complete — it shows on your course map, and your place is saved on this device.

Field note

Shortcut

Prompt copied