Bridge Serial-Ports over network
https://stackoverflow.com/questions/29207980/bridge-serial-ports-over-network
For an application, which uses SerialPorts for communication (Modbus RTU, to be exactly) I need to bridge the SerialPort over the network for testing purposes.
So I would like to have the following Setup:
Device | Network | PC
SerialPort |------------------| SerialPort
Map Serialport| | Map network to Serialport
to Network | |
I already got the first part working with socat
.
I opened the TCP Port on PC with
nc -l 8080
On my Device I used
socat pty,link=/dev/virtualcom0 tcp:PC-IP:8080
To map everything written on /dev/virtualcom0
to PC-IP on port 8080.
But now I have problems to map the socket back to a Serialport.
socat tcp:PC-IP:9123 pty,link=/dev/virtualport0
This got me a Connection Refused
, which is obvious because i used TCP and the Port is already used by the Device.
So I tried the same with
socat pty,link=/dev/virtualcom0,raw udp:PC-IP:8080
and changed everything else to UDP, too.
But then nothing arrives on my /dev/virtlalcom0/
on my PC.
One side of the tcp connection needs to be listening on the port (the first one you launch), and the second side connects to it.
For the first side do:
socat tcp-listen:8080 pty,link=/dev/virtualport0
And for the second side do:
socat pty,link=/dev/virtualcom0 tcp:IP-of-other-machine:8080
Forget the netcat, you do not need it.
Bridge Serial-Ports over network的更多相关文章
- Using Virtual Serial Ports on Linux (Ubuntu)
http://www.xappsoftware.com/wordpress/2013/10/07/using-virtual-serial-ports-on-linux-ubuntu/?goback= ...
- libserialport: cross-platform library for accessing serial ports
/*********************************************************************************** * libserialport ...
- The network bridge on device VMnet0 is not running
The network bridge on device VMnet0 is not running. The virtual machine will not be able to communic ...
- Netruon 理解(12):使用 Linux bridge 将 Linux network namespace 连接外网
学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...
- Serial Port Programming using Win32 API(转载)
In this tutorial we will learn How to communicate with an external device like a microcontroller boa ...
- [转]Mac's and serial TTY's
Mac's are excellent tools for accessing serial device TTY ports (to console into PBX's, switches, an ...
- [转]Peer-to-Peer Communication Across Network Address Translators
Peer-to-Peer Communication Across Network Address Translators Bryan Ford Massachusetts Institute of ...
- OpenvSwitch代码分析之bridge和port
ovs-vsctl add-br br0 会在数据库里面加入新bridge的信息ovs-vsctl add-port br0 eth0 会在数据库里面加入新的port信息 void bridge_ru ...
- PatentTips - Method for network interface sharing among multiple virtual machines
BACKGROUND Many computing systems include a network interface card (NIC) to provide for communicatio ...
- Docker Network Configuration 高级网络配置
Network Configuration TL;DR When Docker starts, it creates a virtual interface named docker0 on the ...
随机推荐
- WebApi(6) 后台C#调用WebApi
https://www.cnblogs.com/cxd1008/p/6640015.html 今天来写一下后台C#代码如何访问webapi 这里使用HttpClient方法访问webapi也是很常用的 ...
- ASP.NET MVC5 新特性:Attribute路由使用详解
1.什么是Attribute路由?怎么样启用Attribute路由? 微软在 ASP.NET MVC5 中引入了一种新型路由:Attribute路由,顾名思义,Attribute路由是通过Attrib ...
- Spring_day01--Spring的bean管理(xml方式)_属性注入介绍
Spring的bean管理(xml方式) Bean实例化的方式 1 在spring里面通过配置文件 创建对象 2 bean实例化(创建对象)三种方式实现 第一种 使用类的无参数构造创建(重点) Use ...
- iOS开发之--iOS APP打包的时候出现的四个选项
- 说说M451例程之PWM
/**************************************************************************//** * @file main.c * @ve ...
- win7下maven的安装
1.在安装maven之前,先确保已经安装JDK1.6及以上版本,并且配置好环境变量.2.上Maven官网(https://maven.apache.org/download.cgi)下载Maven的压 ...
- maven项目引入jar包
今天看一下maven项目的创建和具体操作.
- [LintCode] 第一个错误的代码版本
/** * class VersionControl { * public: * static bool isBadVersion(int k); * } * you can use VersionC ...
- JavaWeb配置错误页面
我们在实际开发过程中经常会遇到程序出错的各种情况,比如最常见的404错误,500错误等等相关错误,服务器默认会将错误的信息直接显示在浏览器的页面上,如下图所示: 不管是谁如果看到这种情况的话,顿时就会 ...
- Netty 粘包/半包原理与拆包实战
Java NIO 粘包 拆包 (实战) - 史上最全解读 - 疯狂创客圈 - 博客园 https://www.cnblogs.com/crazymakercircle/p/9941658.html 本 ...