Networking & Communications
Key captures from the group and individual assignments with links to their sections.
This week focuses on connecting devices through wired and wireless networks. We'll explore communication protocols, network addressing, and how to build networked systems with local input and output devices.
Training materials and documentation for networking and communications protocols.
View original notes on Slack • Recitation link
Understanding failure modes is critical for robust system design. See the class system integration page for detailed failure mode documentation and links.
The contrast between functional boxes (PCs) and designed products (Macs) illustrates the importance of user experience design. This connects to "How to Design (Almost) Anything" and "How to Make (Almost) Anything Usable" classes.
hci.rwth-aachen.de/fabusability — Computer science, design, and psychology intersect in usability research. Usability focuses on designing systems that work great for people, whether in projects, startups, or products like FabFame.
Literature: The Design of Everyday Things (intro to human computer interaction). See hci.rwth-aachen.de/fabusability for more resources.
Route wiring appropriately and mount circuit boards in a box—don't just throw them in! See examples from Gianfranco Paluto on Fab Academy. Consider mechanism alignment and surface finish.
Prevent defects (QA) and detect defects (QC). Methods include shake and drop tests, power cycling, environmental testing, and random inputs.
Details and links available on the class system integration page:
Fail Fast!!! — Feed-forward vs feedback development. Murphy's Law (rocket test engineer): "Anything that can go wrong, will go wrong." This means you have to anticipate how it'll fail and prevent it.
Design and document the system integration for your final project:
Good example: Fab Academy 2016 system integration assignment
Networking and communications enable devices to exchange data through wired and wireless connections. Understanding different protocols helps select the right communication method for each application.
Devices on networks require unique addresses for identification and communication:
Essential resources for networking and communications protocols.
Networking and Communications - MIT Academy
Comprehensive resource covering wired protocols (UART, I²C, SPI, USB, Ethernet), wireless protocols (Wi-Fi, Bluetooth, LoRa, RF), network addressing, OSI layers, modulation techniques, channel sharing methods, error detection/correction, and Internet protocols. Includes detailed tutorials, code examples, and implementation guides for various communication protocols.
Design, build, and connect wired or wireless node(s) with network or bus addresses and local input &/or output device(s). This assignment demonstrates two networked systems: an ESP-NOW multiplayer game and a Wi-Fi camera streaming system with edge AI processing.
A collaborative multiplayer game featuring geometric shape interactions, synchronized gameplay between two ESP32-S3 devices using ESP-NOW wireless communication. The system uses MAC address-based player identification and real-time state synchronization for coordinated gameplay. See Week 2 documentation and design files for complete details.
The system consists of two XIAO ESP32-S3 development boards, each with an SSD1306 OLED display (128x64) and capacitive touch sensors. The boards communicate wirelessly using ESP-NOW protocol, enabling low-latency peer-to-peer communication without requiring a Wi-Fi access point.
Network Type: Wireless peer-to-peer (ESP-NOW)
Protocol: ESP-NOW (Espressif's proprietary low-power wireless communication protocol)
Addressing Scheme: MAC address-based device identification
Shape Song Swing Along educational content integration and gameplay
Circle and square shape interaction gameplay mechanics
Each ESP32-S3 board connects to an OLED display via I²C (SDA pin 5, SCL pin 6) and reads touch sensor inputs from GPIO pins. The ESP-NOW communication is handled entirely through the ESP32-S3's built-in Wi-Fi radio, requiring no external hardware connections.
See Network Address Tables for complete device addressing information including MAC addresses for both player devices.
A Wi-Fi-enabled camera system using ESP32-S3's built-in camera and HTTP server capabilities to stream JPEG frames over Wi-Fi using MJPEG (Motion JPEG) protocol. The system also includes edge AI face detection using a FOMO (Faster Objects, More Objects) model from Edge Impulse for real-time person tracking. See Week 10 documentation and design files for complete details.
The system uses a XIAO ESP32-S3 Sense development board with an integrated camera module. The camera captures frames at QQVGA (160x120) or QVGA resolution, processes them through an Edge AI inference pipeline, and streams the results over Wi-Fi via HTTP multipart response. The system can also display camera output and inference results on an OLED display connected via I²C.
Network Type: Wireless local area network (Wi-Fi)
Protocol: HTTP over Wi-Fi (802.11), MJPEG streaming
Addressing Scheme: IP address (DHCP-assigned) and MAC address (hardware identifier)
The camera module is integrated directly on the XIAO ESP32-S3 Sense board, connected via parallel data bus (Y2-Y9), control signals (XCLK, PCLK, VSYNC, HREF), and I²C interface (SIOD, SIOC). The OLED display connects via I²C (SDA pin 5, SCL pin 6) with pull-up resistors. Wi-Fi connection is established through the ESP32-S3's built-in Wi-Fi radio.
See Network Address Tables for complete device addressing information including MAC and IP addresses for the camera system.
To connect the ESP32-S3 camera system to the MIT Wi-Fi network, you need to generate a device-specific password. The MIT network uses WPA2-PSK authentication for devices that are not 802.1X compatible.
const char* ssid = "MIT";
const char* password = "insert generated password from steps above";
A custom PCB design integrating the XIAO ESP32-S3 with the Wio-SX1262 LoRa radio module for Meshtastic communication, connected to a MAX30102 pulse oximeter sensor. The system enables long-range wireless communication using LoRa (Long Range) radio technology and the Meshtastic mesh networking protocol for decentralized device-to-device messaging.
This project draws inspiration from the Invisible String book series by Patrice Karst, which explores the concept of invisible connections that link us to the people we love, even when we're far apart. The book series and workbook include activities for making an invisible string chain of hearts, symbolizing these connections. This long-range radio system embodies that concept by creating invisible wireless links between devices across distances, enabling communication and data sharing through the Meshtastic mesh network.
I designed a custom PCB that integrates the XIAO ESP32-S3 & Wio-SX1262 Kit for Meshtastic & LoRa (see usage documentation) with a MAX30102 Heart Rate Sensor Module for pulse oximetry. The design process followed the same PCB design workflow established in Week 4, using Fusion 360 Electronics for schematic capture and PCB layout.
The MAX30102 sensor integrates red and infrared LEDs, a photodetector, and low-noise electronics for heart rate and blood oxygen (SpO2) measurement. Reference schematics were sourced from the Amazon product page and the Analog Devices MAX30102 datasheet.
Component selection required careful library management in Fusion 360 Electronics. I started by identifying the correct through-hole header variants needed for the XIAO ESP32-S3 and Wio-SX1262 modules, ensuring proper pin spacing and mechanical compatibility.
Accurate spacing between components was critical for proper module alignment. I used physical measurements from breadboard prototypes and Fusion 360's measurement tools to ensure correct header placement and pin spacing.
The schematic integrates the MAX30102 sensor with pull-up resistors for I²C communication, connects power and ground planes, and routes all necessary signals between the ESP32-S3, Wio-SX1262, and sensor modules.
PCB routing required careful attention to signal integrity, especially for I²C lines and power distribution. I iterated from initial routing to clean, labeled connections, then performed design rule checks to ensure manufacturability.
The final design includes a complete schematic, PCB layout, and 3D CAD rendering showing the assembled board with all modules and components.
The board was milled using the Othermill (Bantam Tools) in room 38-501, following the electronics production protocol established in Week 5. The milling process required careful tool selection, proper depth settings, and multiple passes for traces and isolation.
Through-hole component soldering required advanced techniques using a board stand, positioning the board vertically or horizontally depending on component location. This approach improved access to pads and ensured consistent solder joints.
Milling errors resulted in copper "hairs" creating unintended shorts between traces. I used continuity mode on a multimeter to probe for shorts and an exacto knife to carefully cut away the excess copper, restoring proper isolation between traces.
In the end, I had to isolate the common ground on the interrupt side so that RD (red LED) and IRD (infrared LED) grounding terminals are isolated from the rest of the GND plane. This isolation may be necessary for more accurate sensor readings by preventing ground loops and interference.
Network Type: Long-range wireless mesh network (LoRa)
Protocol: Meshtastic (open-source mesh networking protocol over LoRa radio)
Radio Module: Wio-SX1262 (Semtech SX1262 LoRa transceiver)
Addressing Scheme: Meshtastic node ID and user ID for device identification
The Wio-SX1262 module provides long-range, low-power wireless communication using LoRa (Long Range) spread spectrum modulation. Meshtastic runs on top of LoRa, creating a decentralized mesh network where devices can relay messages to extend range. The system uses the ESP32-S3 as the main processor, running Meshtastic firmware that manages the LoRa radio and mesh networking protocols.
The MAX30102 sensor uses optical reflection (PPG - photoplethysmography) to detect heart rate and blood oxygen levels. It integrates red (660nm) and infrared (880nm) LEDs with a photodetector to measure changes in blood volume through the skin.
The XIAO ESP32-S3 connects to the Wio-SX1262 module via SPI interface for LoRa radio control. The MAX30102 sensor connects via I²C (SDA and SCL lines) with pull-up resistors. The OLED display also connects via I²C on the same bus. Power is distributed from the ESP32-S3's 3.3V and 5V rails to all modules. The interrupt pin (INT) from MAX30102 can be connected for event-driven data acquisition, and the RD/IRD pins are isolated from the main ground plane for improved sensor accuracy.
See Network Address Tables for complete device addressing information including Node Number, User ID, and Device Name for the Meshtastic network.
Complete network addressing information for all connected devices, including MAC addresses (hardware identifiers) and IP addresses (network identifiers) for Wi-Fi-connected devices.
| Device | Component | MAC Address | Network Type | Input Device | Output Device |
|---|---|---|---|---|---|
| Player 1 | XIAO ESP32-S3 | D8:3B:DA:75:05:AC | ESP-NOW (P2P) | Touch sensors (6 pads) | OLED (SSD1306, 0x3C) |
| Player 2 | XIAO ESP32-S3 | D8:3B:DA:75:E1:9C | ESP-NOW (P2P) | Touch sensors (6 pads) | OLED (SSD1306, 0x3C) |
| Device | Component | MAC Address | IP Address | Network Type | Input Device | Output Device |
|---|---|---|---|---|---|---|
| Camera Node | XIAO ESP32-S3 Sense | [Device MAC] | 192.168.x.x (DHCP) | Wi-Fi (802.11) | Camera module, Button | OLED (SSD1306, 0x3C), HTTP Server |
| Client Device | Web Browser | [Client MAC] | 192.168.x.x (DHCP) | Wi-Fi (802.11) | N/A | Display (receives MJPEG stream) |
| Device | Component | Node Number | User ID | Device Name | Network Type | Input Device | Output Device |
|---|---|---|---|---|---|---|---|
| Invisible String Node | XIAO ESP32-S3 + Wio-SX1262 | 3665045004 | !da74260c | Meshtastic 260c | LoRa (Meshtastic) | MAX30102 Heart Rate Sensor | OLED (SSD1306, 0x3C) |
Note: MAC addresses are hardware identifiers unique to each ESP32-S3 device. IP addresses are assigned dynamically via DHCP when connecting to a Wi-Fi network. For ESP-NOW communication, only MAC addresses are used (no IP addresses required). The camera system's IP address is printed to the Serial Monitor upon Wi-Fi connection establishment. For Meshtastic networks, devices are identified by Node Number (unique identifier), User ID (hexadecimal user identifier), and Device Name (user-configurable name). The LoRa radio uses spread spectrum modulation for long-range, low-power communication without requiring IP addresses.
Send a message between two projects. This assignment demonstrates inter-project communication using wired or wireless networking protocols.
Send a message between two projects. This assignment demonstrates inter-project communication using wired or wireless networking protocols. The CircleSquareCamera Augmented Reality system extends the ESP-NOW multiplayer game from Week 2 by integrating camera boards that receive game state updates and overlay player positions on live camera feeds.
For detailed documentation of the AI-assisted development process, see AI-Assisted Camera Integration Game Update in the Ethical AI Use section.
An augmented reality system that combines the ESP-NOW multiplayer game CircleSquareShapeSongSwingalong (documented in Week 2 and Week 11 individual assignment) with camera subsystems from the final project. The system enables game boards to send player state updates via ESP-NOW to camera boards, which overlay game characters (square and circle) on live camera feeds displayed on OLED screens. Camera code development spans Week 7, Week 8, Final Project, and Week 12 (placeholder link).
Development Note: Initial implementation attempted to send camera data from camera boards to game boards. After two hours of troubleshooting communication issues, the architecture was reversed: the final system sends game state packets from game boards to camera boards via ESP-NOW. This approach proved more efficient for real-time AR overlay visualization, as game state is lightweight compared to camera frame data.
The system consists of two networked subsystems: game boards (XIAO ESP32-S3 with touch sensors and OLED displays) and camera boards (XIAO ESP32-S3 Sense with integrated cameras and OLED displays). Game boards run the CircleSquareShapeSongSwingalong multiplayer game, processing touch input, updating player physics, and broadcasting player state packets via ESP-NOW to both the other game board and all camera boards. Camera boards receive these packets, capture camera frames, process them through Floyd–Steinberg dithering for OLED display, and overlay game character positions (square for Player 1, circle for Player 2) on the live feed.
Network Type: Wireless peer-to-peer (ESP-NOW)
Protocol: ESP-NOW (Espressif's proprietary low-power wireless communication protocol)
Addressing Scheme: MAC address-based device identification for game boards and camera boards
Communication Pattern: One-to-many broadcast from game boards to peer game board and all camera boards
Game Boards: Each ESP32-S3 board connects to an OLED display via I²C (SDA pin 5, SCL pin 6) and reads touch sensor inputs from GPIO pins. ESP-NOW communication is handled through the ESP32-S3's built-in Wi-Fi radio, requiring no external hardware connections.
Camera Boards: The camera module is integrated directly on the XIAO ESP32-S3 Sense board, connected via parallel data bus (Y2-Y9), control signals (XCLK, PCLK, VSYNC, HREF), and I²C interface (SIOD, SIOC). The OLED display connects via I²C (SDA pin 5, SCL pin 6) with pull-up resistors. ESP-NOW reception uses the ESP32-S3's built-in Wi-Fi radio in receive-only mode.
Complete network addressing information for all devices in the CircleSquareCamera AR system, including MAC addresses (hardware identifiers) for ESP-NOW communication.
| Device | Component | MAC Address | Network Type | Input Device | Output Device |
|---|---|---|---|---|---|
| P1 | XIAO ESP32-S3 | D8:3B:DA:75:05:AC | ESP-NOW (P2P) | Touch sensors (6 pads) | OLED (SSD1306, 0x3C) |
| P2 | XIAO ESP32-S3 | D8:3B:DA:75:E1:9C | ESP-NOW (P2P) | Touch sensors (6 pads) | OLED (SSD1306, 0x3C) |
| Camera A | XIAO ESP32-S3 Sense | B8:F8:62:F9:E2:C0 | ESP-NOW (Receive) | Camera module, ESP-NOW packets | OLED (SSD1306, 0x3C) |
| Camera B | XIAO ESP32-S3 Sense | B8:F8:62:F9:D6:38 | ESP-NOW (Receive) | Camera module, ESP-NOW packets | OLED (SSD1306, 0x3C) |
Note: MAC addresses are hardware identifiers unique to each ESP32-S3 device. Game boards broadcast player state packets to both the peer game board and all camera boards. Camera boards operate in receive-only mode, processing incoming ESP-NOW packets to identify player positions and overlay them on camera feeds.
Complete Arduino code for game boards and camera boards, including ESP-NOW communication, camera feed processing, and AR overlay implementation.
Complete design files for networked systems including ESP-NOW multiplayer game and Wi-Fi camera streaming implementations with Arduino firmware and configuration files.
Arduino code for ESP-NOW wireless multiplayer game with MAC address-based player identification and synchronized game state management.
Arduino code for ESP32-S3 camera livestreaming over Wi-Fi using MJPEG protocol and Edge AI face detection using FOMO models from Edge Impulse.
SETUP:
1. Initialize Serial communication (115200 baud)
2. Configure camera pins (from camera_pins.h)
3. Create camera_config_t structure
4. Initialize camera with esp_camera_init()
5. Connect to Wi-Fi network
6. Start HTTP server with stream handler
STREAM_HANDLER:
1. Set HTTP response type to "multipart/x-mixed-replace"
2. Enter loop: capture frame, send via HTTP, repeat
LOOP:
- Minimal delay to allow other tasks
Arduino code for capturing camera frames and streaming them to an OLED display using Floyd–Steinberg dithering for high-quality monochrome rendering. This code demonstrates real-time image processing and display optimization for low-resolution OLED screens.
SETUP:
1. Initialize Serial communication (115200 baud)
2. Initialize I²C bus for OLED display
3. Initialize OLED display (128x64, I²C address 0x3C)
4. Configure camera pins using camera_pins.h definitions
5. Initialize camera with QQVGA resolution (160x120)
6. Set pixel format to GRAYSCALE
7. Display initialization status on OLED
LOOP:
1. Capture camera frame using esp_camera_fb_get()
2. Process frame through showDitheredPreview():
a. Downsample camera frame (160x120) to OLED resolution (128x64)
b. Average pixel values in each downsampled region
c. Store results in gray_buffer array
d. Normalize brightness values to full range
e. Apply Floyd–Steinberg dithering algorithm
f. Render dithered result to OLED display
3. Return camera frame buffer using esp_camera_fb_return()
4. Repeat continuously for live preview
DITHERING ALGORITHM (Floyd–Steinberg):
For each pixel from top-left to bottom-right:
1. Quantize current pixel (0 or 255)
2. Calculate quantization error
3. Distribute error to neighboring pixels:
- Right: 7/16 of error
- Bottom-left: 3/16 of error
- Bottom: 5/16 of error
- Bottom-right: 1/16 of error
This code provides a foundation for displaying camera feeds on OLED displays. The Floyd–Steinberg dithering algorithm distributes quantization errors across neighboring pixels, creating smooth gradients and improved visual quality compared to simple thresholding. The code uses grayscale format for efficient processing, and the downsampling step averages multiple camera pixels into each OLED pixel to maintain image clarity.
This implementation serves as a building block for the CircleSquareCamera AR system, where camera feeds are combined with game state overlays. See Ethical AI Use section for ChatGPT co-development transcript.
Complete Arduino code for the CircleSquareCamera AR system, including game board code that broadcasts player states via ESP-NOW, and camera board code that receives game packets and overlays player positions on live camera feeds.
Camera board receives ESP-NOW packets from game boards, captures camera frames, processes them through dithering, and overlays game character positions (square for P1, circle for P2) on the live feed displayed on OLED.
SETUP:
1. Initialize Serial, I²C, OLED display
2. Initialize ESP-NOW in receive-only mode
3. Register ESP-NOW receive callback
4. Initialize camera (QQVGA, GRAYSCALE)
5. Determine camera ID from MAC address (A or B)
6. Display camera ready status
ESPNOW_RECEIVE_CALLBACK:
1. Check if packet is correct size (NetPacket)
2. Extract player state from packet
3. Identify player (P1 or P2) based on sender MAC address
4. Store player state in p1 or p2 variable
5. Set gotP1 or gotP2 flag
LOOP:
1. Capture camera frame (esp_camera_fb_get)
2. Process frame through makeFrame():
a. Downsample camera (160x120) to 64x32
b. Normalize brightness
c. Apply Floyd–Steinberg dithering
d. Rotate 180° for correct orientation
3. Draw camera feed to OLED (2x2 pixel blocks)
4. Overlay game characters if received:
- Draw square at p1.x, p1.y for Player 1
- Draw circle at p2.x, p2.y for Player 2
5. Display frame on OLED
6. Return camera frame buffer
Extended version of the CircleSquareShapeSongSwingalong game that broadcasts player state packets to both peer game boards and camera boards via ESP-NOW. This enables real-time AR visualization of gameplay on camera displays.
SETUP:
1. Initialize Serial, OLED display
2. Set WiFi mode to STA
3. Read self MAC address
4. Initialize ESP-NOW
5. Identify player role (P1 or P2) from MAC address
6. Add peers: peer game board + Camera A + Camera B
7. Register ESP-NOW send/receive callbacks
8. Initialize touch sensors (warm-up readings)
9. Reset player states (left/right positioning)
LOOP:
1. Update touch sensor readings
2. Process player input (left, right, jump)
3. Update player physics (movement, gravity, collision)
4. Create NetPacket with player state and ready flag
5. Broadcast packet to all peers:
- Other game board (peerMac)
- Camera A (camA_MAC)
- Camera B (camB_MAC)
6. Render game state to OLED:
- Draw ground line
- Draw own character (square if P1, circle if P2)
- Draw other player character
- Display "Waiting Player" if other not ready
7. Delay for frame timing (30ms)
This code extends the original CircleSquareShapeSongSwingalong game by adding camera board peers to the ESP-NOW network. The game broadcasts player state packets (position, velocity, onGround flag) to enable AR overlay on camera displays. The camera boards use these packets to draw game characters at the correct positions relative to the camera feed, creating an augmented reality experience. Player identification is done via MAC address comparison, with P1 using square representation and P2 using circle representation. See Ethical AI Use section for ChatGPT co-development transcript.
Key insights and learnings from working with networking and communications protocols.
Acknowledgements and team roles for networking and communications work.
Developed CircleSquareShapeSongSwingalong multiplayer game with ESP-NOW wireless communication during Week 2. See Week 2 documentation for details.
Developed camera livestreaming and Edge AI face detection system during Week 10. See Week 10 documentation for details.
Transparent documentation of AI assistance used in this week's networking and communications work.
Used ChatGPT for collaborative development of the CircleSquareCamera augmented reality system, integrating ESP-NOW communication between game boards and camera boards. The AI assisted with ESP-NOW packet structure design, camera feed dithering algorithms, AR overlay implementation, and real-time synchronization of player states with camera displays. This extends the original CircleSquareShapeSongSwingalong multiplayer game from Week 2 with augmented reality visualization.
ChatGPT Co-Development Transcript:
Cursor AI assisted with comprehensive updates to Week 11 documentation, including ethical AI use section updates, design files documentation with pseudocode and key features, group assignment CircleSquareCamera AR section development, network address tables, and overall page organization. The AI helped refine technical content, create professional code documentation, add media captions and descriptions, and organize information for optimal readability and aesthetic presentation.
The AI was used to:
Complete AI Assistance Transcript:
Cursor AI assisted with creating the complete Week 11 documentation page, including networking protocols overview, group assignment CircleSquareCamera AR documentation, individual assignment sections summarizing ESP-NOW multiplayer game and Wi-Fi camera streaming systems, network address tables, and all formatting and styling. The AI helped refine and organize content from Week 2 and Week 10 into professional, succinct networking documentation while preserving key technical details.
The AI was used to:
Complete AI Assistance Transcript:
Cursor AI assisted with updating the Week 11 recitation notes section with comprehensive system integration content. The AI helped refine and organize raw notes from the recitation session into a well-structured, professional format with proper headings, bullet points, and external links. The updated section includes usability principles from Dr. Jan Borchers's session, failure modes analysis, testing strategies, repair considerations, lifecycle planning, and assignment details.
The AI was used to:
Complete AI Assistance Transcript:
Cursor AI assisted with comprehensive updates to the Week 11 individual assignment section, including MIT Wi-Fi connection instructions, Networked System 3 (Long Range Radio Board Design, Fabrication, and Connection to Meshtastic), and Network Address Tables. The AI helped refine technical content, organize documentation with proper structure, add detailed captions and descriptions to all images and videos, and create professional documentation following the established template format.
The AI was used to:
Complete AI Assistance Transcript:
This work is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License