Completing IR-sensor and Temp sensor for Particle cloud---adding time indication...
authorrtrimana <rtrimana@uci.edu>
Thu, 10 May 2018 23:19:46 +0000 (16:19 -0700)
committerrtrimana <rtrimana@uci.edu>
Thu, 10 May 2018 23:19:46 +0000 (16:19 -0700)
version2/src/others/IR-Sensor/IR-Sensor_Particle-Cloud.ino
version2/src/others/IR-Sensor/Makefile
version2/src/others/IR-Sensor/photon_firmware_1525906569609.bin [deleted file]
version2/src/others/RPi/raspberry-pi_firmware_1525886634407.bin [deleted file]
version2/src/others/Temp-Sensor/Makefile
version2/src/others/Temp-Sensor/Temp-Sensor_Particle-Cloud.ino
version2/src/others/Temp-Sensor/photon_firmware_1525907284118.bin [deleted file]
version2/src/others/ino/IR-Sensor/IR-Sensor_Particle-Cloud.ino

index ac9f45fed6f5cd4ff7e293d0d15a4ceb9bf71c04..1e74a7a303ac1911845026a01d33f73fe05994b7 100644 (file)
@@ -8,7 +8,6 @@
 //
 // Based on tutorial: http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/arduino-hc-sr501-motion-sensor-tutorial/
 
-int pirValue; // Place to store read PIR Value
 int64_t machineId;
 // Key and data
 char keyBuffer[80];
@@ -34,7 +33,7 @@ void loop() {
        // Machine ID
        sprintf(keyBuffer, "%04x", machineId);
        // Motion detection
-       sprintf(dataBuffer, "motion-detected");
+       sprintf(dataBuffer, "%s -> motion-detected", Time.timeStr().c_str());
        Particle.publish(keyBuffer, dataBuffer);
        delay(1000);
 
index 456a715752d99f4823dc6e3cdaf93fa7122b4c68..f3ab16b75012b40e6f9f6e6e35bbfa7976db9b01 100644 (file)
@@ -13,11 +13,14 @@ compile:
        rm -f *.bin
        particle compile photon
        
-flash0:
-       particle flash IoT-0 photon*.bin
+flash8:
+       particle flash IoT-8 photon*.bin
 
-flash1:
-       particle flash IoT-1 photon*.bin
+flash9:
+       particle flash IoT-9 photon*.bin
+
+flash10:
+       particle flash IoT-10 photon*.bin
 
 PHONY += clean
 clean:
diff --git a/version2/src/others/IR-Sensor/photon_firmware_1525906569609.bin b/version2/src/others/IR-Sensor/photon_firmware_1525906569609.bin
deleted file mode 100644 (file)
index 6d4abf6..0000000
Binary files a/version2/src/others/IR-Sensor/photon_firmware_1525906569609.bin and /dev/null differ
diff --git a/version2/src/others/RPi/raspberry-pi_firmware_1525886634407.bin b/version2/src/others/RPi/raspberry-pi_firmware_1525886634407.bin
deleted file mode 100644 (file)
index 48e438a..0000000
Binary files a/version2/src/others/RPi/raspberry-pi_firmware_1525886634407.bin and /dev/null differ
index 456a715752d99f4823dc6e3cdaf93fa7122b4c68..9da3c7ea51d4ac4fa7fc3e2d69f30b45ebf34c6c 100644 (file)
@@ -12,12 +12,30 @@ monitor:
 compile:
        rm -f *.bin
        particle compile photon
-       
-flash0:
-       particle flash IoT-0 photon*.bin
 
-flash1:
-       particle flash IoT-1 photon*.bin
+flash3:
+       particle flash IoT-3 photon*.bin
+
+flash4:
+       particle flash IoT-4 photon*.bin
+
+flash5:
+       particle flash IoT-5 photon*.bin
+
+flash6:
+       particle flash IoT-6 photon*.bin
+
+flash7:
+       particle flash IoT-7 photon*.bin
+
+flash11:
+       particle flash IoT-11 photon*.bin
+
+flash12:
+       particle flash IoT-12 photon*.bin
+
+flash13:
+       particle flash IoT-13 photon*.bin
 
 PHONY += clean
 clean:
index 9674a47b44f248023fda1b755a05fff4c93fe1dd..665d7326ba006bf388515fc126f51783c9444521 100644 (file)
@@ -1,9 +1,6 @@
 #include "application.h"
 #include "DHT.h"
 
-SYSTEM_MODE(SEMI_AUTOMATIC)
-SYSTEM_THREAD(ENABLED)
-
 // System defines
 // Arduino
 #define DHTPIN                         2               // Data pin
@@ -48,13 +45,6 @@ void setup() {
        digitalWrite(PWRPIN, HIGH);
        // Arduino DHT
        dht.begin();
-       // Connect to WiFi and Particle cloud
-       // Wait for a maximum amount of time - sleep if WiFi is not connected
-       // Wake up and try again afterwards
-       // TODO: either use this or just WiFi connection (below)
-       Particle.connect();
-       if (!waitFor(Particle.connected, RETRY_TIME))
-               System.sleep(SLEEP_MODE_DEEP, RETRY_SLEEP_TIME);
 
        // Prepare device key from MAC (just last 2 of 6 digits)
        byte mac[6];
diff --git a/version2/src/others/Temp-Sensor/photon_firmware_1525907284118.bin b/version2/src/others/Temp-Sensor/photon_firmware_1525907284118.bin
deleted file mode 100644 (file)
index 00de6d1..0000000
Binary files a/version2/src/others/Temp-Sensor/photon_firmware_1525907284118.bin and /dev/null differ
index ac9f45fed6f5cd4ff7e293d0d15a4ceb9bf71c04..c3be4ab5606c0dbf7b8e695a02b49a0ea472651b 100644 (file)
@@ -8,6 +8,9 @@
 //
 // Based on tutorial: http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/arduino-hc-sr501-motion-sensor-tutorial/
 
+SYSTEM_MODE(SEMI_AUTOMATIC)
+SYSTEM_THREAD(ENABLED)
+
 int pirValue; // Place to store read PIR Value
 int64_t machineId;
 // Key and data