October 23, 2014 at 07:43 PMOct 23, 2014 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.
October 24, 2014 at 07:35 AMOct 24, 2014 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
October 24, 2014 at 07:15 PMOct 24, 2014 Author 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.
October 29, 2014 at 09:13 AMOct 29, 2014 Author Hi TF Ist nicht dringend, aber hattet ihr mal Zeit das nachzustellen? Ich kann den Fehler reproduzieren.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.