# [Device-to-Device communication with Device Connect](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/device-connect-d2d/)

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/device-connect-d2d/)
- [Why device-to-device at the edge](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/device-connect-d2d/background/)
- [Device Connect developer model](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/device-connect-d2d/overview/)
- [Set up D2D communication between a sensor and a monitor](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/device-connect-d2d/d2d-setup/)
- [Next Steps](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/device-connect-d2d/_next-steps/)

## About this Learning Path

| Skill level:          | Introductory          |
|-----------------------|-----------------------|
| Reading time:         | 25 min                |
| Last updated:         | 08 Jul 2026           |

| Authors:              |
|-----------------------|
| - Kavya Sri Chennoju, Arm [GitHub](https://github.com/kavya-chennoju) [LinkedIn](https://linkedin.com/in/kavya-sri-chennoju)   |
| - Annie Tallund, Arm [GitHub](https://github.com/annietllnd) [LinkedIn](https://linkedin.com/in/annietallund)                |

| Arm IP:              |
|-----------------------|
| [Cortex-A](https://support.arm.com/?tab=compute-ip&Product%20Type=Application%20Processors) |

| Tags:                |
|----------------------|
| - [Libraries](https://learn.arm.com/tag/libraries) |
| - [Linux](https://learn.arm.com/tag/linux)         |
| - [macOS](https://learn.arm.com/tag/macos)         |
| - [Windows](https://learn.arm.com/tag/windows)     |
| - [Python](https://learn.arm.com/tag/python)       |

### Who is this for?
This is an introductory topic for developers wiring up heterogeneous edge fleets, where devices need a shared way to find each other and a shared way to be controlled by agents. Device Connect provides this communication protocol between agents and devices, and standardizes how devices from different vendors advertise themselves and exchange structured messages, so both peer devices and AI agents can discover and invoke them through the same driver model. You'll use a Raspberry Pi 5 as the example primary edge device, but the same flow works with another device or with your development machine acting as a simulated device.

### What will you learn?
Upon completion of this Learning Path, you will be able to:
- Understand Device Connect Edge SDK primitives
- Set up a Python environment for Device Connect on an example edge device and a development machine
- Build two device runtimes, with the primary sensor runtime shown on a Raspberry Pi 5
- Use the Device Connect agent tools to discover both devices on the mesh and invoke their RPCs

### Prerequisites
Before starting, you will need the following:
- Basic familiarity with Python and the command line
- A Raspberry Pi 5, another Linux device, or your development machine to use as the example primary device
- A development machine on the same local network if you run the example across two machines

### Summary
You’ll build two Python-based device runtimes with the Device Connect Edge SDK and wire them into a local device-to-device workflow without cloud infrastructure. First, you’ll define device behavior by subclassing `DeviceDriver`, annotating methods with SDK decorators, and bringing the driver online with `DeviceRuntime`. A Raspberry Pi 5 acts as the primary sensor device publishing temperature and humidity, while a threshold monitor on a development machine subscribes to those readings and raises an alert when a limit is crossed. Using Device Connect agent tools, you’ll discover both devices on the mesh, verify pub/sub traffic, and invoke exposed RPCs to confirm the runtimes are visible and controllable end to end.

### Frequently asked questions

#### How do I know both runtimes joined the same mesh?
Use the Device Connect agent tools to discover devices on the mesh. You’ll see both the sensor and the monitor listed, and the monitor should receive the sensor’s periodic readings.

#### Can I run the example without a Raspberry Pi 5?
Yes. The same flow works with another device or with your development machine acting as a simulated device.

#### Which parts of the Device Connect Edge SDK do I implement to describe a device?
Subclass `DeviceDriver` and annotate its methods and properties with the SDK’s decorators. Start a `DeviceRuntime` to bring the driver online for discovery, pub/sub, and RPC.

#### What result should I expect from the threshold monitor when everything is working?
The monitor subscribes to the sensor’s temperature and humidity readings and raises an alert when the temperature crosses the configured threshold.

#### What should I check if devices aren't discovering each other or RPC calls fail?
Confirm both runtimes are running on the same local network and that the agent tools can list each device. Verify the Python environments are set up as shown and that each runtime started without errors.
