gandhimonik / DroneJS

A Node.js based library for controlling a Parrot minidrone. This library also provides the feature to take pictures from the drone, download them all at a time and delete them whenever required.
Apache License 2.0
20 stars 5 forks source link

Drone not responding #2

Closed MBWhitestone closed 7 years ago

MBWhitestone commented 7 years ago

Dear Gandhimonik,

I would really like to use your code for an educational project. However when executing some examplecode like:

`var minidrone = require('dronejs');

var navDataStream = minidrone.getNavDataStream(); navDataStream.subscribe((data) => { console.log(data); }, err => debug(err), () => debug('complete'));

minidrone.connect('RS_') .then(() => minidrone.flatTrim()) .then(() => minidrone.takeOff()) .then(() => minidrone.flatTrim()) .then(() => minidrone.takePicture()) .then(() => minidrone.flatTrim()) .then(() => minidrone.land()) .then() .catch((e) => { console.log('Error occurred: ' + e); });`

the drone (Rolling Spider) does not give any reaction. I do not get any error messages except some noble warning which I also get using the software of node-rollling-spider (https://github.com/voodootikigod/node-rolling-spider) however with that software the drone does react. Changing 'RS_' in the connect statement to the correct bluetoothcode of the drone also does not help. I am currently using:

Have you any idea what I am doing wrong?

moe-the-fabber commented 7 years ago

can you establish connection? my drone "eyes" stop blinking when connected? do you use an internal bluetooth 4.0 or is it some kind of usb dongle?

MBWhitestone commented 7 years ago

Yes I can establish a connection. I use an internal bluetooth 4.2 adapter. The eyes of the drone don't blink and are green when connected. (I even managed to fly the drone using another NodeJS package as I stated, so it can hardly be a hardware issue.)

gandhimonik commented 7 years ago

Hey MBWhitestone,

Can you try shutting down the drone, restarting it and then running the code? I've noticed sometimes the drone itself just rejects all the connection requests until we restart it.

MBWhitestone commented 7 years ago

I have done that several times, however it unfortunately does not help. :(

gandhimonik commented 7 years ago

Can you share ur code so I can check it out what's wrong?

MBWhitestone commented 7 years ago

var minidrone = require('dronejs');

var navDataStream = minidrone.getNavDataStream();
navDataStream.subscribe((data) => {
        console.log(data);
    },
    err => debug(err),
    () => debug('complete'));

minidrone.connect('RS_') // Also tried RS_R######
    .then(() => minidrone.flatTrim())
    .then(() => minidrone.takeOff())
    .then(() => minidrone.flatTrim())
    .then(() => minidrone.takePicture())
    .then(() => minidrone.flatTrim())
    .then(() => minidrone.land())
    .then()
    .catch((e) => {
        console.log('Error occurred: ' + e);
    });```
gandhimonik commented 7 years ago

I just added a feature of logging to help me fix the issues.

Can u update the library and try running the example "check-all-states.js" after turning on logging. Post all the logs here so I can check out your problem.

minidrone.logging(true);

Plz refer API for more details: https://github.com/gandhimonik/DroneJS#api`

gandhimonik commented 7 years ago

Sorry, this is the example I am talking about.

https://github.com/gandhimonik/DroneJS#setup-navdata-stream

MBWhitestone commented 7 years ago

Dear Gandhimonik,

Sorry for my late reaction. For the continuation of the project we switched to another drone. Unfortunately, I have no longer access to the Rolling Spider, so I am not able to try your logfeature. Nevertheless, I thank you for your kind support.