Cloud-Automation / node-modbus

Modbus TCP Client/Server implementation for Node.JS
456 stars 169 forks source link

Fix Server Event Listener Overload Mismatch #270

Closed alexbuczynsky closed 1 month ago

alexbuczynsky commented 3 years ago

The modbus server does not accept an event of 'connection' and respond with a net socket.

Fixes #269

alexbuczynsky commented 3 years ago

@Byorun, let me know if this fixes your issue

Byorun commented 3 years ago

@alexbuczynsky on a side note, your lock file is probably outdated image removing the lock file let me run npm install

Byorun commented 3 years ago

Unfortunately this won't fix the problem.

I checked out the branch, build it and copied the dist to my project but the output is still the same.

And using the original server sample for readCoils

server.on('readCoils', function (request, response, send) {
  /* Implement your own */

  response.body.coils[0] = true
  response.body.coils[1] = false

  send(response)
})

still gives the no overloads match error. I assume this might be a copy and paste error since the server.on() doesn't have a three argument listener, only two

robot2045 commented 3 years ago

Any update on this fix ? @alexbuczynsky @Byorun