Overview
The lighty-netconf-device library is a fully programmable NETCONF communication stack that can be integrated with hardware to achieve interoperability with lighty.io NETCONF–RESTCONF controllers. It implements a server for RFC 6241 and provides related services like Datastore, RPC handling, and NETCONF protocol operations.
In this use case, we deploy it on a Raspberry Pi 3 (Broadcom ARM v7 BCM2835 SoC) to control physical I/O — LEDs, a temperature sensor, humidity sensor, and atmospheric pressure sensor — all through a custom YANG model.
The YANG Model
module rpi-device {
yang-version 1.1;
namespace "urn:tech.pantheon.netconfdevice.rpid";
prefix "dc";
organization "Pantheon Technologies";
grouping led-data {
leaf led-id {
type int8 { range "0..3"; }
}
leaf led-status {
type boolean;
description "LED port status: true=high/on, false=low/off.";
}
}
container RpiDevice {
leaf device-name { type string; }
leaf temperature {
type decimal64 { fraction-digits 3; range "-200..200"; }
config false;
description "Ambient temperature in Celsius [C].";
}
leaf relative-humidity {
type decimal64 { fraction-digits 3; range "0..100"; }
config false;
description "Ambient relative humidity [%].";
}
leaf atmospheric-pressure {
type decimal64 { fraction-digits 3; range "0..1000000"; }
config false;
description "Atmospheric Pressure in pascals [Pa].";
}
list led-indicators {
config false;
key "led-id";
uses led-data;
}
}
rpc set-led {
description "Set LED port status high/on or low/off.";
input { uses led-data; }
output { uses led-data; }
}
}
SDN Controller Setup
Use lighty-netconf-restconf-app as the SDN controller. It uses OpenDaylight core components, the NETCONF southbound plugin, and PANTHEON's RESTCONF RFC 8040 implementation as the northbound plugin.
Step 1: Connect the Raspberry Pi Device
POST https://localhost:8888/restconf/data/network-topology:network-topology/topology=topology-netconf
{
"netconf-topology:node": [{
"node-id": "rpi-device",
"host": "192.68.0.102",
"port": 17830,
"username": "admin",
"password": "admin",
"tcp-only": false,
"keepalive-delay": 0,
"netconf-node-configuration:schemaless": false
}]
}
→ reply 201 Created
Step 2: Read Device State
GET https://localhost:8888/restconf/data/network-topology:network-topology/topology=topology-netconf?content=nonconfig
This returns the operational state of the connected device, including current sensor readings.
Step 3: Toggle an LED via RPC
POST https://localhost:8888/restconf/operations/network-topology:network-topology/topology=topology-netconf/node=rpi-device/yang-ext:mount/rpi-device:set-led
{
"input": {
"led-id": 0,
"led-status": true
}
}
→ reply 200:
{
"output": {
"led-status": true,
"led-id": 0
}
}
What the lighty-netconf-device Library Provides
- RFC 6241 NETCONF server implementation
- Datastore — configuration and operational data stores
- RPC handling — register custom RPCs backed by your hardware logic
- NETCONF protocol operations — get, get-config, edit-config, lock, unlock, etc.
- Runs on any Java SE platform — including ARM devices like Raspberry Pi
Architecture Summary
The complete stack from hardware to management:
- Raspberry Pi — runs
lighty-netconf-device, exposes NETCONF on port 17830 - lighty.io SDN Controller — connects to the Pi via NETCONF southbound, exposes RESTCONF northbound
- Management client — any HTTP client (curl, Postman, your own app) uses RESTCONF to manage the device