https://github.com/jfjlaros/serialmux
Serial multiplexer for Arduino.
https://github.com/jfjlaros/serialmux
arduino communication multiplexer port serial virtual
Last synced: 10 months ago
JSON representation
Serial multiplexer for Arduino.
- Host: GitHub
- URL: https://github.com/jfjlaros/serialmux
- Owner: jfjlaros
- License: mit
- Created: 2021-12-24T16:47:44.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-01T17:53:51.000Z (almost 3 years ago)
- Last Synced: 2025-05-04T02:39:57.475Z (about 1 year ago)
- Topics: arduino, communication, multiplexer, port, serial, virtual
- Language: C++
- Homepage:
- Size: 85 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Serial multiplexer for Arduino
==============================
.. image:: https://img.shields.io/github/last-commit/jfjlaros/serialMux.svg
:target: https://github.com/jfjlaros/serialMux/graphs/commit-activity
.. image:: https://github.com/jfjlaros/serialMux/actions/workflows/arduino-package.yml/badge.svg
:target: https://github.com/jfjlaros/serialMux/actions/workflows/arduino-package.yml
.. image:: https://readthedocs.org/projects/serialmux/badge/?version=latest
:target: https://serialMux.readthedocs.io/en/latest
.. image:: https://img.shields.io/github/release-date/jfjlaros/serialMux.svg
:target: https://github.com/jfjlaros/serialMux/releases
.. image:: https://img.shields.io/github/release/jfjlaros/serialMux.svg
:target: https://github.com/jfjlaros/serialMux/releases
.. image:: https://www.ardu-badge.com/badge/serialMux.svg
:target: https://www.ardu-badge.com/serialMux
.. image:: https://img.shields.io/github/languages/code-size/jfjlaros/serialMux.svg
:target: https://github.com/jfjlaros/serialMux
.. image:: https://img.shields.io/github/languages/count/jfjlaros/serialMux.svg
:target: https://github.com/jfjlaros/serialMux
.. image:: https://img.shields.io/github/languages/top/jfjlaros/serialMux.svg
:target: https://github.com/jfjlaros/serialMux
.. image:: https://img.shields.io/github/license/jfjlaros/serialMux.svg
:target: https://raw.githubusercontent.com/jfjlaros/serialMux/master/LICENSE.md
----
This library provides a simple way to create multiple virtual serial devices
that communicate over one physical serial connection. A virtual device can be
used as a drop-in replacement for ``Stream`` like objects such as ``Serial``.
A service is needed on the host for multiplexing and demultiplexing and to
create virtual ports. A Python client_ for Linux is provided as a reference
implementation.
Please see ReadTheDocs_ for the latest documentation.
Quick start
-----------
Create multiple virtual serial devices and use them like the standard
``Serial`` object.
.. code-block:: cpp
#include
SerialMux mux(Serial);
VSerial serialA(mux);
VSerial serialB(mux);
void setup() {
Serial.begin(9600);
}
void loop() {
serialA.println("Virtual device A.");
serialB.println("Virtual device B.");
delay(1000);
}
On the host, two virtual ports are created, e.g., ``/dev/pts/8`` and
``/dev/pts/9``. When we connect to one of these ports, we only see the
messages that are sent to that port.
::
$ picocom -q /dev/pts/8
Virtual device A.
Virtual device A.
.. _ReadTheDocs: https://serialmux.readthedocs.io
.. _client: https://arduino-serial-mux.readthedocs.io