3

I am trying to use node-ar-drone package for controlling and interfacing with an AR Parrot Drone 2 but I get the following errors after connecting to the wireless network of the drone in my OSX Yosemite:

587214779:examples mona$ node png-stream.js 
Connecting png stream ...

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRINUSE
    at errnoException (net.js:901:11)
    at Server._listen2 (net.js:1039:14)
    at listen (net.js:1061:10)
    at Server.listen (net.js:1127:5)
    at Object.<anonymous> (/Users/mona/iotlab/armyo/node-ar-drone/examples/png-stream.js:28:8)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
587214779:examples mona$ 

I wonder what the error might be?

For more information, I have followed these tutorials:

git clone https://github.com/felixge/node-ar-drone.git

install it using this command:

npm install git://github.com/felixge/node-ar-drone.git

P.S.: I am literally running an example in the example directory and I am not changing any code.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Mona Jalal
  • 34,860
  • 64
  • 239
  • 408

3 Answers3

2

In png-stream.js change the following lines:

server.listen(8080, function() {
  console.log('Serving latest png on port 8080 ...');
});

To a different port, 8081 for instance:

server.listen(8081, function() {
  console.log('Serving latest png on port 8081 ...');
});
Yuri Zarubin
  • 11,439
  • 4
  • 30
  • 33
  • 1
    Just to highlight for the asker why you think the problem is that another server is running on port 8080: It's the "Error: listen EADDRINUSE" bit. – John Wiseman Sep 17 '15 at 22:40
2

You need sudo/admin priviliges on your machine to run it on port 8080 or any port used. You will need to start with sudo on linux.

0
sudo npm start 

did the trick on my ubuntu and react application

Ajmal Aamir
  • 1,085
  • 8
  • 8