Open Elambaruthi opened 7 years ago
@Elambaruthi could you please share some minimum code to reproduce the issue?
What firmware version do you have installed on the device?
To reproduce, we only have to run test.js: ecb, ea, ecPorous do not return values Issue #18 is related to this as well.
pi@PlantCare:~/node_modules/flower-power $ node test.js connectAndSetup readSystemId system id = a0:14:3d:00:00:0d:8a:61 readSerialNumber serial number = PI040307AA4E029422����� readFirmwareRevision firmware revision = 2016-09-14_hawaii-2.0.3_hardware-config-MP readHardwareRevision hardware revision = 2013-07-26_hawaiiProduction-1.2_protoDV-bootloader readManufacturerName manufacturer name = Parrot readBatteryLevel battery level = 59 readColor color = blue readSunlight sunlight = 0.13 mol/m²/d readSoilTemperature soil temperature = 18.98°C readAirTemperature air temperature = 20.70°C readSoilMoisture soil moisture = 18.91% readCalibratedSoilMoisture calibrated soil moisture = 27.64% readCalibratedAirTemperature calibrated air temperature = 21.64°C readCalibratedSunlight calibrated sunlight = 0.10 mol/m²/d readCalibratedEa /home/pi/node_modules/flower-power/test.js:197 console.log('calibrated EA = ' + ea.toFixed(2)); ^
TypeError: Cannot read property 'toFixed' of undefined at /home/pi/node_modules/flower-power/test.js:197:50 at /home/pi/node_modules/noble-device/lib/noble-device.js:228:14 at FlowerPower.NobleDevice.readDataCharacteristic (/home/pi/node_modules/noble-device/lib/noble-device.js:100:12) at FlowerPower.NobleDevice.readFloatLECharacteristic (/home/pi/node_modules/noble-device/lib/noble-device.js:226:8) at FlowerPower.readCalibratedEa (/home/pi/node_modules/flower-power/index.js:313:8) at /home/pi/node_modules/flower-power/test.js:198:25 at /home/pi/node_modules/async/dist/async.js:3686:9 at replenish (/home/pi/node_modules/async/dist/async.js:882:17) at iterateeCallback (/home/pi/node_modules/async/dist/async.js:867:17) at /home/pi/node_modules/async/dist/async.js:840:16
it is firmWare "2016-09-14_hawaii-2.0.3" @sandeepmistry
router.get('/ea',function(req, res, next){ res.send(global.ea); res.send(JSON.stringify({ sunlight: global.sunlight})); });
router.get('/ecb',function(req, res, next){ res.sendStatus(global.ecb); res.send(JSON.stringify({ sunlight: global.sunlight})); });
router.get('/ecPorous',function(req, res, next){ myFlowerPower.readCalibratedEcPorous(function(error, ecPorous){ res.send(JSON.stringify({ ecPorous: ecPorous})); }); });
It happened after the firmware upgrade @sandeepmistry
What's the value of the error
argument?
flowerPower.on('calibratedEaChange', callback(ea)); flowerPower.on('calibratedEcbChange', callback(ecb)); flowerPower.on('calibratedEcPorousChange', callback(ecPorous));
Node says ecb, ea, ecPorous are undefined values. Please help me with this.