Week 3 · Lesson 2 · 55 minutes

Make the browser and LED agree

Build and explain this stage of your own connected prototype.

Planned lesson. Follow your teacher’s teaching order.

Task steps and checks

Do the work

  1. Keep the same readiness gate as the previous lesson. Without access, use Serial to check the logic and record the browser route as NOT TESTED.
  2. Rename example buttons to match your user. Send one useful action from the page; watch the LEDs and read the reply. Then change the state through Serial and check the page catches up. Try a second browser if available.
  3. Example: the user clicks “Report busy” but the board rejects it. Do not show Busy as confirmed. Read the actual board state again after reconnecting.
Follow the path
  1. Browser action
  2. ESP32 accepts or rejects
  3. LEDs and state reply
  4. Page updates

Check your result: A real action and a separate read agree with the board. Identify the state code you changed and the supplied networking code you used.

Revised weekly handout pages: 1, 2.

Materials

Existing October design, saved code, teacher-verified ESP32 circuit, USB data cable and computer; shared hardware, individual evidence.

Resources

Vocabulary

State transition
A rule linking the current state and an event to the next state and output.

See it

The board owns the stateBrowserESP32 board1. Button press: send the action2. Change LEDand state3. Response: the new state4. Show whatthe board saidPoll: read the stateCurrent state
The browser asks; the board decides. Show the state that comes back in the response, and treat a poll as a read, not as a new button press.

Watch

Watch the part on HTTP requests and responses. Your browser and your ESP32 follow the same request and response pattern.

The Internet: HTTP & HTMLCode.org

Open on YouTube

The video is on YouTube, which needs a VPN on most networks in mainland China. It is extra: the lesson works without it.

More examples and practice

Retrieve your saved version · 5 minutes

Open your own latest code and evidence. State what actually works and the next check; keep earlier versions.

Make the browser and LED agree · 10 minutes

The board owns the state. A browser button sends an action; it must display the board response, not optimistically invent success. Polling reads current state and must not count as a fresh user report. Wi-Fi and HTTP code are supplied scaffolding.

The button says Busy but the server rejects the request. What should the page show?

Reveal reasoning

It must not claim Busy was accepted. Show that the outcome is unconfirmed, then read the actual device state after reconnection.

Build test and record · 30 minutes

Work through the task below. Take turns with hardware; each student records their own actions, predictions and observations.

Practice

  1. Adapt button labels and messages to your user. Test browser action → logic → LED → page, then Serial action → page. Try a second browser if available. Explain your state code and identify the supplied networking code.

Save and explain your evidence · 10 minutes

Save the version and results. Explain one decision and one limitation to a partner. Record unfinished work for the next lesson instead of claiming success.

Connect directly to your ESP32 / Make the browser and LED agree

Do only the parts you did not finish in class. Write what really happened; if you did not test something, write NOT TESTED. This is one task for the week, and nothing else is due.

  1. Open this week’s handout and your saved code.
  2. Finish the evidence for both lessons. Use only your saved code and real results.

You are finished when: The evidence for both lessons is complete and matches what you really did.

Why this matters: Each week’s evidence becomes part of the connected prototype evidence you submit in Week 8.

  • There is no hardware task at home.

Revised weekly handout pages: 1, 2.

Weekly homework (Word) · Chinese weekly handout (Word)

Feedback on this week’s evidence

Task feedback only. Final C and D are separate best-fit judgements out of 8 using the school’s current MYP Year 5 criteria; do not average weekly bands.

This week’s task
Connect directly to your ESP32 / Make the browser and LED agree
Personal evidence and explanation
Identify your own technical action, evidence file, actual outcome and limitation.
BandObservable evidence
0No assessable evidence for this task yet.
1–2Identifies parts of the task; personal work and results are difficult to follow.
3–4Completes some steps with support; evidence or explanations have gaps.
5–6Completes the task with traceable personal evidence and explains results and limitations.
7–8Works independently, uses precise evidence to justify decisions and checks the effect of changes.