Skip to content

Commit

Permalink
Merge pull request #263 from boblemaire/staged
Browse files Browse the repository at this point in the history
Staged
  • Loading branch information
boblemaire authored Feb 27, 2020
2 parents 65ceab6 + c5c6472 commit cec2eaa
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
8 changes: 5 additions & 3 deletions Firmware/IotaWatt/IotaLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ int IotaLog::begin (const char* path ){
if(!SD.exists(_path)){
if(logPath.lastIndexOf('/') > 0){
String dir = logPath.substring(0,logPath.lastIndexOf('/'));
if( ! SD.mkdir(dir)){
Serial.printf_P(PSTR("mkdir failed: %s\r\n"), dir.c_str());
return 2;
if( ! SD.exists(dir)){
if( ! SD.mkdir(dir)){
Serial.printf_P(PSTR("mkdir failed: %s\r\n"), dir.c_str());
return 2;
}
}
}
IotaFile = SD.open(_path, FILE_WRITE);
Expand Down
2 changes: 1 addition & 1 deletion Firmware/IotaWatt/IotaWatt.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
***********************************************************************************/
#define IOTAWATT_VERSION "02_05_04"
#define IOTAWATT_VERSION "02_05_05"
#define DEVICE_NAME "IotaWatt"

#define PRINT(txt,val) Serial.print(txt); Serial.print(val); // Quick debug aids
Expand Down
1 change: 1 addition & 0 deletions Firmware/IotaWatt/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
* 01/19/20 02_05_03 Update use versions.json, derived phase-phase support, Issue #252 query seconds, Fix Graph+ delete,
* Fix and improve authorization, instantiate WiFiManager in local scope.
* 02/12/20 02_05_04 Update to core 2.6.3, Fix URL handling influx, fix heap requirement issues during config start and update.
* 02/27/20 02_05_05 Fix problem creating datalogs
*
*****************************************************************************************************/

Expand Down
7 changes: 6 additions & 1 deletion Firmware/IotaWatt/historyLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ uint32_t historyLog(struct serviceBlock* _serviceBlock){
switch(state){

case initialize: {
trace(T_history,1);
trace(T_history,1);

if(_serviceBlock->priority != priorityLow){
_serviceBlock->priority = priorityLow;
return 1;
}

// If iotaLog not open or empty, check back later.

Expand Down
2 changes: 1 addition & 1 deletion Firmware/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ lib_deps = [email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

# default environment, compile and upload using; `$ pio run -t upload`
[env:iotawatt]
Expand Down

0 comments on commit cec2eaa

Please sign in to comment.