Skip to content

Commit 7d19277

Browse files
authored
Merge pull request #72 from sparkfun/release_candidate
Merging v1.9 from release_candidate
2 parents 6b0ece4 + 0b20d73 commit 7d19277

31 files changed

+2798
-1321
lines changed
196 KB
Binary file not shown.
195 KB
Binary file not shown.

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
Change Log
22
======================
33

4+
v1.9
5+
---------
6+
7+
* Allows the TX and RX pins to be used for the serial terminal / console
8+
* This is very cool as it means you can now connect the OLA to your choice of (e.g.) Bluetooth or radio modem and access your data over that instead of USB
9+
* File transfer using ZMODEM is possible on both USB and TX/RX
10+
* Added support for the SGP40 air quality sensor - which provides a robust VOC Index for indoor air quality
11+
* Added support for the SDP3X differential pressure sensor - opening up possibilities for air flow and air speed measurement
12+
* Added support for the MS5837 depth / pressure sensor - as used in the BlueRobotics Bar02
13+
* Corrects an issue which was corrupting data when using multiple MS8607s [62]https://github.com/sparkfun/OpenLog_Artemis/issues/62
14+
* Adds serial logging timestamps with a configurable timestamp token [63](https://github.com/sparkfun/OpenLog_Artemis/issues/63) - thank you @DennisMelamed
15+
* Adds a _slow logging_ feature to extend battery life
16+
* Pin11 can be used to enter slow logging mode [60](https://github.com/sparkfun/OpenLog_Artemis/issues/60) - thank you @ryanneve
17+
* Slow logging can be entered once per day, with configurable start and end time [46](https://github.com/sparkfun/OpenLog_Artemis/issues/46)
18+
* Adds improved support for the SCD30 [67](https://github.com/sparkfun/OpenLog_Artemis/issues/67) - thank you @paulvha
19+
* Corrects a bug in logMicroseconds [57](https://github.com/sparkfun/OpenLog_Artemis/issues/57)
20+
421
v1.8
522
---------
623

Firmware/OpenLog_Artemis/OpenLog_Artemis.ino

Lines changed: 306 additions & 48 deletions
Large diffs are not rendered by default.

Firmware/OpenLog_Artemis/Sensors.ino

Lines changed: 130 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,10 @@ void getData()
99

1010
if (settings.logRTC)
1111
{
12-
//Decide if we are using the internal RTC or GPS for timestamps
13-
if (settings.getRTCfromGPS == false)
14-
{
15-
myRTC.getTime();
16-
17-
if (settings.logDate)
18-
{
19-
char rtcDate[12]; //10/12/2019,
20-
if (settings.americanDateStyle == true)
21-
sprintf(rtcDate, "%02d/%02d/20%02d,", myRTC.month, myRTC.dayOfMonth, myRTC.year);
22-
else
23-
sprintf(rtcDate, "%02d/%02d/20%02d,", myRTC.dayOfMonth, myRTC.month, myRTC.year);
24-
strcat(outputData, rtcDate);
25-
}
26-
27-
if (settings.logTime)
28-
{
29-
char rtcTime[13]; //09:14:37.41,
30-
int adjustedHour = myRTC.hour;
31-
if (settings.hour24Style == false)
32-
{
33-
if (adjustedHour > 12) adjustedHour -= 12;
34-
}
35-
sprintf(rtcTime, "%02d:%02d:%02d.%02d,", adjustedHour, myRTC.minute, myRTC.seconds, myRTC.hundredths);
36-
strcat(outputData, rtcTime);
37-
}
38-
39-
if (settings.logMicroseconds)
40-
{
41-
char microseconds[11]; //
42-
sprintf(microseconds, "%d,", micros());
43-
strcat(outputData, microseconds);
44-
}
45-
} //end if use RTC for timestamp
46-
else //Use GPS for timestamp
47-
{
48-
Serial.println(F("Print GPS Timestamp / not yet implemented"));
49-
}
12+
//Code written by @DennisMelamed in PR #70
13+
char timeString[37];
14+
getTimeString(timeString); // getTimeString is in timeStamp.ino
15+
strcat(outputData, timeString);
5016
}
5117

5218
if (settings.logA11)
@@ -161,8 +127,10 @@ void getData()
161127
uint64_t currentMillis;
162128

163129
//If we are sleeping between readings then we cannot rely on millis() as it is powered down
164-
//Used RTC instead
165-
if (settings.usBetweenReadings >= maxUsBeforeSleep)
130+
//Use RTC instead
131+
if (((settings.useGPIO11ForTrigger == false) && (settings.usBetweenReadings >= maxUsBeforeSleep))
132+
|| (settings.useGPIO11ForFastSlowLogging == true)
133+
|| (settings.useRTCForFastSlowLogging == true))
166134
{
167135
currentMillis = rtcMillis();
168136
}
@@ -254,7 +222,7 @@ void gatherDeviceValues()
254222
{
255223
qwiic.setPullups(0); //Disable pullups to minimize CRC issues
256224

257-
SFE_UBLOX_GPS *nodeDevice = (SFE_UBLOX_GPS *)temp->classPtr;
225+
SFE_UBLOX_GNSS *nodeDevice = (SFE_UBLOX_GNSS *)temp->classPtr;
258226
struct_uBlox *nodeSetting = (struct_uBlox *)temp->configPtr;
259227

260228
if (nodeSetting->log == true)
@@ -803,8 +771,81 @@ void gatherDeviceValues()
803771
}
804772
}
805773
break;
774+
case DEVICE_VOC_SGP40:
775+
{
776+
SGP40 *nodeDevice = (SGP40 *)temp->classPtr;
777+
struct_SGP40 *nodeSetting = (struct_SGP40 *)temp->configPtr;
778+
if (nodeSetting->log == true)
779+
{
780+
if (nodeSetting->logVOC)
781+
{
782+
sprintf(tempData, "%d,", nodeDevice->getVOCindex(nodeSetting->RH, nodeSetting->T));
783+
strcat(outputData, tempData);
784+
}
785+
}
786+
}
787+
break;
788+
case DEVICE_PRESSURE_SDP3X:
789+
{
790+
SDP3X *nodeDevice = (SDP3X *)temp->classPtr;
791+
struct_SDP3X *nodeSetting = (struct_SDP3X *)temp->configPtr;
792+
if (nodeSetting->log == true)
793+
{
794+
float pressure;
795+
float temperature;
796+
if ((nodeSetting->logPressure) || (nodeSetting->logTemperature))
797+
{
798+
nodeDevice->triggeredMeasurement(nodeSetting->massFlow, nodeSetting->clockStretching);
799+
nodeDevice->readMeasurement(&pressure, &temperature);
800+
}
801+
if (nodeSetting->logPressure)
802+
{
803+
sprintf(tempData, "%.02f,", pressure);
804+
strcat(outputData, tempData);
805+
}
806+
if (nodeSetting->logTemperature)
807+
{
808+
sprintf(tempData, "%.02f,", temperature);
809+
strcat(outputData, tempData);
810+
}
811+
}
812+
}
813+
break;
814+
case DEVICE_PRESSURE_MS5837:
815+
{
816+
MS5837 *nodeDevice = (MS5837 *)temp->classPtr;
817+
struct_MS5837 *nodeSetting = (struct_MS5837 *)temp->configPtr;
818+
if (nodeSetting->log == true)
819+
{
820+
if ((nodeSetting->logPressure) || (nodeSetting->logTemperature) || (nodeSetting->logDepth) || (nodeSetting->logAltitude))
821+
{
822+
nodeDevice->read();
823+
}
824+
if (nodeSetting->logPressure)
825+
{
826+
sprintf(tempData, "%.02f,", nodeDevice->pressure(nodeSetting->conversion));
827+
strcat(outputData, tempData);
828+
}
829+
if (nodeSetting->logTemperature)
830+
{
831+
sprintf(tempData, "%.02f,", nodeDevice->temperature());
832+
strcat(outputData, tempData);
833+
}
834+
if (nodeSetting->logDepth)
835+
{
836+
sprintf(tempData, "%.03f,", nodeDevice->depth());
837+
strcat(outputData, tempData);
838+
}
839+
if (nodeSetting->logAltitude)
840+
{
841+
sprintf(tempData, "%.02f,", nodeDevice->altitude());
842+
strcat(outputData, tempData);
843+
}
844+
}
845+
}
846+
break;
806847
default:
807-
Serial.printf("printDeviceValue unknown device type: %s\r\n", getDeviceName(temp->deviceType));
848+
SerialPrintf2("printDeviceValue unknown device type: %s\r\n", getDeviceName(temp->deviceType));
808849
break;
809850
}
810851

@@ -821,19 +862,12 @@ void printHelperText(bool terminalOnly)
821862

822863
if (settings.logRTC)
823864
{
824-
//Decide if we are using the internal RTC or GPS for timestamps
825-
if (settings.getRTCfromGPS == false)
826-
{
827-
if (settings.logDate)
828-
strcat(helperText, "rtcDate,");
829-
if (settings.logTime)
830-
strcat(helperText, "rtcTime,");
831-
if (settings.logMicroseconds)
832-
strcat(helperText, "micros,");
833-
}
834-
} //end if use RTC for timestamp
835-
else //Use GPS for timestamp
836-
{
865+
if (settings.logDate)
866+
strcat(helperText, "rtcDate,");
867+
if (settings.logTime)
868+
strcat(helperText, "rtcTime,");
869+
if (settings.logMicroseconds)
870+
strcat(helperText, "micros,");
837871
}
838872

839873
if (settings.logA11)
@@ -962,7 +996,7 @@ void printHelperText(bool terminalOnly)
962996
if (nodeSetting->logPressure)
963997
strcat(helperText, "pressure_hPa,");
964998
if (nodeSetting->logTemperature)
965-
strcat(helperText, "pressure_degC,");
999+
strcat(helperText, "temperature_degC,");
9661000
}
9671001
}
9681002
break;
@@ -1172,8 +1206,46 @@ void printHelperText(bool terminalOnly)
11721206
}
11731207
}
11741208
break;
1209+
case DEVICE_VOC_SGP40:
1210+
{
1211+
struct_SGP40 *nodeSetting = (struct_SGP40 *)temp->configPtr;
1212+
if (nodeSetting->log)
1213+
{
1214+
if (nodeSetting->logVOC)
1215+
strcat(helperText, "VOCindex,");
1216+
}
1217+
}
1218+
break;
1219+
case DEVICE_PRESSURE_SDP3X:
1220+
{
1221+
struct_SDP3X *nodeSetting = (struct_SDP3X *)temp->configPtr;
1222+
if (nodeSetting->log)
1223+
{
1224+
if (nodeSetting->logPressure)
1225+
strcat(helperText, "Pa,");
1226+
if (nodeSetting->logTemperature)
1227+
strcat(helperText, "degC,");
1228+
}
1229+
}
1230+
break;
1231+
case DEVICE_PRESSURE_MS5837:
1232+
{
1233+
struct_MS5837 *nodeSetting = (struct_MS5837 *)temp->configPtr;
1234+
if (nodeSetting->log)
1235+
{
1236+
if (nodeSetting->logPressure)
1237+
strcat(helperText, "mbar,");
1238+
if (nodeSetting->logTemperature)
1239+
strcat(helperText, "degC,");
1240+
if (nodeSetting->logDepth)
1241+
strcat(helperText, "depth_m,");
1242+
if (nodeSetting->logAltitude)
1243+
strcat(helperText, "alt_m,");
1244+
}
1245+
}
1246+
break;
11751247
default:
1176-
Serial.printf("\nprinterHelperText device not found: %d\r\n", temp->deviceType);
1248+
SerialPrintf2("\nprinterHelperText device not found: %d\r\n", temp->deviceType);
11771249
break;
11781250
}
11791251
}
@@ -1188,7 +1260,7 @@ void printHelperText(bool terminalOnly)
11881260

11891261
strcat(helperText, "\r\n");
11901262

1191-
Serial.print(helperText);
1263+
SerialPrint(helperText);
11921264
if ((terminalOnly == false) && (settings.logData == true) && (online.microSD) && (settings.enableSD && online.microSD))
11931265
sensorDataFile.print(helperText);
11941266
}

0 commit comments

Comments
 (0)