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

TypeError: Cannot read property 'name' of undefined for Mambo #8

Closed hadfield closed 6 years ago

hadfield commented 6 years ago

this occurs with the CheckAllStates function, and pops up in some other cases also.

here is the log of the CheckAllStates example:

Creating observer... scanning devices... peripheral discovered: Mambo_651045 at promixity: -45 scanning stopped... handshake completed... proximity updated to: -44 services found: {"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":"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"]} 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":"9a66fe010800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse","write"]},{"uuid":"9a66fe020800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]} subscribed to characteristics... subscribed to characteristics... Creating observable... Creating observable... Drone connected successfully Sending Command... [ '2', '1', '0', '18', '2', '0', '52', '46', '48', '46', '48', '46', '52', '0' ] Navdata: { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' } } { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' } } [ '2', '2', '0', '5', '1', '0', '61' ] Navdata: { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 61 } } { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 61 } } [ '2', '3', '0', '30', '0', '0', '0' ] Navdata: { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 61 }, runIdChanged: { runId: '\u0000' } } { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 61 }, runIdChanged: { runId: '\u0000' } } [ '2', '4', '0', '5', '11', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0' ] Navdata: { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 61 }, runIdChanged: { runId: '\u0000' }, deprecatedMassStorageContentChanged: { mass_storage_id: 0, nbPhotos: 0, nbVideos: 0, nbPuds: 0, nbCrashLogs: 0 } } { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 61 }, runIdChanged: { runId: '\u0000' }, deprecatedMassStorageContentChanged: { mass_storage_id: 0, nbPhotos: 0, nbVideos: 0, nbPuds: 0, nbCrashLogs: 0 } } [ '2', '5', '2', '3', '1', '0', '0', '0', '0', '0' ] Navdata: { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 61 }, runIdChanged: { runId: '\u0000' }, deprecatedMassStorageContentChanged: { mass_storage_id: 0, nbPhotos: 0, nbVideos: 0, nbPuds: 0, nbCrashLogs: 0 }, flyingStateChanged: { state: 'landed' } } { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 61 }, runIdChanged: { runId: '\u0000' }, deprecatedMassStorageContentChanged: { mass_storage_id: 0, nbPhotos: 0, nbVideos: 0, nbPuds: 0, nbCrashLogs: 0 }, flyingStateChanged: { state: 'landed' } } [ '2', '6', '0', '29', '3', '0', '5', '0', '0', '0', '1', '0', '0', '0', '5', '65' ] Navdata: { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 61 }, runIdChanged: { runId: '\u0000' }, deprecatedMassStorageContentChanged: { mass_storage_id: 0, nbPhotos: 0, nbVideos: 0, nbPuds: 0, nbCrashLogs: 0 }, flyingStateChanged: { state: 'landed' }, chargingInfo: { phase: 'DISCHARGING', rate: 'SLOW', intensity: 5, fullChargingTime: 65 } } { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 61 }, runIdChanged: { runId: '\u0000' }, deprecatedMassStorageContentChanged: { mass_storage_id: 0, nbPhotos: 0, nbVideos: 0, nbPuds: 0, nbCrashLogs: 0 }, flyingStateChanged: { state: 'landed' }, chargingInfo: { phase: 'DISCHARGING', rate: 'SLOW', intensity: 5, fullChargingTime: 65 } } [ '2', '7', '2', '25', '0', '0', '0' ] observable disposed /Users/hadfield/Local/vital-git/haley-parrot-drone/node_modules/rxjs/Subscriber.js:243 throw err; ^

TypeError: Cannot read property 'name' of undefined at MiniDroneController.parseData (/Users/hadfield/Local/vital-git/haley-parrot-drone/node_modules/dronejs/lib/controllers/MiniDroneController.js:271:21) at SafeSubscriber._next (/Users/hadfield/Local/vital-git/haley-parrot-drone/node_modules/dronejs/lib/controllers/MiniDroneController.js:183:34) at SafeSubscriber.__tryOrUnsub (/Users/hadfield/Local/vital-git/haley-parrot-drone/node_modules/rxjs/Subscriber.js:239:16) at SafeSubscriber.next (/Users/hadfield/Local/vital-git/haley-parrot-drone/node_modules/rxjs/Subscriber.js:186:22) at Subscriber._next (/Users/hadfield/Local/vital-git/haley-parrot-drone/node_modules/rxjs/Subscriber.js:126:26) at Subscriber.next (/Users/hadfield/Local/vital-git/haley-parrot-drone/node_modules/rxjs/Subscriber.js:90:18) at DistinctUntilChangedSubscriber._next (/Users/hadfield/Local/vital-git/haley-parrot-drone/node_modules/rxjs/operators/distinctUntilChanged.js:103:30) at DistinctUntilChangedSubscriber.Subscriber.next (/Users/hadfield/Local/vital-git/haley-parrot-drone/node_modules/rxjs/Subscriber.js:90:18) at Characteristic. (/Users/hadfield/Local/vital-git/haley-parrot-drone/node_modules/dronejs/lib/services/MiniDroneService.js:238:34) at Characteristic.emit (events.js:160:13)

gandhimonik commented 6 years ago

Hi,

I see the byte code sent to the drone is [ '2', '1', '0', '18', '2', '0', '52', '46', '48', '46', '48', '46', '52', '0' ] which is not the command for checking all states of the drone. Its for setting the version for the libARCommands in the drone. And I don't have this function implemented in the view to support this command.

If you'd like to check the states of the drone, try to execute the checkAllStates example I have given as-is and let me know if it works.

Regards!

hadfield commented 6 years ago

the above log was using checkAllStates method directly from git with no change other than setting the device id.

using the exact example code, this is the error: node examples/check-all-states.js Creating observer... scanning devices... peripheral discovered: Mambo_651045 at promixity: -20 scanning stopped... scanning devices... scanning devices... handshake completed... peripheral discovered: Mambo_651045 at promixity: -20 proximity updated to: -49 services found: {"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":"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"]} 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":"9a66fe010800919111e4012d1540cb8e","name":null,"type":null,"properties":["writeWithoutResponse","write"]},{"uuid":"9a66fe020800919111e4012d1540cb8e","name":null,"type":null,"properties":["read","writeWithoutResponse","write","notify"]} subscribed to characteristics... subscribed to characteristics... Creating observable... Creating observable... Drone connected successfully Sending Command... [ '2', '1', '0', '18', '2', '0', '52', '46', '48', '46', '48', '46', '52', '0' ] Navdata: { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' } } { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' } } [ '2', '2', '0', '5', '1', '0', '46' ] Navdata: { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 46 } } { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 46 } } [ '2', '3', '0', '30', '0', '0', '0' ] Navdata: { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 46 }, runIdChanged: { runId: '\u0000' } } { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 46 }, runIdChanged: { runId: '\u0000' } } [ '2', '4', '0', '5', '11', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0' ] Navdata: { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 46 }, runIdChanged: { runId: '\u0000' }, deprecatedMassStorageContentChanged: { mass_storage_id: 0, nbPhotos: 0, nbVideos: 0, nbPuds: 0, nbCrashLogs: 0 } } { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 46 }, runIdChanged: { runId: '\u0000' }, deprecatedMassStorageContentChanged: { mass_storage_id: 0, nbPhotos: 0, nbVideos: 0, nbPuds: 0, nbCrashLogs: 0 } } [ '2', '5', '2', '3', '1', '0', '0', '0', '0', '0' ] Navdata: { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 46 }, runIdChanged: { runId: '\u0000' }, deprecatedMassStorageContentChanged: { mass_storage_id: 0, nbPhotos: 0, nbVideos: 0, nbPuds: 0, nbCrashLogs: 0 }, flyingStateChanged: { state: 'landed' } } { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 46 }, runIdChanged: { runId: '\u0000' }, deprecatedMassStorageContentChanged: { mass_storage_id: 0, nbPhotos: 0, nbVideos: 0, nbPuds: 0, nbCrashLogs: 0 }, flyingStateChanged: { state: 'landed' } } [ '2', '6', '0', '29', '3', '0', '5', '0', '0', '0', '1', '0', '0', '0', '5', '65' ] Navdata: { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 46 }, runIdChanged: { runId: '\u0000' }, deprecatedMassStorageContentChanged: { mass_storage_id: 0, nbPhotos: 0, nbVideos: 0, nbPuds: 0, nbCrashLogs: 0 }, flyingStateChanged: { state: 'landed' }, chargingInfo: { phase: 'DISCHARGING', rate: 'SLOW', intensity: 5, fullChargingTime: 65 } } { deviceLibARCommandsVersion: { version: '4.0.0.4\u0000' }, batteryStateChanged: { percent: 46 }, runIdChanged: { runId: '\u0000' }, deprecatedMassStorageContentChanged: { mass_storage_id: 0, nbPhotos: 0, nbVideos: 0, nbPuds: 0, nbCrashLogs: 0 }, flyingStateChanged: { state: 'landed' }, chargingInfo: { phase: 'DISCHARGING', rate: 'SLOW', intensity: 5, fullChargingTime: 65 } } [ '2', '7', '2', '25', '0', '0', '0' ] observable disposed /Users/hadfield/Local/external-git/DroneJS/node_modules/rxjs/Subscriber.js:243 throw err; ^

TypeError: Cannot read property 'name' of undefined at MiniDroneController.parseData (/Users/hadfield/Local/external-git/DroneJS/lib/controllers/MiniDroneController.js:271:21) at SafeSubscriber._next (/Users/hadfield/Local/external-git/DroneJS/lib/controllers/MiniDroneController.js:183:34) at SafeSubscriber.__tryOrUnsub (/Users/hadfield/Local/external-git/DroneJS/node_modules/rxjs/Subscriber.js:239:16) at SafeSubscriber.next (/Users/hadfield/Local/external-git/DroneJS/node_modules/rxjs/Subscriber.js:186:22) at Subscriber._next (/Users/hadfield/Local/external-git/DroneJS/node_modules/rxjs/Subscriber.js:126:26) at Subscriber.next (/Users/hadfield/Local/external-git/DroneJS/node_modules/rxjs/Subscriber.js:90:18) at DistinctUntilChangedSubscriber._next (/Users/hadfield/Local/external-git/DroneJS/node_modules/rxjs/operators/distinctUntilChanged.js:103:30) at DistinctUntilChangedSubscriber.Subscriber.next (/Users/hadfield/Local/external-git/DroneJS/node_modules/rxjs/Subscriber.js:90:18) at Characteristic. (/Users/hadfield/Local/external-git/DroneJS/lib/services/MiniDroneService.js:238:34) at Characteristic.emit (events.js:160:13)

hadfield commented 6 years ago

as per above, the last bytecode being sent before the error is: [ '2', '7', '2', '25', '0', '0', '0' ], although i'm not sure if the logging of "examples/check-all-states.js" is completely synchronized.

gandhimonik commented 6 years ago

Ok I get it now, there has been an update in the list of commands and the byte codes sent back by the drone as navigation data.

I'll update the library with the latest commands. Thanks for finding this out.

hadfield commented 6 years ago

great!

gandhimonik commented 6 years ago

Hey,

I have updated the commands JSON with the latest commands. I've create a branch called dev and pushed the changes there.

Can you please try and let me know if it works for you?

Git Commit: 15aba63b6de0baf1bd62c63907e5392a48378c1b

gandhimonik commented 6 years ago

Hey,

I've published the library with the latest version of commands. Can you please try out and let me know if its fine for your drone.

Regards, Monik