8. Modify the arduino bridge sketch
111 if (pin == 8) {
112 h = dht.readHumidity();
113 t = dht.readTemperature();
114 if (isnan(h) || isnan(t)) {
115 client.println("Failed to read from the DHT sensor!");
116 return;
117 }
118 client.print("Temperature: ");
119 client.print(t);
120 client.print("C Humidity: ");
121 client.println(h);
122 return;
123 }
9. Prepare the YUN
● Install the missing software
– opkg install bash bc git
● Create the holding dir
– mkdir -p /www/t/js
● Download the js libs itno /www/t/js
● git clone
https://github.com/hackman/home-thermostat
10. Setup
● temp.sh
● add the cron job
● temp.sh collects the temp and stores it in
out_stats.js
● temp.sh also rotates old data into log_stats.js
● Ajax request from t.html to change.sh turns the
system on for at least 30min
● Ajax request from t.html to temp_logs.sh list the last
actions