{"id":15036582,"url":"https://github.com/apple/swift-matter-examples","last_synced_at":"2025-05-16T08:03:25.739Z","repository":{"id":243905581,"uuid":"798512546","full_name":"apple/swift-matter-examples","owner":"apple","description":"An Embedded Swift Matter application running on ESP32-C6","archived":false,"fork":false,"pushed_at":"2025-04-23T16:34:44.000Z","size":17757,"stargazers_count":323,"open_issues_count":8,"forks_count":31,"subscribers_count":107,"default_branch":"main","last_synced_at":"2025-05-03T20:02:46.499Z","etag":null,"topics":["embedded","esp32","example","homekit","matter","swift"],"latest_commit_sha":null,"homepage":"https://apple.github.io/swift-matter-examples/tutorials/tutorial-table-of-contents/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apple.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-09T23:38:41.000Z","updated_at":"2025-04-30T20:27:49.000Z","dependencies_parsed_at":"2024-11-14T22:36:32.372Z","dependency_job_id":"fe99ec45-6f42-4f5f-a01d-8703c4640415","html_url":"https://github.com/apple/swift-matter-examples","commit_stats":null,"previous_names":["apple/swift-matter-examples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fswift-matter-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fswift-matter-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fswift-matter-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fswift-matter-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apple","download_url":"https://codeload.github.com/apple/swift-matter-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493381,"owners_count":22080126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","esp32","example","homekit","matter","swift"],"created_at":"2024-09-24T20:31:37.247Z","updated_at":"2025-05-16T08:03:25.732Z","avatar_url":"https://github.com/apple.png","language":"Swift","readme":"# Swift Matter Examples\n\nBuild a Matter accessory using Embedded Swift\n\n## Overview\n\n\u003c!-- Image --\u003e\n\nThis repository contains an example simple Embedded Swift application that implements a Matter smart light accessory and can be used from HomeKit. The examples use an ESP32-C6 or ESP32-C3 (RISC-V) microcontroller and build on top of the ESP-IDF and ESP-Matter SDKs.\n\n\u003e [!NOTE]\n\u003e This repository is associated with WWDC24 session 10197: [Go small with Embedded Swift](https://developer.apple.com/wwdc24/10197).\n\n#### Embedded Swift\n\nEmbedded Swift is a subset of Swift designed for constrained environments, such as embedded devices, kernel code, and other low-level systems. It includes most Swift language features, like generics, value and reference types, optionals, error handling, and more. Embedded Swift introduces the safety and expressivity of Swift to environments usually dominated by C or C++ code. To learn more, see [A Vision for Embedded Swift](https://github.com/apple/swift-evolution/blob/main/visions/embedded-swift.md).\n\n#### Matter\n\nMatter is an open standard for building smart home accessories, supported natively by many smart home ecosystems such as HomeKit. For more information about Matter, see the [Matter documentation](https://project-chip.github.io/connectedhomeip-doc/index.html).\n\n#### Additional Resources\n\n- [Embedded Swift User Manual](https://github.com/apple/swift/blob/main/docs/EmbeddedSwift/UserManual.md)\n- [More Embedded Swift Example Projects](https://github.com/apple/swift-embedded-examples)\n- [Swift Forums Embedded Discussion](https://forums.swift.org/c/development/embedded/107)\n\n## Getting Started\n\n### Documentation\n\nFor comprehensive tutorials with detailed instructions, please refer to the [**project documentation**](https://apple.github.io/swift-matter-examples/tutorials/tutorial-table-of-contents).\n\n### Requirements\n\nBefore running the examples, ensure you have the following tools available:\n\n- Hardware:\n  - [ESP32-C6-DevKitC-1-N8](https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/user_guide.html)\n- Software\n  - [Swift Nightly Toolchain](https://www.swift.org/download)\n  - [CMake 3.29+](https://cmake.org/download)\n  - [ESP-IDF v5.4.1](https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32c6/get-started/index.html)\n  - [ESP-Matter SDK 1.2](https://docs.espressif.com/projects/esp-matter/en/latest/esp32c6/introduction.html)\n\n\u003e [!IMPORTANT]\n\u003e The examples are designed for an Espressif C6 Development Kit from both macOS and Linux host systems. Other configurations may work, but have not been tested.\n\n### Quick Start Guide\n\n\u003e [!IMPORTANT]\n\u003e We highly recommend following the provided [tutorials](https://apple.github.io/swift-matter-examples/tutorials/tutorial-table-of-contents).\n\nEnsure your shell has access to the tools listed above, see [Get started on macOS](https://apple.github.io/swift-matter-examples/tutorials/swiftmatterexamples/setup-macos) or [Get started on Linux with Docker](https://apple.github.io/swift-matter-examples/tutorials/swiftmatterexamples/setup-docker) for additional setup instructions.\n\n1. Clone the repository and navigate to one of the examples.\n  ```shell\n  $ git clone https://github.com/apple/swift-matter-examples.git\n  $ cd swift-matter-examples/smart-light\n  ```\n\n2. Configure the build system for your microcontroller, the `smart-light` example should also be runnable on `esp32c3`.\n  ```shell\n  $ idf.py set-target esp32c6\n  ```\n\n3. Build and deploy the application to your device.\n  ```shell\n  $ idf.py build flash monitor\n  ```\n\nExplore the implementation, see [Explore the LED Blink example](https://apple.github.io/swift-matter-examples/tutorials/swiftmatterexamples/run-example-led-blink#Understand-the-code) and\n[Explore the Smart Light example](https://apple.github.io/swift-matter-examples/tutorials/swiftmatterexamples/run-example-smart-light#Understand-the-code) for guided walkthroughs.\n\n## Contributing to Swift Matter Examples\n\nThis repo is intended to demonstrate use of Embedded Swift for different applications, using Matter as an example. PRs demonstrating ways to adapt Swift's language or tooling to this application are welcome. It is not intended to be a full-featured Matter SDK so please do not raise PRs to extend the Matter Swift overlay to new areas.\n\n### Code of Conduct\n\nLike all Swift.org projects, we would like these Embedded Swift example projects to foster a diverse and friendly community. We expect contributors to adhere to the [Swift.org Code of Conduct](https://swift.org/code-of-conduct).\n\n### Contact information\n\nThe current code owners of this repository are Kuba Mracek ([@kubamracek](https://github.com/kubamracek)), Rauhul Varma ([@rauhul](https://github.com/rauhul)), and Philippe Hausler (https://github.com/phausler). You can contact them on the Swift forums via the handles [@kubamracek](https://forums.swift.org/u/kubamracek/summary), [@rauhul](https://forums.swift.org/u/rauhul/summary), and [@Philippe_Hausler](https://forums.swift.org/u/philippe_hausler/summary).\n\nIn case of moderation issues, you can also directly contact a member of the [Swift Core Team](https://swift.org/community/#community-structure).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapple%2Fswift-matter-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapple%2Fswift-matter-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapple%2Fswift-matter-examples/lists"}