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);
var Blynk = require(ā/usr/lib/node_modules/blynk-libraryā);
var W1Temp = require(ā/usr/lib/node_modules/w1tempā);
var AUTH = āYOUR_TOKEN_HEREā;
// Setup Blynk (SSL)
var blynk = new Blynk.Blynk(AUTH, options={
connector : new Blynk.TcpClient()
});