Skip to content

Commit 60fa558

Browse files
authored
Update motionDetector.ino
1 parent b8c9996 commit 60fa558

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

motionDetector.ino

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <AsyncTCP.h>
77
#include <EEPROM.h>
88
#include <FS.h>
9-
#include "LITTLEFS.h"
9+
#include "SPIFFS.h"
1010
#include <SPIFFSEditor.h>
1111
#include "time.h"
1212
#include <TinyMqtt.h> // Thanks to https://github.com/hsaturn/TinyMqtt
@@ -49,8 +49,8 @@ uint8_t receivedCommand[6],showConfig[20];
4949
const char* ntpServer = "pool.ntp.org";
5050
unsigned long time_now, epoch, lastDetected; // Epoch time at which last motion level detected above trigger threshold.
5151

52-
#define MYFS LITTLEFS
53-
#define FORMAT_LITTLEFS_IF_FAILED true
52+
#define MYFS SPIFFS
53+
#define FORMAT_SPIFFS_IF_FAILED true
5454

5555
MqttBroker broker(1883);
5656
MqttClient myClient(&broker);
@@ -100,7 +100,7 @@ unsigned long getTime() {time_t now;if (!getLocalTime(&timeinfo)) {Serial.printl
100100
void setup(){
101101
Serial.begin(115200);
102102
delay(500);
103-
LITTLEFS.begin();
103+
SPIFFS.begin();
104104
EEPROM.begin(512);
105105

106106
#if FIRSTTIME
@@ -174,7 +174,7 @@ void loop()
174174

175175
graphData = ",";graphData += lastDetected;graphData += ",";graphData += motionLevel;graphData += ",";graphData += RSSIlevel;graphData += ",";graphData += fatherPing;graphData += ",";graphData += motherPing;graphData += ",";graphData += sonPing;graphData += ",";graphData += daughterPing;graphData += "]";
176176

177-
File f = LITTLEFS.open(dataFile, "r+"); Serial.print("File size: "); Serial.println(f.size()); // See https://github.com/lorol/LITTLEFS/issues/33
177+
File f = SPIFFS.open(dataFile, "r+"); Serial.print("File size: "); Serial.println(f.size()); // See https://github.com/lorol/LITTLEFS/issues/33
178178
f.seek((f.size()-1), SeekSet);Serial.print("Position: "); Serial.println(f.position());
179179
f.print(graphData);Serial.println();Serial.print("Appended to file: "); Serial.println(graphData);Serial.print("File size: "); Serial.println(f.size());
180180
f.close();

0 commit comments

Comments
 (0)