更新 master.js
This commit is contained in:
parent
859ff58733
commit
68ffad6f69
@ -485,18 +485,11 @@ function Master(options, adapter) {
|
||||
|
||||
if (options.config.type === 'tcp') {
|
||||
|
||||
options.config.tcp.bind = "127.0.0.1" ;
|
||||
const tcp = options.config.tcp;
|
||||
|
||||
if (!tcp || !tcp.bind || tcp.bind === '0.0.0.0') {
|
||||
adapter.log.error('IP address is not defined');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
modbusClient = Modbus('client', 'tcp')({
|
||||
options: {
|
||||
tcp: {
|
||||
host: tcp.bind,
|
||||
host: tcp.bind || "127.0.0.1",
|
||||
port: parseInt(tcp.port, 10) || 502,
|
||||
autoReconnect: false,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user