Recall & Review
beginner
What is a WebSocket?
A WebSocket is a way for a computer to keep a connection open with a server so they can send messages back and forth instantly, like a phone call instead of sending letters.
Click to reveal answer
beginner
Why use WebSocket for live updates on a Raspberry Pi?
WebSocket lets the Raspberry Pi get new information right away without asking again and again, saving power and making updates faster.
Click to reveal answer
intermediate
Which protocol does WebSocket use to start a connection?
WebSocket starts with an HTTP handshake, then switches to the WebSocket protocol for continuous communication.
Click to reveal answer
intermediate
How does a Raspberry Pi listen for WebSocket messages in Python?
It uses a WebSocket client library to connect and then waits for messages in a loop, reacting when new data arrives.
Click to reveal answer
beginner
What is a common use case of WebSocket on Raspberry Pi?
To show live sensor data or control devices instantly from a web page without refreshing the page.
Click to reveal answer
What makes WebSocket different from regular HTTP requests?
✗ Incorrect
WebSocket keeps the connection open so both sides can send messages anytime without reconnecting.
Which language is commonly used on Raspberry Pi to handle WebSocket connections?
✗ Incorrect
Python is popular on Raspberry Pi for programming WebSocket clients and servers.
What is the first step in establishing a WebSocket connection?
✗ Incorrect
WebSocket starts with an HTTP handshake to upgrade the connection.
Why is WebSocket good for live updates?
✗ Incorrect
WebSocket sends data instantly as soon as it is available.
Which of these is NOT a feature of WebSocket?
✗ Incorrect
WebSocket does not save data to disk automatically; it only manages communication.
Explain how WebSocket helps a Raspberry Pi show live sensor data on a web page.
Think about how the Pi and browser talk without waiting.
You got /4 concepts.
Describe the steps to set up a WebSocket client on a Raspberry Pi using Python.
Focus on the code flow from start to receiving data.
You got /4 concepts.