legotheboss / YouTube-files

Files for QuickPi tutorials
https://www.youtube.com/QuickPie
109 stars 40 forks source link

DHT11 to HAP-Node #9

Closed Jakkawad closed 7 years ago

Jakkawad commented 7 years ago

when i run Core.js it Error on this

Getting the current temperature! /home/pi/Desktop/HAP-NodeJS/accessories/DHT_accessory.js:18 return sensorLib.initialize(sensor, pinNumber); ^

TypeError: Invalid arguments at TypeError (native) at Object.DHT_SENSOR.initialize (/home/pi/Desktop/HAP-NodeJS/accessories/DHT_accessory.js:18:22) at Object.DHT_SENSOR.getTemperature (/home/pi/Desktop/HAP-NodeJS/accessories/DHT_accessory.js:22:20) at null._repeat (/home/pi/Desktop/HAP-NodeJS/accessories/DHT_accessory.js:70:70) at wrapper [as _onTimeout] (timers.js:270:19) at Timer.listOnTimeout (timers.js:89:15)

how to fix it or config

// SETUP var temperatureNAME = 'DHT Sensor'; //the temperature sensor's name var uuidNAME = 'hap-nodejs:accessories:dht-sensor'; //UUID name var pinNumber = 4 //physical pin 7, BCM pin 4 var sensor = 11 //change to 22 if you have an AM2032 or DHT 22, leave as 11 is you have DHT11 // END of SETUP

legotheboss commented 7 years ago

@Jakkawad Go to line 18 of the file and change the sensor to 11 and pinNumber to 4

legotheboss commented 7 years ago

Commit 3575e7b5307ece51b0fe43e04bf54331f7a3af43 closes #9