---
title: "Simple Web Camera"
url: "https://maker.wiznet.io/matthew/projects/simple-web-camera/"
markdown_url: "https://maker.wiznet.io/matthew/projects/simple-web-camera/md"
type: "UCC: User Created Content"
author: "yukinco"
author_url: "https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/#c_827675e7-29d0-43dd-b96f-aeb797be8448"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "yukinco"
original_url: "https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/#c_827675e7-29d0-43dd-b96f-aeb797be8448"
published: "2025-10-28"
language: "en"
likes: 0
views: 751
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Simple Web Camera

> Spresense + W5500 minimal web-camera: SPI5 setup, EEPROM MAC, static IP web server that returns a JPEG snapshot via HTTP. Curated from elchika.

Original author: yukinco (source: https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/#c_827675e7-29d0-43dd-b96f-aeb797be8448)

## Article

*(Curated from elchika, Japanese / Author: **yukinco**)*

## Overview

This tutorial combines a **Sony Spresense Main Board**, **HDR Camera Board**, and a **W5500 Ethernet add-on** to build a minimal **web camera** that serves a single **JPEG snapshot** to any browser. The sketch initializes camera and Ethernet, reads a MAC address from the add-on board’s EEPROM, brings the link up, and returns a `Content-Type: image/jpeg` response from an HTTP server bound to `**192.168.1.240**`. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

---

## Original Language & Author

Originally published in **Japanese** on **elchika** (Jan 2, 2024), this article by **yukinco** focuses on *reproducibility*: it shows the exact parts stack, the **SPI5** requirement for Spresense add-ons, and practical code for reset/CS control and MAC loading. Japanese readers can verify parts and wiring easily; this English curation preserves the concrete identifiers so global readers can reproduce the same results. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

---

## Key Highlights

**Hardware & Wiring**

Parts: **Spresense Main Board**, **HDR Camera Board**, **W5500-Ether add-on**. The W5500 add-on from Crane Electronics documents the onboard **24C64 EEPROM (I²C **`**0x57**`**)** storing the MAC (Rev.2), and shows how **SJ1/SJ2 jumpers** affect RESET and **CS** pin choices—useful when matching code to board revision. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**SPI5 declare + Ethernet init**

Spresense add-on SPI is **SPI5**, so the sketch defines `#define USE_SPRESENSE_SPI5` (used inside the Ethernet library).

The example **toggles RESET on D21**, then sets **CS via **`**Ethernet.init(19)**` before starting the stack. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**MAC from EEPROM**

The code scans I²C devices, initializes **M24C64 at **`**0x57**`, and reads **six MAC bytes** for `Ethernet.begin(mac, ip)`. (Rev.1 boards lack stored MAC; Rev.2 stores it in EEPROM—see vendor notes.) ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**Camera pipeline & HTTP snapshot**

The sketch initializes the camera, **starts streaming**, sets **White Balance: Daylight**, and configures **Still: QQVGA / JPG**.

On HTTP request, it calls `theCamera.takePicture()` and writes the buffer directly to the client with headers (`200 OK`, `image/jpeg`). ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**Link-up checks & robustness**

It verifies Ethernet hardware presence and **waits for link** stability before serving. This increases first-run success on wired networks. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

---

## Why It Matters (Curator’s take)

**Fast on-ramp to networked imaging**: A *single-file*, working example that covers camera bring-up, MAC handling, and HTTP response—perfect as a teaching scaffold or demo baseline. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**Spresense-specific know-how**: Captures the non-obvious bits—**SPI5**, board **RESET/CS** handling, and **EEPROM MAC**—that often block first-time success. Vendor docs back the hardware nuances. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**Clear path to extensions**: From a single JPEG snapshot, it’s straightforward to add **DHCP/mDNS**, **auth**, or move to **MJPEG streaming** via `multipart/x-mixed-replace`. The code already demonstrates the core capture loop and headers. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

---

## Quick Reproduce (Checklist)

**Assemble hardware**: Spresense Main + HDR Camera + W5500-Ether (confirm jumper settings per board rev). ([株式会社クレイン電子](https://crane-elec.co.jp/products/vol-20/))

**Firmware essentials**:

`#define USE_SPRESENSE_SPI5`

Toggle **RESET (D21)**; set **CS** via `Ethernet.init(19)` (or per your jumper config)

Read MAC from **EEPROM **`**0x57**` → `Ethernet.begin(mac, ip)` (default `192.168.1.240`) ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**Camera setup**: `theCamera.begin()` → `startStreaming(true)` → **Daylight WB** → **Still QQVGA/JPG**. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**Test**: Browse to `http://192.168.1.240/` → you should receive a JPEG snapshot. Wait for link-up logs if needed. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**Ops tips**: Avoid static-IP conflicts (consider DHCP), open port 80 on your LAN, and avoid exposing the unauthenticated endpoint to the public internet.

---

## References

**Original (Japanese)**: elchika — *Simple Web Camera* (by **yukinco**, 2024-01-02). ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**W5500-Ether Add-on (Crane Electronics)**: EEPROM/MAC (`0x57`), jumper-dependent RESET & CS notes, library guidance. ([株式会社クレイン電子](https://crane-elec.co.jp/products/vol-20/))

**Spresense Camera Library Guide (Sony)**: Overview of `theCamera` and JPEG capture. ([developer.sony.com](https://developer.sony.com/spresense/development-guides/arduino_developer_guide_en?utm_source=chatgpt.com))

## Overview

이 튜토리얼은 **Sony Spresense Main Board**와 **HDR Camera Board**, 그리고 **W5500 Ethernet 확장보드**를 이용해, 브라우저에서 접속하면 즉시 **JPEG 스냅샷을 반환하는 웹 카메라**를 구현한 실습입니다. 기본 IP를 `192.168.1.240`으로 설정하고, HTTP 요청이 들어오면 카메라로 촬영한 이미지를 `Content-Type: image/jpeg`로 응답합니다. 하드웨어 초기화(카메라·이더넷), SPI5 사용 선언, EEPROM에서 MAC 읽기, 링크 업 등 **실전 배선/펌웨어 포인트**를 모두 담은 “최소구성” 예제입니다. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

---

## Original Language & Author

원문은 **일본어(Japanese)**로, **elchika**에 2024-01-02 게시되었습니다. 저자 **yukinco**는 Spresense 생태계 부품(HDR Camera, W5500 Ether 보드)을 조합해 **작동 재현성**을 우선으로 한 간결한 예제를 제시합니다. 일본어 UI/부품명과 현지 보드(크레인전자) 문서 링크를 그대로 활용하므로 **일본 메이커의 검증**이 특히 쉽고, 본 큐레이션을 통해 글로벌 독자도 **영문으로 동일 절차를 재현**할 수 있습니다. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

---

## Key Highlights

**부품 & 배선**

보드: **Spresense Main Board**, **HDR Camera Board**, **W5500-Ether 확장보드**. 배선은 사진대로 스택 결합합니다. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

크레인전자 문서: W5500-Ether 보드의 **EEPROM(24C64, I2C 0x57, Rev.2)**, **점퍼(SJ1/SJ2)와 리셋·CS 핀 차이** 등 하드웨어 스펙 및 초기화 차이를 확인할 수 있습니다. ([株式会社クレイン電子](https://crane-elec.co.jp/products/vol-20/))

**SPI5 선언 & 이더넷 초기화**

Spresense 애드온 보드의 SPI는 **SPI5**이므로 `#define USE_SPRESENSE_SPI5` 선언이 필요(라이브러리 socket.cpp에서 사용). ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**W5500 리셋 & CS 설정**: D21 리셋 토글 후, `Ethernet.init(19)`로 **W5500 CS**를 지정합니다. (보드 리비전/점퍼에 따라 변경될 수 있음) ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**MAC 주소: EEPROM에서 읽기**

`M24C64`(I2C 0x57)에서 **MAC 주소를 읽어** `Ethernet.begin(mac, ip)`에 사용합니다. Rev.1/Rev.2에 따른 차이는 제조사 문서를 참고. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**카메라 설정 & 촬영**

카메라 초기화 → 스트리밍 시작 → **화이트밸런스: Daylight** → **스틸 사진 포맷: QQVGA(JPG)** 설정. 요청 수신 시 `theCamera.takePicture()`로 버퍼/크기를 얻어 바로 전송합니다. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**HTTP 스냅샷 서버(포트 80)**

클라이언트 접속 감지 → 헤더 전송(`200 OK`, `Content-Type: image/jpeg`) → **단일 JPEG 프레임**을 송신 후 연결 종료. **링크 업 안정화 대기**와 **하드웨어 존재 확인** 로직도 포함돼 실사용에 안전합니다. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

---

## Why It Matters (전문 큐레이터 시각)

**진입장벽↓: “한 장짜리” 웹캠**
HTTP 서버, JPEG 캡처, 이더넷 초기화까지 **한 파일에 집약**된 “작동 예제”라서, 네트워킹 카메라의 핵심 흐름을 빠르게 체득할 수 있습니다. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**Spresense 고유 포인트 학습SPI5 경로** 선언, **전용 CS/리셋 핀**(점퍼 의존), **EEPROM 기반 MAC 로딩** 등 Spresense + W5500 조합에서 흔히 막히는 지점들을 코드로 확인합니다. (제조사 문서로 하드웨어 차이까지 추적 가능) ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**확장 아이디어의 발판**
현재는 **정적 스냅샷**이지만, `multipart/x-mixed-replace`로 **MJPEG 스트리밍**을 구현하거나, **DHCP/MDNS**, **권한/토큰 기반 접근제어**, **해상도·화이트밸런스 동적 변경** 등 실전 과제로 자연스럽게 확장 가능합니다. (현 코드는 정적 IP·무인증 구조이므로 보안/운영 환경에 맞게 보완 필요) ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

---

## Quick Reproduce (Checklist)

**하드웨어 조립**: Spresense Main + HDR Camera + W5500-Ether(점퍼 상태 확인). ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**펌웨어 핵심 설정**

`#define USE_SPRESENSE_SPI5` 추가

W5500 리셋(D21) 토글 → `Ethernet.init(19)`로 CS 지정(점퍼에 따라 변경 가능)

EEPROM(0x57)에서 MAC 읽기 → `Ethernet.begin(mac, ip)` (기본 IP `192.168.1.240`) ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**카메라 파이프라인**

`theCamera.begin()` → `startStreaming(true)` → **WB Daylight** → **Still: QQVGA/JPG** 설정 후 요청 시 `takePicture()`로 응답. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**테스트**: 브라우저에서 `http://192.168.1.240/` 접속 → JPEG 스냅샷 표시. 링크 업이 뜰 때까지 대기 로그 확인. ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**운영 팁**: 내부망 IP 충돌 방지(정적 IP → DHCP 전환 고려), 방화벽 포트 80 허용, 무인증 공개망 노출 금지.

---

## References

**Original (Japanese)**: elchika — *Simple Web Camera* (by **yukinco**, 2024-01-02) ([elchika](https://elchika.com/article/90c59438-e398-4663-8ec9-753306c64a32/))

**W5500-Ether Board (Crane Electronics)**: EEPROM/MAC(0x57), 점퍼-핀 차이, 라이브러리 안내 ([株式会社クレイン電子](https://crane-elec.co.jp/products/vol-20/))

---

Source: https://maker.wiznet.io/matthew/projects/simple-web-camera/
