sandeepmistry / node-flower-power

node.js lib for the Parrot Flower Power
MIT License
45 stars 32 forks source link

History Data #8

Open JeromeBouvard opened 9 years ago

JeromeBouvard commented 9 years ago

Set of functions to connect to the Flower Power and retrieve the History Data, based on the documentation https://flowerpowerdev.parrot.com/attachments/download/32/FlowerPower-BL E.pdf

dareid commented 9 years ago

+1

pa-bouly commented 9 years ago

You forgot something i think ;)

var CLOCK_SERVICE_UUID =    '39e1FD0084a811e2afba0002a5d5c51b';
var CLOCK_CURRENT_TIME_UUID = '39e1FD0184a811e2afba0002a5d5c51b';
JeromeBouvard commented 9 years ago

indeed :) And there is also a minor issue when downloading big samples, I will update it asap ! Thanks

JeromeBouvard commented 9 years ago

Fix delivered !

kerautret commented 9 years ago

I try it but I have this issue:

calibrated EC porous = 1.47 dS/m getHistoryNbEntries

/home/pi/node-flower-power/index.js:462 var data = data.readUInt16LE(0); ^ TypeError: Cannot call method 'readUInt16LE' of null at FlowerPower. (/home/pi/node-flower-power/index.js:462:19) at Characteristic. (/home/pi/node-flower-power/node_modules/noble/lib/characteristic.js:40:7) at Characteristic.g (events.js:180:16) at Characteristic.EventEmitter.emit (events.js:98:17) at Noble.onRead (/home/pi/node-flower-power/node_modules/noble/lib/noble.js:265:20) at EventEmitter.emit (events.js:106:17) at nobleBindings.onRead (/home/pi/node-flower-power/node_modules/noble/lib/linux/bindings.js:240:8) at EventEmitter.emit (events.js:106:17) at null. (/home/pi/node-flower-power/node_modules/noble/lib/linux/l2cap-ble.js:527:14) at L2capBle.onStdoutData (/home/pi/node-flower-power/node_modules/noble/lib/linux/l2cap-ble.js:164:30)

oroce commented 9 years ago

@kerautret: I submitted a PR against the forked version, as soon as the @Parrot-Developers folks merges it will work, or you can try my branch: https://github.com/oroce/node-flower-power/tree/history

@JeromeBouvard: could you help how could I parse the returned raw data? Or do I have to upload that to parrot cloud?

bsautron commented 8 years ago
FlowerPower.prototype.readData = function(service, uuid, methodeRead, callback) {
    this.readDataCharacteristic(service, uuid, function(error, data) {
        if (error || !data) callback(error || 'Error: no data');
        else callback(error, data[methodeRead](0));
    }.bind(this));
};

// and if you want read a characteristics
FlowerPower.prototype.getHistoryNbEntries = function(callback) {
    this.readData(HISTORY_SERVICE_UUID, HISTORY_NB_ENTRIES_UUID, "readUInt16LE", callback);
};

https://github.com/Parrot-Developers/node-flower-power-cloud/

tytytouch commented 3 years ago

Would it be possible to provide the parrot firmware file 2016-09-14_hawaii-2.0.3_hardware-config-MP.bin in order to upgrade a flowerpower which has the first version of the firmware please? The parrot servers are no longer accessible I am very annoyed :).

LupoLucario commented 3 years ago

Would it be possible to provide the parrot firmware file 2016-09-14_hawaii-2.0.3_hardware-config-MP.bin in order to upgrade a flowerpower which has the first version of the firmware please? The parrot servers are no longer accessible I am very annoyed :).

Here is a link to the file: http://hawaii2-web-service-prod-firmware.s3.amazonaws.com/2016-09-14_hawaii-2.0.3_hardware-config-MP.bin

bobnwieve commented 2 years ago

Would it be possible to provide the parrot firmware file 2016-09-14_hawaii-2.0.3_hardware-config-MP.bin in order to upgrade a flower power which has the first version of the firmware please? The parrot servers are no longer accessible I am very annoyed :).

Were you able to get yours updated? I'm missing something in my steps