Comments (12)
Yes, it's possible, but you should run mbusd instances using custom script because current systemd service doesn't support multiple TCP port configurations.
from mbusd.
I've added support for multiple mbusd instances in 3ea2084.
from mbusd.
@abhishekricky please close the ticket
from mbusd.
Is it possible to support multiple serial port in one instance with one TCP port?
from mbusd.
Consider two ModbusRTU (Serial) devices with the same address on two different serial Ports and a request sent from TCP to be sent via RTU.
How would one decide which RTU-serial port to prefer? If one sends it out on both serial buses, which response to choose?
IMHO nothing like that is integrated atm.
Best
from mbusd.
In general, a routing table can be achieved for gateways with two or more serial ports.
Scenario 1:
If the Modbus devices with different slave IDs are connected to different serial ports on a gateway,
slave ID can be used to route to different serial port.
For example, the Modbus requests with slave ID 1 to 5 will be routed to serial port1.
The Modbus requests with slave ID 6 to 10 will be routed to serial port2.
Scenario 2:
It's the scenario that you mentioned, two Modbus device with the same slave ID are connecting to different serial ports.
For example, there are a device A and a device B with the same slave ID 1.
The device A is connected to serial port 1 and device B is connected to serial port 2.
If gateway has a virtual-to-real slave ID mechanism,
on the Modbus Master side, the Modbus request for device A is recognized by slave ID 1
and the request for device B is recognized by slave ID 2.
When gateway received a command with slave ID 2, it can just minus 1, and send this command with slave ID 1 to serial port 2.
from mbusd.
Is it possible to support multiple serial port in one instance with one TCP port?
Since I trying to keep mbusd functionality as simple as it could be, adding multiple serial ports support with full-fledged Modbus routing table isn't something that looks good to me. Probably the best (Unix-)way to achieve this functionality is a dedicated app implementing Modbus TCP routing atop of multiple mbusd instances.
from mbusd.
Has such app been already implemented by anyone in github ?
If not, I was wondering if you have more detailed information for implementation?
For example, since mbusd is binding to a socket,
how to use another app to route packets atop of mbusd?
Is there a way to achieve this function without modify mbusd?
from mbusd.
Side question: Why not using two TCP front-ends (i.e. two ports) and route on client side?
from mbusd.
how to use another app to route packets atop of mbusd?
Is there a way to achieve this function without modify mbusd?
I'd give one of the various python modbus libs a go.
If you have static routing tables (i.e. your modbus devices do not change) it shoudn't be that complicated. Two to four man days?
from mbusd.
@abhishekricky Concerning your original question: This is now possible since mbusd supports setup via systemd.
Please close this ticket
from mbusd.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from mbusd.
Related Issues (20)
- tty: dropped 205 bytes HOT 2
- How to compile in mips architecture HOT 1
- How to read data from multiple RTU slaves? HOT 1
- "error in read()" error messages HOT 7
- service stops working after several hours - looking for help HOT 7
- Support more complex device names HOT 1
- /dev/ttyUSB0 is starting like /dev/ttyS0 HOT 1
- Crash due to missing `logw()` argument HOT 3
- '/W' requires an argument HOT 1
- version 0.5.1. HOT 1
- Modbus RTU - 6 Digit Holding Register HOT 2
- Missing device is retried forever [and blocks anything else] HOT 6
- publish docker image to ghcr & auto-build in github actions
- Add support to modbus ascii
- /dev/ttyS0? HOT 5
- Help with usb to RS485 - SH-U11 HOT 1
- CRC Enable/Disable HOT 3
- mbusd can support modbus function 20 (0x14) Read File Record and function 21 (0x15) Write File Record ..
- Using IOCTL for GPIO control HOT 4
- Make use of Linux RS-485 Support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mbusd.