https://github.com/chon-group/serialportemulator
A Linux kernel module for serial device emulation
https://github.com/chon-group/serialportemulator
emulator kernel serial serial-communication serial-port
Last synced: 3 months ago
JSON representation
A Linux kernel module for serial device emulation
- Host: GitHub
- URL: https://github.com/chon-group/serialportemulator
- Owner: chon-group
- License: cc-by-4.0
- Created: 2022-09-25T15:46:19.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-17T18:13:29.000Z (4 months ago)
- Last Synced: 2025-02-17T18:38:00.064Z (4 months ago)
- Topics: emulator, kernel, serial, serial-communication, serial-port
- Language: C
- Homepage:
- Size: 225 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SerialPortEmulator
||
|:-:|
|This is a serial port emulator. This is done by creating pairs of ports on ___/dev/___ where writing data on one port can be read on the pair and vice-versa.|## Installation
1) Install the dependencies. On your Debian-like Linux machine, run:
```
sudo apt update
sudo apt install linux-headers-`uname -r` gcc binutils make git
```2) Inside the driver folder, run:
```
sudo git -C /opt clone https://github.com/chon-group/SerialPortEmulator.git
cd /opt/SerialPortEmulator/driver
sudo make clean all
sudo make modules_install
sudo make install
```3) Set read and write permissions on the pairs of devices to be used
Example: for the EmulatedPort 0 device:
```
sudo chmod 777 /dev/ttyEmulatedPort0
sudo chmod 777 /dev/ttyExogenous0
```## Uninstallation
Inside the 'driver' folder, run:
```
cd /opt/SerialPortEmulator/driver
sudo make uninstall
cd ~
sudo rm -rf /opt/SerialPortEmulator
```## Use
After the installation, by default, it will be instantiated on /dev many pairs of devices:
- /dev/ttyEmulatedPort0 <---> /dev/ttyExogenous0
- /dev/ttyEmulatedPort1 <---> /dev/ttyExogenous1
...And so on. Writing on one device will make its content ready to be read on the other pair, and vice-versa.
You MUST at least open the other pair port to start sending data to it.
## Example
In a terminal window, execute the command below to put the emulated port waiting for incoming dataOpen another terminal window and run the below command. On the first terminal Window. It should appear the message.

## Copyright
It is licensed under a Creative Commons Attribution 4.0 International License. The licensor cannot revoke these freedoms as long as you follow the license terms:* __Attribution__ — You must give __appropriate credit__ like below:
FREITAS, Bruno Policarpo Toledo; LAZARIN, Nilson Mori; PANTOJA, Carlos Eduardo. Uma Proposta de Emulador de Portas Seriais para Sistemas Multiagentes Embarcados. In: WORKSHOP-SCHOOL ON AGENTS, ENVIRONMENTS, AND APPLICATIONS (WESAAC), 17. , 2023, Pelotas/RS. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2023 . p. 55-66. ISSN 2326-5434. URL: https://sol.sbc.org.br/index.php/wesaac/article/view/33437
Cite using Bibtex
```
@inproceedings{wesaac,
author = {Bruno Freitas and Nilson Lazarin and Carlos Pantoja},
title = {Uma Proposta de Emulador de Portas Seriais para Sistemas Multiagentes Embarcados},
booktitle = {Proceedings of the 17th Workshop-School on Agents, Environments, and Applications},
location = {Pelotas/RS},
year = {2023},
keywords = {},
issn = {2326-5434},
pages = {55--66},
publisher = {SBC},
address = {Porto Alegre, RS, Brasil},
url = {https://sol.sbc.org.br/index.php/wesaac/article/view/33437}
}```