GithubHelp home page GithubHelp logo

Comments (43)

gandhimonik avatar gandhimonik commented on June 5, 2024 1

Alright I'll check it out with these changes and let you know.

Thanks!

from dronejs.

marcosboggia avatar marcosboggia commented on June 5, 2024 1

Hi @gandhimonik , thanks for reply. We are using parrot minidrone airborne cargo. Today we made some modifications to your code and got navigation commands working (takeOff, etc).
Brief explanation:
First, the execution got stuck at "suscribeToNotify" when it suscribe to the last ftpChars. So we made the following "modification" (ugly patch) near line 220 of "/lib/service/MiniDroneService.js":

if ((array.length < 4 && ids.length + 1 === array.length) || (ids.length === array.length)) {
    (0, _debug.debug)('subscribed to characteristics...');
    resolve('success');
}

Its kind of a bypass for that last characteristic so the code could continue executing.
After that we realized (debugging other js libraries that worked for us) that these three changes were necessary to make "takeOff" work:

  1. Change _this8.cmdService.write(buffer, false); to _this8.cmdService.write(buffer, true); in "/lib/service/MiniDroneService.js".
  2. Change _this7.cmdService = cmdChars[10]; to _this7.cmdService = cmdChars[11];
  3. Hardcode the buffer creation for "takeOff" command in /lib/controller/MiniDroneController.js at getMiniDroneCmds
    if(cmdName == 'takeOff'){ buffer = new Buffer([0x02, 0x03, 0x02, 0x00, 0x01, 0x00]) }
    We still don't know yet why this is actually working, so maybe you could help us undestand why.
    And finally, we got stuck at listing all pictures. From what we could debug, after we send LIS and the correct media path (the buffer is being created correctly), it seems that the program gets suscribed to the wrong characteristic: 'fb' instead of 'fd2' , so we hope you can help us with that.
    If you need more logging, tomorrow I can debug more and post it here.
    Thanks!

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Can you remove checkAllStates function call from the sequence and try one more time?

I've see mini drones getting disconnected while calling this function.

from dronejs.

adesito avatar adesito commented on June 5, 2024

Hi same issue here with a Maclan drone... Code is quite similar but as you recomended I haven't include the checkAllStates command. log shows same as above connection is OK but the drone doesn't run any command :(

Regards!

from dronejs.

adesito avatar adesito commented on June 5, 2024

Hi guys I discover that in this codeline of service script:
_this7.cmdService = cmdChars[10];
If you change 10 for 11 (fa0b characteristic instead of fa0a) the drone start accept commands.

from dronejs.

adesito avatar adesito commented on June 5, 2024

Now I have problems with other parts of script, like promises. The drone finish its commands, but the script continue showing debug data (and never go out the script even if I put a process.exit). Sometimes the drone only hover and no other command is received.
Sometimes the backward command with same parameters that forward, doesn't work like forward... I don't know why but forward works correctly, but backward not.

Regards.

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Can you attach the logs here for the instance when the drone stops accepting the commands so I can investigate what's going on?

from dronejs.

adesito avatar adesito commented on June 5, 2024

Hi I attach last loging I created. This is the main script

var droneName = 'Maclan_068328';
var minidrone = require('dronejs');
var navDataStream = minidrone.getNavDataStream();

minidrone.enableLogging();
navDataStream.subscribe((data) => {
console.log(data);
},
err => debug(err),
() => debug('Completado...'));

var drone = minidrone.connect(droneName)
//.then(() => minidrone.checkAllStates());
.then(() => minidrone.flatTrim())
.then(() => minidrone.takeOff())
.then(() => minidrone.flatTrim())
.then(() => minidrone.forward(10,5))
.then(() => minidrone.flatTrim())
.then(() => minidrone.takePicture())
.then(() => minidrone.flatTrim())
.then(() => minidrone.backward(5,5))
.then(() => minidrone.flatTrim())
.then(() => minidrone.takePicture())
.then(() => minidrone.flatTrim())
.then(() => minidrone.land())
.then(() => minidrone.disconnect())
.then(() => {
console.log('ALL DONE!...');
process.exit(0);
})
.catch ((e) => {
console.log('[FATAL] Error occurred:' + e);
process.exit(1);
})

test.log

As I told you forward is OK, but backward not, the drone switch to back to fast and several meters.

Regards!

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Hi,

In the logs you've attached, the value for the intensity (first argument) passed in the backward command is 161 which is not a valid value. The value for the intensity passed to the backward function needs to be between 0 and 100. What is the value that you passed to the function?

Also I don't see any logs for landing, so does the drone land after you execute this?

from dronejs.

adesito avatar adesito commented on June 5, 2024

Hi, sorry for the delay nut I was in japan for two weeks.

This is the value that I put on the backward command
.then(() => minidrone.backward(5,5))

I don't know how 161 is there. When the backward command is ready the drone go fast to backward and several times it crash, so because of that I think there's no landing log.

I tested the ftp or doenload image/picture too and I don't know why this commands don't work. If I create a minidrone.downloadPicture o minidrone.deletePicture functions they do nothing :(

Regards!

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Hi,

Does it crash because of the execution of backward command or is it because it doesn't have space to fly and hits the wall. On calling the backward function with both the arguments set to 5, I don't think it should go out of control.

For downloading the picture, can you paste the script and the log in here so I can check if there's anything unusual.

Regards!

from dronejs.

adesito avatar adesito commented on June 5, 2024

Hi... I put the same values in forward and backward (testing purpose) and forward movement is smooth and slow, the backward movement is fast and several times the drone doesn't stop and crash... this is the main problem with backward movement.

I'll send you the script and log for download picture asap :)

Thank you so much!

Regards

from dronejs.

adesito avatar adesito commented on June 5, 2024

Hi

This is de log::: I add some lines to understand better the characteristics...

scanning Bluetooth devices...
peripheral discovered: Maclan_068328 at promixity: -59
scanning stopped...
handshake completed...
proximity updated to: -59
services found: {"uuid":"1800","name":"Generic Access","type":"org.bluetooth.service.generic_access","includedServiceUuids":null},{"uuid":"1801","name":"Generic Attribute","type":"org.bluetooth.service.generic_attribute","includedServiceUuids":null},{"uuid":"9a66fa000800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fb000800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fc000800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fd210800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fd510800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fe000800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null}
characteristics found: {"uuid":"2a00","name":"Device Name","type":"org.bluetooth.characteristic.gap.device_name","properties":["read"]},{"uuid":"2a01","name":"Appearance","type":"org.bluetooth.characteristic.gap.appearance","properties":["read"]},{"uuid":"2a04","name":"Peripheral Preferred Connection Parameters","type":"org.bluetooth.characteristic.gap.peripheral_preferred_connection_parameters","properties":["read"]}
characteristics found: {"uuid":"2a05","name":"Service Changed","type":"org.bluetooth.characteristic.gatt.service_changed","properties":["indicate"]}
characteristics found: {"uuid":"9a66ffc10800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse","write"]}
characteristics found: {"uuid":"9a66fd220800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]},{"uuid":"9a66fd230800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]},{"uuid":"9a66fd240800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]}
characteristics found: {"uuid":"9a66fd520800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]},{"uuid":"9a66fd530800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]},{"uuid":"9a66fd540800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]}
characteristics found: {"uuid":"9a66fe010800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse","write"]},{"uuid":"9a66fe020800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]}
characteristics found: {"uuid":"9a66fa000800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa010800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa020800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa030800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa040800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa050800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa060800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa070800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa080800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa090800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0a0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0b0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0c0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0d0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0e0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0f0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa100800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa110800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa120800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa130800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa140800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa150800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa160800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa170800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa180800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa190800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1a0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1b0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1c0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1d0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1e0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1f0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]}
characteristics found: {"uuid":"9a66fb000800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb010800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb020800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb030800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb040800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb050800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb060800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb070800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb080800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb090800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0a0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0b0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0c0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0d0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0e0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0f0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb100800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb110800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb120800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb130800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb140800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb150800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb160800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb170800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb180800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb190800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1a0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1b0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1c0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1d0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1e0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1f0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]}
Caracteristicas FTP1 : {"uuid":"9a66fd230800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]}
Caracteristicas FTP2: {"uuid":"9a66fd240800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]}
subscribed to characteristics...
subscribed to characteristics...
Creating observable...
Creating observable...
Drone connected successfully
Directory NOT found: null
Searching Directory...
Command Name [LIS]
Command param [/internal_000/]
Sending FTP Command...false

And the script is this:::

var droneName = 'Maclan_068328';
var minidrone = require('dronejs');

console.log('Comenzamos la conexion al drone:' + droneName);

minidrone.enableLogging();

var drone = minidrone.connect(droneName)
.then(() => minidrone.listAllPictures())
.then(pictures => {
let picList = genPictures(pictures);

        function download(result){
    	    if (result.done) return Promise.resolve('success');

            return minidrone.downloadPicture(result.value, 'output')
    	            .then(response => download(picList.next()))
            	    .catch((e) => {
                    	console.log('Error occurred: ' + e);
                    });
    	}

        try {
    	    return download(picList.next());
        } catch (e) {
    	    console.log('Error occurred: ' + e);
        }
    })
    .then(response => {
    	if (response === 'success') {
            console.log('pictures downloaded successfully...');
    	}
    })				    	
.then(() => {
	console.log('ALL DONE!...');
	process.exit(0);
})
.catch ((e) => {
	console.log('[FATAL] Error occurred:' + e);
	process.exit(1);
})

The FTP command never do anything (last log command)
My parrot is an airborne night

Regards.

from dronejs.

adesito avatar adesito commented on June 5, 2024

Hi!

I write some debug lines and I discover this piece of code (there are several lines like this in media code)

_this25.droneController.sendMediaCommand('LIS', '/internal_000/').then(function () {}).catch(function (e) {
reject(e);
});

The program goes for .then(function () {}) that apparently does nothing...
I don't understand what is this empty function...sorry :(

Regards

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Hi,

The media command 'LIS' is used to get the list of all the file names for the photos you take. I believe for the Airborne Night drone, the folder in which the picture files are stored is changed.

Did u happen to change the name of the folder in which the files are stored?

Regards!

from dronejs.

adesito avatar adesito commented on June 5, 2024

Hi.

Yes I put hardcode the Airborne_Night directory and the command is like LIS/internal_000/Airborne_Night/media.

I've tried to put one jpg file name too, but in two cases the script hold on sendFTPCommand.

I've configured a bluetooth sniffing in my raspi (where nodej is running) and I traced the BT messages...last one is LIS/internal_000/Airborne_Night/media and next disconnect packet... I don't know why but the drone disconnect after the FTP characteristic packet (LIS command).

I've enabled android BT sniffing on my android mobile to trace BT packets, but I'm seeing that the android app not use fd characteristics to write images from the drone :(

Next I put the wireshark LIS packet

Frame 1066: 94 bytes on wire (752 bits), 94 bytes captured (752 bits)
Encapsulation type: Bluetooth H4 with linux header (99)
Arrival Time: Jan 22, 2018 17:27:36.988221000 Hora estándar romance
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1516638456.988221000 seconds
[Time delta from previous captured frame: 0.128108000 seconds]
[Time delta from previous displayed frame: 0.128108000 seconds]
[Time since reference or first frame: 2149.567971000 seconds]
Frame Number: 1066
Frame Length: 94 bytes (752 bits)
Capture Length: 94 bytes (752 bits)
[Frame is marked: False]
[Frame is ignored: False]
Point-to-Point Direction: Sent (0)
[Protocols in frame: bluetooth:hci_h4:bthci_acl:btl2cap:btatt]
Bluetooth
[Source: Raspberr_6d:75:fd (b8:27:eb:6d:75:fd)]
[Destination: e0:14:24:56:3d:29 (e0:14:24:56:3d:29)]
Bluetooth HCI H4
[Direction: Sent (0x00)]
HCI Packet Type: ACL Data (0x02)
Bluetooth HCI ACL Packet
.... 0000 0100 0000 = Connection Handle: 0x040
..00 .... .... .... = PB Flag: First Non-automatically Flushable Packet (0)
00.. .... .... .... = BC Flag: Point-To-Point (0)
Data Total Length: 89
Data
[Connect in frame: 752]
[Disconnect in frame: 1068]
[Source BD_ADDR: Raspberr_6d:75:fd (b8:27:eb:6d:75:fd)]
[Source Device Name: ]
[Source Role: Unknown (0)]
[Destination BD_ADDR: e0:14:24:56:3d:29 (e0:14:24:56:3d:29)]
[Destination Device Name: Maclan_068328]
[Destination Role: Unknown (0)]
[Current Mode: Unknown (-1)]
Bluetooth L2CAP Protocol
Length: 85
CID: Attribute Protocol (0x0004)
Bluetooth Attribute Protocol
Opcode: Write Command (0x52)
0... .... = Authentication Signature: False
.1.. .... = Command: True
..01 0010 = Method: Write Request (0x12)
Handle: 0x0118 (Unknown: Unknown)
[Service UUID: 9a66fd210800919111e4012d1540cb8e]
[UUID: 9a66fd240800919111e4012d1540cb8e]
Value: 034745542f696e7465726e616c5f3030302f416972626f72...

from dronejs.

adesito avatar adesito commented on June 5, 2024

This is a LIS packet from the android mobile...quite similar but only internal_000 apears...

Frame 1344: 30 bytes on wire (240 bits), 30 bytes captured (240 bits)
Encapsulation type: Bluetooth H4 with linux header (99)
Arrival Time: Jan 22, 2018 19:01:24.957559000 Hora estándar romance
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1516644084.957559000 seconds
[Time delta from previous captured frame: 0.004171000 seconds]
[Time delta from previous displayed frame: 0.004171000 seconds]
[Time since reference or first frame: 85.286235000 seconds]
Frame Number: 1344
Frame Length: 30 bytes (240 bits)
Capture Length: 30 bytes (240 bits)
[Frame is marked: True]
[Frame is ignored: False]
Point-to-Point Direction: Sent (0)
[Protocols in frame: bluetooth:hci_h4:bthci_acl:btl2cap:btatt]
Bluetooth
[Source: XiaomiCo_fe:e7:9a (f4:f5:db:fe:e7:9a)]
[Destination: e0:14:24:56:3d:29 (e0:14:24:56:3d:29)]
Bluetooth HCI H4
[Direction: Sent (0x00)]
HCI Packet Type: ACL Data (0x02)
Bluetooth HCI ACL Packet
.... 0000 0000 0010 = Connection Handle: 0x002
..00 .... .... .... = PB Flag: First Non-automatically Flushable Packet (0)
00.. .... .... .... = BC Flag: Point-To-Point (0)
Data Total Length: 25
Data
[Connect in frame: 593]
[Disconnect in frame: 3599]
[Source BD_ADDR: XiaomiCo_fe:e7:9a (f4:f5:db:fe:e7:9a)]
[Source Device Name: Mi A1]
[Source Role: Unknown (0)]
[Destination BD_ADDR: e0:14:24:56:3d:29 (e0:14:24:56:3d:29)]
[Destination Device Name: Maclan_068328]
[Destination Role: Unknown (0)]
[Current Mode: Unknown (-1)]
Bluetooth L2CAP Protocol
Length: 21
CID: Attribute Protocol (0x0004)
Bluetooth Attribute Protocol
Opcode: Write Command (0x52)
0... .... = Authentication Signature: False
.1.. .... = Command: True
..01 0010 = Method: Write Request (0x12)
Handle: 0x0118 (Unknown: Unknown)
[Service UUID: 9a66fd210800919111e4012d1540cb8e]
[UUID: 9a66fd240800919111e4012d1540cb8e]
Value: 034c49532f696e7465726e616c5f30303000

from dronejs.

adesito avatar adesito commented on June 5, 2024

Hi i'm trying to trace blt frames from android mobile (data transfer works) and nodejs. I create 2 trace log files and review them with wireshark. The differences between both LIS frames are the size. android mobile is sending always 30 bytes max. And nodejs code depends of the directory name.

for example for LIS /internal_000/Airborne_Night/media... android send several frames 30b... and nodejs send only one frame of 51b. I don't know if this is the problem...

034c49532f696e7465726e616c5f30303000 -> LIS/internal_000
034c49532f696e7465726e616c5f3030302f416972626f726e655f4e696768742f6d6564696100 -> LIS/internal_000/Airborne_Night/media

In wireshark I saw too that after LIS command (sendFTPCommand) controller send to host Rcev packet (both devises nodejs/raspbi and android) both frames are similar only change connection handle (02) for raspbi and 04 for android (but this its normal I guest).

But after that Rcev frame android start to send data packets with directory information, but raspbi receive a disconnect frame and blt connection is closed.

I don't know if its a BLE problem (noble lib) or other type of problem but only happends with FTP commands. Navcommands works and the drone takeoff, hover, goes right/left/fordwar/backwar/etc, land...but it doesn't send any data about directory or files.

As comm is disconnected after FTP command and nothing is received after that any callback is executed and the script hang so never ends and I've to push twice CTRL+C in the raspbi to stop the process.

Regards!

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Hey,

I've seen this problem before where the drone gets disconnected while sending the byte packets for the image to download. It has happened to me for the Rolling Spider drone so for that I introduced the logic to keep the drone alive and not get disconnected.

If you'd like to try, I can introduce the same logic even for the Airborne Night drone but before we do that, can you tell me if you are using the latest firmware for this drone? Generally these kind of problems get resolved after updating the firmware

Regards!

from dronejs.

adesito avatar adesito commented on June 5, 2024

Hi I've changed several parts of the code in controller sendmedia command function

if (!thruGetService) {
//buffer.writeUInt8(3, offset++);
}

if (!thruGetService) {
//buffer.writeUInt8(0, offset);
}

and change view downloadPicture line

stream.write(mediaObj.data.slice(1)); changing 1 by 0

With this changes the drone send images correctly. I was to send you this changes yesterday but I had a very busy day.

Regards!

from dronejs.

adesito avatar adesito commented on June 5, 2024

Sorry I forgot it I don't have last firmware because lasta firmware has a problem/issue and drone doesn't flight well. I have 2.6.8 instead lasta one 2.7.1

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Hey,

I checked with Rolling Spider and Airborne Cargo drone and all these 3 lines of code are required for them to download pictures.

The lines - buffer.writeUInt8(3, offset++); and buffer.writeUInt8(3, offset++); are utilized to set the initial and final byte in the ftp command. The drones use this to identify if its the FTP command or a regular maneuvering command.

The line - stream.write(mediaObj.data.slice(1)); is used to skip the first byte from the data packet which the drones send to download the pictures. The first byte is a serial number byte and its not part of the data for the image.

I checked the Parrot SDK and the code utilized to download the files in the mini drones has similar logic implemented. So I highly doubt that the Airborne Night behaves differently. Can you check one more time just to verify if its true?

from dronejs.

adesito avatar adesito commented on June 5, 2024

Hi.

If I use slice(0) the image doesn't open with a image program showing corrupt image or unknown format. If I put slice(0) the image is perfect, so I keep slice(0) for my drone ;).

The other lines if I uncomment them the drone never receive enoftransmission string. I don't know if its a problem of my firmware or my drone model, but if I don't make this changes the downloadPicture function doesn't work correctly.

Regards.

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Hi,

Can you tell me the software you use to view the image? I'll try one more time to see if there are any issues.

from dronejs.

adesito avatar adesito commented on June 5, 2024

Hi

I use windows photos for example and other like paint.net or gimp

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Hi,

I believe Photos app is meant to work just on Windows so is the paint.net.

I installed Gimp in my Mac and the downloaded pictures from the drone work completely fine with the line stream.write(mediaObj.data.slice(1));. If I set the index to 0 for this line then it throws error on Gimp too.

So I'd suggest if its inevitable for you to add these fixes then you can go ahead and add them just for your case. I cannot go add them to the main library as it would break for others.

I am gonna close this issue if you don't have any other questions.

from dronejs.

adesito avatar adesito commented on June 5, 2024

from dronejs.

silgon avatar silgon commented on June 5, 2024

Is this already patched in the git repo? I'm using the installation with npm install dronejs but the drone does nothing. It seems to be connected and then nothing. My code is the following:

var minidrone = require('dronejs');

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

minidrone.enableLogging();
minidrone.connect('Mars_149638')
    .then(() => minidrone.flatTrim())
    .then(() => minidrone.takeOff())
    .then(() => minidrone.flatTrim())
    .then(() => minidrone.forward(50, 5))
    .then(() => minidrone.flatTrim())
    .then(() => minidrone.land())
    .then()
    .catch((e) => {
        console.log('Error occurred: ' + e);
    });

And my log is the following:

scanning devices...
peripheral discovered: Mars_149638 at promixity: -67
scanning stopped...
handshake completed...
proximity updated to: -58
services found: {"uuid":"1801","name":"Generic Attribute","type":"org.bluetooth.service.generic_attribute","includedServiceUuids":null},{"uuid":"1800","name":"Generic Access","type":"org.bluetooth.service.generic_access","includedServiceUuids":null},{"uuid":"9a66fa000800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fb000800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fd210800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fd510800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fe000800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null}
characteristics found: {"uuid":"2a00","name":"Device Name","type":"org.bluetooth.characteristic.gap.device_name","properties":["read"]},{"uuid":"2a01","name":"Appearance","type":"org.bluetooth.characteristic.gap.appearance","properties":["read"]},{"uuid":"2a04","name":"Peripheral Preferred Connection Parameters","type":"org.bluetooth.characteristic.gap.peripheral_preferred_connection_parameters","properties":["read"]}
characteristics found: {"uuid":"9a66fd220800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]},{"uuid":"9a66fd230800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]},{"uuid":"9a66fd240800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write"]}
characteristics found: {"uuid":"9a66fd520800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]},{"uuid":"9a66fd530800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]},{"uuid":"9a66fd540800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write"]}
characteristics found: {"uuid":"2a05","name":"Service Changed","type":"org.bluetooth.characteristic.gatt.service_changed","properties":["indicate"]}
characteristics found: {"uuid":"9a66fe010800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse","write"]},{"uuid":"9a66fe020800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]}
characteristics found: {"uuid":"9a66fa000800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa010800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa020800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa030800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa040800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa050800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa060800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa070800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa080800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa090800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0a0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0b0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0c0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0d0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0e0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0f0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa100800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa110800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa120800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa130800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa140800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa150800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa160800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa170800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa180800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa190800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1a0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1b0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1c0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1d0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1e0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1f0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]}
characteristics found: {"uuid":"9a66fb000800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb010800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb020800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb030800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb040800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb050800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb060800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb070800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb080800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb090800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0a0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0b0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0c0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0d0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0e0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0f0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb100800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb110800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb120800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb130800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb140800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb150800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb160800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb170800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb180800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb190800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1a0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1b0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1c0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1d0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1e0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1f0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]}
subscribed to characteristics...

I'm using a Parrot Airborne Cargo Mars.

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Can you update the firmware and try again? In the logs I see that the service and its characteristics found are different.

from dronejs.

silgon avatar silgon commented on June 5, 2024

Sorry it took me some time to reply. I'm thinking that it's the problem when I install I get the following error.

node-pre-gyp ERR! Tried to download(404): https://github.com/tessel/node-usb/releases/download/1.3.1/usb_bindings-v1.3.1-node-v59-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI, glibc) (falling back to source compile with node-gyp)

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

DroneJS doesn't depend on the library you are trying to install but I believe the error you are getting is because there is no file pointing to this URL. That's why it throws 404 error.

https://github.com/tessel/node-usb/releases/download/1.3.1/usb_bindings-v1.3.1-node-v59-linux-x64.tar.gz

from dronejs.

silgon avatar silgon commented on June 5, 2024

I saw that 404 error. However I'm starting in an empty folder and running the command:

npm install dronejs

And it throws that error. Maybe a dependency of a dependency?

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

What version of Node are you using?

from dronejs.

silgon avatar silgon commented on June 5, 2024

node v9.10.0

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Are you on Mac or Windows? If its Mac can you confirm if you have the command line tools installed through Xcode.

from dronejs.

silgon avatar silgon commented on June 5, 2024

ubuntu 16.04. Any ideas?

If not I'll check for workarounds. I haven't tried more solutions.

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Can you try running this command before installing dronejs?

npm install -g node-pre-gyp

If this doesn't work then try running below given command:

npm install dronejs --no-optional

from dronejs.

ManuelCostanzo avatar ManuelCostanzo commented on June 5, 2024

Hello, i have a problem. Drone is connect but do nothing. My log:

scanning devices...
peripheral discovered: Travis_140922 at promixity: -50
scanning stopped...
handshake completed...
proximity updated to: -50
services found: {"uuid":"1801","name":"Generic Attribute","type":"org.bluetooth.service.generic_attribute","includedServiceUuids":null},{"uuid":"1800","name":"Generic Access","type":"org.bluetooth.service.generic_access","includedServiceUuids":null},{"uuid":"9a66fa000800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fb000800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fd210800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fd510800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null},{"uuid":"9a66fe000800919111e4012d1540cb8e","name":null,"type":null,"includedServiceUuids":null}
characteristics found: {"uuid":"2a00","name":"Device Name","type":"org.bluetooth.characteristic.gap.device_name","properties":["read"]},{"uuid":"2a01","name":"Appearance","type":"org.bluetooth.characteristic.gap.appearance","properties":["read"]},{"uuid":"2a04","name":"Peripheral Preferred Connection Parameters","type":"org.bluetooth.characteristic.gap.peripheral_preferred_connection_parameters","properties":["read"]}
characteristics found: {"uuid":"9a66fd220800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]},{"uuid":"9a66fd230800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]},{"uuid":"9a66fd240800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write"]}
characteristics found: {"uuid":"9a66fd520800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]},{"uuid":"9a66fd530800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]},{"uuid":"9a66fd540800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write"]}
characteristics found: {"uuid":"2a05","name":"Service Changed","type":"org.bluetooth.characteristic.gatt.service_changed","properties":["indicate"]}
characteristics found: {"uuid":"9a66fe010800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse","write"]},{"uuid":"9a66fe020800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]}
characteristics found: {"uuid":"9a66fa000800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa010800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa020800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa030800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa040800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa050800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa060800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa070800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa080800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa090800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0a0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0b0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0c0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0d0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0e0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa0f0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa100800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa110800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa120800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa130800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa140800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa150800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa160800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa170800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa180800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa190800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1a0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1b0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1c0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1d0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1e0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]},{"uuid":"9a66fa1f0800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse"]}
characteristics found: {"uuid":"9a66fb000800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb010800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb020800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb030800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb040800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb050800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb060800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb070800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb080800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb090800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0a0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0b0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0c0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0d0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0e0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb0f0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb100800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb110800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb120800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb130800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb140800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb150800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb160800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb170800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb180800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb190800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1a0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1b0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1c0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1d0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1e0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]},{"uuid":"9a66fb1f0800919111e4012d1540cb8e","name":null,"type":null,"properties":["notify"]}
subscribed to characteristics...

Any helps ? Thank you

from dronejs.

marcosboggia avatar marcosboggia commented on June 5, 2024

Hi, i have the exactly same issue @thatscot had. But this solution didn't work for me:
"Hi guys I discover that in this codeline of service script:
_this7.cmdService = cmdChars[10];
If you change 10 for 11 (fa0b characteristic instead of fa0a) the drone start accept commands."

Do you have any idea why ? Thanks!

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

@marcosboggia, can you tell which drone you are using? Also paste the logs in here so I can check what's going on.

—Monik

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Hi @marcosboggia,

Can you run the example programs - 'basic-manuever', 'take-picture' and 'download-picture'; and send me the logs for all of them? I've been recently reported about the problems with Airborne Cargo so I'd like to check what's going on in your case.

Regards,
Monik

from dronejs.

cyapa avatar cyapa commented on June 5, 2024

Hi @gandhimonik , thanks for reply. We are using parrot minidrone airborne cargo. Today we made some modifications to your code and got navigation commands working (takeOff, etc). Brief explanation: First, the execution got stuck at "suscribeToNotify" when it suscribe to the last ftpChars. So we made the following "modification" (ugly patch) near line 220 of "/lib/service/MiniDroneService.js":

if ((array.length < 4 && ids.length + 1 === array.length) || (ids.length === array.length)) {
    (0, _debug.debug)('subscribed to characteristics...');
    resolve('success');
}

Its kind of a bypass for that last characteristic so the code could continue executing. After that we realized (debugging other js libraries that worked for us) that these three changes were necessary to make "takeOff" work:

  1. Change _this8.cmdService.write(buffer, false); to _this8.cmdService.write(buffer, true); in "/lib/service/MiniDroneService.js".
  2. Change _this7.cmdService = cmdChars[10]; to _this7.cmdService = cmdChars[11];
  3. Hardcode the buffer creation for "takeOff" command in /lib/controller/MiniDroneController.js at getMiniDroneCmds
    if(cmdName == 'takeOff'){ buffer = new Buffer([0x02, 0x03, 0x02, 0x00, 0x01, 0x00]) }
    We still don't know yet why this is actually working, so maybe you could help us undestand why.
    And finally, we got stuck at listing all pictures. From what we could debug, after we send LIS and the correct media path (the buffer is being created correctly), it seems that the program gets suscribed to the wrong characteristic: 'fb' instead of 'fd2' , so we hope you can help us with that.
    If you need more logging, tomorrow I can debug more and post it here.
    Thanks!

@marcosboggia Thank you for posting this work around! I can finally execute take off! 💯

If you could provide some reasoning behind these modifications, that would be really helpful to enhance this library further :)

from dronejs.

gandhimonik avatar gandhimonik commented on June 5, 2024

Great work folks!!

from dronejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.