So to avoid posting in the old topic “Beer thermometer with raspberry pi and ds18b20” i’m gonna ask my question here. I follow the instructions and my ds18b20 now works with my rpi2 but i only get 6 readings and then it stops.
Anyone experienced this issue ? I can’t seem to find anything about it on the web. This is what i get :OnOff mode
Connecting to: blynk-cloud.com 8441
SSL authorization…
Connected
Authorized
Actual temp: 23.937 °C
Actual temp: 23.875 °C
Actual temp: 23.875 °C
Actual temp: 24.125 °C
Actual temp: 24.937 °C
Actual temp: 26.687 °C
And this is the code :
var blynkLib = require(‘/usr/lib/node_modules/blynk-library’);
var W1Temp = require(‘/usr/lib/node_modules/w1temp’);
var AUTH = ‘MYTOKEN’;
// Setup Blynk (SSL)
var blynk = new blynkLib.Blynk(AUTH);
W1Temp.setGpioData(4);
// Automatically update sensors value every 5 minutes
setInterval(function() {
W1Temp.getSensor(‘28-8000000365a2’).then(function (sensor) {
// print actual temperature
var temp = sensor.getTemperature();
console.log(‘Actual temp:’, temp, ‘°C’);
//Report it to server
blynk.virtualWrite(0, temp);
});
}, 50000);