From 3a829e8e4f01b40d8e2f22a7c2fba5d15ab0ec2b Mon Sep 17 00:00:00 2001 From: Latitude17 Date: Thu, 15 Mar 2018 17:08:16 -0600 Subject: [PATCH] Update init.js Adjusted LED's --- fs/init.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/init.js b/fs/init.js index e9dcde3..ab5225e 100755 --- a/fs/init.js +++ b/fs/init.js @@ -29,9 +29,11 @@ GPIO.set_int_handler(resetPin, GPIO.INT_EDGE_NEG, function(resetPin) { GPIO.toggle(statusLightPin); Sys.usleep(200000); } - GPIO.write(statusLightPin, 0); - + GPIO.write(statusLightPin, 1); + + // enable bluetooth Cfg.set({bt:{enable:true}}); + // disable and clear wifi-config Cfg.set({wifi:{sta:{enable:false}}}); Cfg.set({wifi:{ap:{enable:false}}}); Cfg.set({wifi:{sta:{ssid:'',pass:''}}}); @@ -63,7 +65,6 @@ let readSensors = Timer.set(5000, Timer.REPEAT, function() { if (deviceId !== "" && connected) { GPIO.write(statusLightPin, 0); - let jsonData = {'DeviceId': deviceId, 'Temperature': t, 'Humidity': h, 'Moisture': m}; HTTP.query({ headers: {'Content-Type' : 'application/json'}, @@ -88,6 +89,7 @@ let readSensors = Timer.set(5000, Timer.REPEAT, function() { else { print("DeviceId:",deviceId,"Connected:",connected); + GPIO.write(statusLightPin, 1); } }, null);