Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FNGPRINT & SPIFFS fixes #119

Merged
merged 5 commits into from
May 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/IOTAppStory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ String IOTAppStory::servHdlDevInfo(){
retHtml.replace(F("{cid}"), String(ESP_GETCHIPID));
retHtml.replace(F("{fid}"), String(ESP_GETFLASHCHIPID));

#if HTTPS_8266_TYPE == FNGPRINT
#if defined ESP8266 && HTTPS_8266_TYPE == FNGPRINT
retHtml.replace(F("{f}"), config.sha1);
#endif

Expand Down Expand Up @@ -1647,7 +1647,7 @@ String IOTAppStory::strCertScan(String path){
#endif

//Initialize File System
if(!SPIFFS.begin()){
if(!ESP_SPIFFSBEGIN){
#if DEBUG_LVL >= 3
DEBUG_PRINT(F(" SPIFFS Mount Failed"));
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/IOTAppStory.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

char deviceName[STRUCT_BNAME_SIZE];
char compDate[STRUCT_COMPDATE_SIZE]; // saved compile date time
#if HTTPS_8266_TYPE == FNGPRINT
#if defined ESP8266 && HTTPS_8266_TYPE == FNGPRINT
char sha1[60];
#endif
#if CFG_AUTHENTICATE == true
Expand Down Expand Up @@ -118,7 +118,7 @@

const char HTTP_APP_INFO[] PROGMEM = "{\"l\":\"{l}\", \"v\":\"{v}\", \"n\":\"{n}\", \"m\":\"{m}\", \"t\":\"{t}\"}";

#if HTTPS_8266_TYPE == FNGPRINT
#if defined ESP8266 && HTTPS_8266_TYPE == FNGPRINT
const char HTTP_DEV_INFO[] PROGMEM = "{\"s1\":\"{s1}\", \"s2\":\"{s2}\", \"s3\":\"{s3}\", \"cid\":\"{cid}\", \"fid\":\"{fid}\", \"fss\":\"{fss}\", \"ss\":\"{ss}\", \"fs\":\"{fs}\", \"ab\":\"{ab}\", \"ac\":\"{ac}\", \"mc\":\"{mc}\", \"xf\":\"{xf}\", \"f\":\"{f}\"}";
#else
const char HTTP_DEV_INFO[] PROGMEM = "{\"s1\":\"{s1}\", \"s2\":\"{s2}\", \"s3\":\"{s3}\", \"cid\":\"{cid}\", \"fid\":\"{fid}\", \"fss\":\"{fss}\", \"ss\":\"{ss}\", \"fs\":\"{fs}\", \"ab\":\"{ab}\", \"ac\":\"{ac}\", \"mc\":\"{mc}\", \"xf\":\"{xf}\"}";
Expand Down Expand Up @@ -146,7 +146,7 @@
{"","",""},
"yourESP",
"",
#if HTTPS_8266_TYPE == FNGPRINT
#if defined ESP8266 && HTTPS_8266_TYPE == FNGPRINT
HTTPS_FNGPRINT,
#endif
#if CFG_AUTHENTICATE == true
Expand Down
8 changes: 5 additions & 3 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@
#define MAGICEEP "%"


// define for get chip id

#if defined ESP8266
#define ESP_GETCHIPID ESP.getChipId()
#define ESP_GETFLASHCHIPID ESP.getFlashChipId()
#define ESP_GETCHIPID ESP.getChipId() // define for get chip id
#define ESP_GETFLASHCHIPID ESP.getFlashChipId() // define for get flash chip id
#define ESP_SPIFFSBEGIN SPIFFS.begin() // define for SPIFFS.begin()
#elif defined ESP32
#define ESP_GETCHIPID (uint32_t)ESP.getEfuseMac()
#define ESP_GETFLASHCHIPID (uint32_t)g_rom_flashchip.device_id
#define ESP_SPIFFSBEGIN SPIFFS.begin(true)
#endif
2 changes: 1 addition & 1 deletion src/espressif/configServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void configServer::run(){
bool exitConfig = false;

#if CFG_STORAGE == ST_SPIFFS || CFG_STORAGE == ST_HYBRID
if(!SPIFFS.begin()){
if(!ESP_SPIFFSBEGIN){
#if DEBUG_LVL >= 1
DEBUG_PRINT(F(" SPIFFS Mount Failed"));
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/espressif/esp32/callServer_WiFiClientSecure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
#endif

// Start SPIFFS and load partition
if(!SPIFFS.begin()){
if(!ESP_SPIFFSBEGIN){
(*_statusMessage) = SER_SPIFFS_PART_NOT_FOUND;
return false;
}
Expand Down