Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: serialport is not a constructor #77

Open
papavictorromeo opened this issue Feb 28, 2023 · 0 comments
Open

TypeError: serialport is not a constructor #77

papavictorromeo opened this issue Feb 28, 2023 · 0 comments

Comments

@papavictorromeo
Copy link

Hi,

Trying to create a simple Modbus program on a Linux system.

var modbus = require("modbus-stream");

modbus.serial.connect("/dev/ttyUSB0", { baudRate: 19200, parity: "even", dataBits: 8, stopBits: 1, debug: "automaton-123" }, (err, connection) => {
if (err) throw err;

connection.readHoldingRegisters({ address: 0x5b00, quantity: 8, extra: { unitId: 1 } }, (err, res) => {
    if (err) throw err;

    console.log(res); // response
})

});

And get the error in de title. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant