Skip to content

[eppp-link]: Support for channels #814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/eppp_link/.cz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ commitizen:
bump_message: 'bump(eppp): $current_version -> $new_version'
pre_bump_hooks: python ../../ci/changelog.py eppp_link
tag_format: eppp-v$version
version: 0.3.1
version: 1.0.0
version_files:
- idf_component.yml
6 changes: 6 additions & 0 deletions components/eppp_link/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [1.0.0](https://github.com/espressif/esp-protocols/commits/eppp-v1.0.0)

### Features

- Add support for custom channels ([4ee9360f](https://github.com/espressif/esp-protocols/commit/4ee9360f))

## [0.3.1](https://github.com/espressif/esp-protocols/commits/eppp-v0.3.1)

### Bug Fixes
Expand Down
17 changes: 17 additions & 0 deletions components/eppp_link/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,21 @@ menu "eppp_link"
default "06:00:00:00:00:02"
depends on EPPP_LINK_DEVICE_ETH

config EPPP_LINK_CHANNELS_SUPPORT
bool "Enable channel support (multiple logical channels)"
default n
depends on !EPPP_LINK_DEVICE_ETH
help
Enable support for multiple logical channels in the EPPP link layer.
When enabled, you can configure the number of channels used for communication.

config EPPP_LINK_NR_OF_CHANNELS
int "Number of logical channels"
depends on EPPP_LINK_CHANNELS_SUPPORT && !EPPP_LINK_DEVICE_ETH
range 1 8
default 2
help
Set the number of logical channels for EPPP link communication.
Each channel can be used for independent data streams.

endmenu
34 changes: 33 additions & 1 deletion components/eppp_link/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ESP PPP Link component (eppp_link)

The component provides a general purpose connectivity engine between two microcontrollers, one acting as PPP server, the other one as PPP client.
This component could be used for extending network using physical serial connection. Applications could vary from providing PRC engine for multiprocessor solutions to serial connection to POSIX machine. This uses a standard PPP protocol (if enabled) to negotiate IP addresses and networking, so standard PPP toolset could be used, e.g. a `pppd` service on linux. Typical application is a WiFi connectivity provider for chips that do not have WiFi.
This component could be used for extending network using physical serial connection. Applications could vary from providing RPC engine for multiprocessor solutions to serial connection to POSIX machine. This uses a standard PPP protocol (if enabled) to negotiate IP addresses and networking, so standard PPP toolset could be used, e.g. a `pppd` service on linux. Typical application is a WiFi connectivity provider for chips that do not have WiFi.
Uses simplified TUN network interface by default to enable faster data transfer on non-UART transports.

## Typical application
Expand All @@ -21,6 +21,27 @@ brings in the WiFi connectivity from the communication coprocessor.
+----------------+ +----------------+
```

## Features

### Network Interface Modes

Standard PPP Mode (where PPP protocols is preferred) or simple tunnel using TUN Mode.

### Transport layer

UART, SPI, SDIO, Ethernet

### Support for logical channels

Allows channeling custom data (e.g. 802.11 frames)

## (Other) usecases

Besides the communication coprocessor example mentioned above, this component could be used to:
* Bring Wi-Fi connectivity to a computer using ESP32 chip.
* Connect your microcontroller to the internet via a pppd server (running on a raspberry)
* Bridging two networks with two microcontrollers

## Configuration

### Choose the transport layer
Expand All @@ -39,6 +60,14 @@ Use `idf.py menuconfig` to select the transport layer:

Use PPP netif for UART; Keep the default (TUN) for others

### Channel support (multiple logical channels)

* `CONFIG_EPPP_LINK_CHANNELS_SUPPORT` -- Enable support for multiple logical channels (default: disabled)
* `CONFIG_EPPP_LINK_NR_OF_CHANNELS` -- Number of logical channels (default: 2, range: 1-8, only visible if channel support is enabled)

When channel support is enabled, the EPPP link can multiplex multiple logical data streams over the same transport. The number of channels is configurable. Channel support is not available for Ethernet transport.

To use channels in your application, use the `eppp_add_channels()` API and provide your own channel transmit/receive callbacks. These APIs and related types are only available when channel support is enabled in Kconfig.

## API

Expand All @@ -57,6 +86,9 @@ Use PPP netif for UART; Keep the default (TUN) for others
* `eppp_netif_start()` -- Starts the network, could be called after startup or whenever a connection is lost
* `eppp_netif_stop()` -- Stops the network
* `eppp_perform()` -- Perform one iteration of the PPP task (need to be called regularly in task-less configuration)
#ifdef CONFIG_EPPP_LINK_CHANNELS_SUPPORT
* `eppp_add_channels()` -- Register channel transmit/receive callbacks (only available if channel support is enabled)
#endif

## Throughput

Expand Down
Loading