raphael_vogel Posted October 23, 2014 at 07:43 PM Share Posted October 23, 2014 at 07:43 PM Hi Ich habe einen Master + WLAN + Temperatursensor, alle mit aktueller Firmware. Ich habe den Verdacht, dass wenn ich den WIFI Power Mode zweimal auf LOW_POWER setze, dass es dann einen Fehler gibt. Folgendes node.js script wird alle 15 Minuten aufgerufen var ipcon = new TF.IPConnection(); var masterBrick = new TF.BrickMaster('6esCZX', ipcon); var tempBricklet = new TF.BrickletTemperature('dCf', ipcon); tempBricklet.setI2CMode(TF.BrickletTemperature.I2C_MODE_SLOW); ipcon.connect(HOST, PORT, function(error) { cb("Could not open connection: "+error); }); ipcon.on(TF.IPConnection.CALLBACK_CONNECTED, function(connectReason) { masterBrick.setWifiPowerMode(TF.BrickMaster.WIFI_POWER_MODE_LOW_POWER); tempBricklet.getTemperature( function(temp) { cb(null, temp/100); ipcon.disconnect(); }, function(error) { cb("Could not read temperature: "+error); ipcon.disconnect(); } ); }); Ich bekomme immer "Could not read temperature: 31". Wenn ich die Zeile masterBrick.setWifiPowerMode(TF.BrickMaster.WIFI_POWER_MODE_LOW_POWER); weglasse, dann funktioniert es. Quote Link to comment Share on other sites More sharing options...
borg Posted October 24, 2014 at 07:35 AM Share Posted October 24, 2014 at 07:35 AM Komisch. Kannst du mal ausprobieren tempBricklet.getTemperature mit einer Verzögerung von einer Sekunde oder so aufzurufen? Das geht mit setTimeout: http://nodejs.org/docs/v0.6.1/api/timers.html#setTimeout Quote Link to comment Share on other sites More sharing options...
raphael_vogel Posted October 24, 2014 at 07:15 PM Author Share Posted October 24, 2014 at 07:15 PM hab ich probiert: ipcon.on(TF.IPConnection.CALLBACK_CONNECTED, function(connectReason) { masterBrick.setWifiPowerMode(TF.BrickMaster.WIFI_POWER_MODE_LOW_POWER); // Get temperature setTimeout(function(){ tempBricklet.getTemperature( function(temp) { console.log(null, temp/100); ipcon.disconnect(); }, function(error) { console.log("Could not read temperature: "+error); ipcon.disconnect(); } ); }, 1500); }); hilft nix. Erst wenn ich "masterBrick.setWifiPowerMode" weglasse dann funktioniert es. Quote Link to comment Share on other sites More sharing options...
raphael_vogel Posted October 29, 2014 at 09:13 AM Author Share Posted October 29, 2014 at 09:13 AM Hi TF Ist nicht dringend, aber hattet ihr mal Zeit das nachzustellen? Ich kann den Fehler reproduzieren. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.