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

net.createServer & serialport (binding conflict ?) #1761

Closed
jc-59 opened this issue Jan 2, 2019 · 2 comments
Closed

net.createServer & serialport (binding conflict ?) #1761

jc-59 opened this issue Jan 2, 2019 · 2 comments

Comments

@jc-59
Copy link

jc-59 commented Jan 2, 2019

Summary of Problem

(Please answer all 3)

  • What are you trying to do?
    *receive data from SerialPort and print them on Console
    *receive data from http request (port 8019) and send them to SerialPort

  • What happens?
    SerialPort is not opened

  • What should have happened?
    *SerialPort should open & data should be received from SerailPort

the following code is working with @serialport/bindings:2.0.3 but not anymore with @serialport/bindings:2.0.4

Code to Reproduce the Issue

var server = net.createServer(function(c) {
console.log((new Date()) + " - Server connected");
c.on('error', function(e) {
console.log((new Date()) + " - Error server disconnected");
});
c.on('close', function() {
console.log((new Date()) + " - Connexion closed");
});
c.on('data', function(data) {
console.log((new Date()) + " - Response: " + data);
gw.write(data.toString() + '\n');
});
});
server.listen(8019, function(e) {
console.log((new Date()) + " - server bound on 8019");
});
});

    var SerialPort = require('serialport');
    gw = new SerialPort(gwAddress);
    gw.settings.baudRate=115200;

    gw.on('open', function() {
            console.log((new Date()) + " - connected to serial);
    }).on('data', function(rd) {
            console.log((new Date()) + " - data received);

Versions, Operating System and Hardware

  • SerialPort@? 7.1.1
    @serialport/bindings:2.0.4 (works well with @serialport/bindings:2.0.3)
  • Node.js v8.15.0
  • Linux
  • Hardware and chipset? armv7l (Raspberry PI 3+)
@jc-59 jc-59 changed the title net.createServer & serialport net.createServer & serialport (binding conflict ?) Jan 2, 2019
@floriansegginger
Copy link

I am having the same issue. Program just hangs, never opens the serial port. Even if the file descriptor does not exist.

Rolled back to @serialport/bindings@2.0.3 and everything works.

@reconbot
Copy link
Member

reconbot commented Jan 3, 2019

Yeah Sorry about this. This is a duplicate of #1751. We'll either pull the release or release an update.

@reconbot reconbot closed this as completed Jan 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jul 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants