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

[Error: Unable to connect] Opening \\.\/dev/: Unknown error code 3 #16

Open
jelmerdemaat opened this issue Dec 7, 2012 · 11 comments
Open

Comments

@jelmerdemaat
Copy link

Hi there,

I'm a beginner in Node and noduino, but it seems I have the whole thing set up correctly.
I can succesfully do this:

$ > git clone [email protected]:semu/noduino.git $ > cd noduino/ $ > git submodule update --init $ > npm install $ > cd examples/

But when I do

$ > node test.walkLED.js

I get

[Error: Unable to connect] events.js:2725: Uncaught error: Opening \\.\/dev/: Unknown error code 3

I have looked around but I can't find any thing about this error.
Do you have any idea about what the problem could be?

Cheers,

Jelmer

@jelmerdemaat
Copy link
Author

Maybe this helps: http://d.pr/i/UWKd

This one occurs when I try to use the node srv.web.js example.

@sarink
Copy link

sarink commented Jan 7, 2013

I'm having the exact same problem (on Windows). Any ideas?

@jelmerdemaat
Copy link
Author

It appears to me that the library is not (yet) usable for Windows users. The \\.\/dev/ thing is some kind of Unix/OSX thing that Windows doesn't understand, as the ports on Windows are named like COM3 or COM12. Changing the file doesn't make any difference though. You can use Ardugate as an alternative, for me that did work on Windows.

@SerialPort-zz
Copy link

Hi.

I unknow how TAKE the error.
I try with the logic of language JavaScript:

var MySERIAL= new MySERIAL('COM1',{baudrate:57600}).on('error',function(err){ERROR=true;});

//Then I try take conditional:
console.log(ERROR);

But NEVER I can take var ERROR (undefined)...

Some Idea please?

@sarink
Copy link

sarink commented May 29, 2013

This doesn't work on Windows. I also tried using Ardugate, which is great for some simple demos and getting started I suppose...

Eventually I moved to node-serialport (which does work on Windows), and manually send custom serial instructions to the arduino, then catch them in the board's loop() function to do stuff.

@SerialPort-zz
Copy link

Thanks Sarink.

Iis different:

--serialport

--node-serialport

--Ardugate

???

@sbstjn
Copy link
Owner

sbstjn commented May 29, 2013

I'm sorry, but Noduino has never been tested on Windows. You could try running linux in a virtual machine or try updating (node-)serialport to a recent version ( npm install [email protected] ) and replace linux' /dev/ paths with the ones on Windows…

You should have a look at https://github.com/semu/node-arduino-socket. It uses serialport as well, but is a way smaller project. If you can get this (https://github.com/semu/node-arduino-socket/blob/master/serial.js) working with an updated version of serialport you can get Noduino running as well.

@SerialPort-zz
Copy link

updating (node-)serialport to a recent version

Sorry but I have serialport, version:

npm serialport -v
1.2.21

I only like TAKE the error of connection, as I say:

ERROR='some value';
var MySERIAL= new MySERIAL('COM666 or some other port FALSE',{baudrate:57600})
.on('error',function(err){
    ERROR='NEW VALUE!!!';
    });
//Then I try take conditional:
console.log(ERROR);

But NEVER the var ERROR change.

Some idea about how I UPDATE the value of the var ERROR?

THANKS !

@sbstjn
Copy link
Owner

sbstjn commented May 29, 2013

var MySERIAL= new MySERIAL('COM666 or some other port FALSE', {baudrate:57600}).on('error', function(err){
  // This function is called on error, so do your stuff here
  // Maybe this function is never called, or maybe 2 seconds after startup
  // You never know…
  console.log(err);

  // You can set variables here as well
  var xyz = 1;
});

// But this won't work
console.log(xzy);

@SerialPort-zz
Copy link

    xyz=0;
    var MySERIAL= require('serialport').SerialPort;
    var MySERIAL= new MySERIAL('COM666 or some other port FALSE', {baudrate:57600})
    .on('error', function(err){
      // This function is called on error, so do your stuff here
      // Maybe this function is never called, or maybe 2 seconds after startup
      // You never know…
      console.log(err);     
      // You can set variables here as well
      var xyz = 1;
    });
    // But this won't work
    console.log(xzy);

yes, is CORRECT!
Just AFTER of this lines I need evaluate value of {xyz} and then:

if(xyz==1){
    }
else {
    }

Can you paste here how is possible ???

Thanks

@SerialPort-zz
Copy link

I am creazy with this NODEJS...
Here other example where I broken my brain:

var fs = require('fs');
fs.writeFile('./FILE.txt', "Hey there!", function(err) {
    if(err) {
        VV=123;
    } else {
        VV=987;
    }
});
console.log(VV);//Return FATAL ERROR becouse VV never is declarated...   :-s

How Is possible this!!!...
Any example, or text to dummys in spanish ? ( SPECIALLY ABOUT THIS POINT )

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

No branches or pull requests

4 participants