Skip to content
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
Binary file added Binaries/OpenLog_Artemis-V10-v18.bin
Binary file not shown.
Binary file added Binaries/OpenLog_Artemis-X04-v18.bin
Binary file not shown.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change Log
======================

v1.8
---------

* Added a fix to make sure the MS8607 is detected correctly [54](https://github.com/sparkfun/OpenLog_Artemis/issues/54)
* Added logMicroseconds [49](https://github.com/sparkfun/OpenLog_Artemis/issues/49)
* Added an option to use autoPVT when logging GNSS data [50](https://github.com/sparkfun/OpenLog_Artemis/issues/50)

v1.7
---------

Expand Down
9 changes: 7 additions & 2 deletions Firmware/OpenLog_Artemis/OpenLog_Artemis.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
This firmware runs the OpenLog Artemis. A large variety of system settings can be
adjusted by connecting at 115200bps.

The Board should be set to SparkFun Apollo3 \ SparkFun RedBoard Artemis ATP.

v1.0 Power Consumption:
Sleep between reads, RTC fully charged, no Qwiic, SD, no USB, no Power LED: 260uA
10Hz logging IMU, no Qwiic, SD, no USB, no Power LED: 9-27mA
Expand Down Expand Up @@ -69,10 +71,13 @@
(done) Add support for the MPRLS0025PA micro pressure sensor
(done) Add support for the SN-GCJA5 particle sensor
(done) Add IMU accelerometer and gyro full scale and digital low pass filter settings to menuIMU
(done) Add a fix to make sure the MS8607 is detected correctly: https://github.com/sparkfun/OpenLog_Artemis/issues/54
(done) Add logMicroseconds: https://github.com/sparkfun/OpenLog_Artemis/issues/49
(done) Add an option to use autoPVT when logging GNSS data: https://github.com/sparkfun/OpenLog_Artemis/issues/50
*/

const int FIRMWARE_VERSION_MAJOR = 1;
const int FIRMWARE_VERSION_MINOR = 7;
const int FIRMWARE_VERSION_MINOR = 8;

//Define the OLA board identifier:
// This is an int which is unique to this variant of the OLA and which allows us
Expand All @@ -82,7 +87,7 @@ const int FIRMWARE_VERSION_MINOR = 7;
// the variant * 0x100 (OLA = 1; GNSS_LOGGER = 2; GEOPHONE_LOGGER = 3)
// the major firmware version * 0x10
// the minor firmware version
#define OLA_IDENTIFIER 0x117 // Stored as 279 decimal in OLA_settings.txt
#define OLA_IDENTIFIER 0x118 // Stored as 280 decimal in OLA_settings.txt

#include "settings.h"

Expand Down
9 changes: 9 additions & 0 deletions Firmware/OpenLog_Artemis/Sensors.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ void getData()
sprintf(rtcTime, "%02d:%02d:%02d.%02d,", adjustedHour, myRTC.minute, myRTC.seconds, myRTC.hundredths);
strcat(outputData, rtcTime);
}

if (settings.logMicroseconds)
{
char microseconds[11]; //
sprintf(microseconds, "%d,", micros());
strcat(outputData, microseconds);
}
} //end if use RTC for timestamp
else //Use GPS for timestamp
{
Expand Down Expand Up @@ -821,6 +828,8 @@ void printHelperText(bool terminalOnly)
strcat(helperText, "rtcDate,");
if (settings.logTime)
strcat(helperText, "rtcTime,");
if (settings.logMicroseconds)
strcat(helperText, "micros,");
}
} //end if use RTC for timestamp
else //Use GPS for timestamp
Expand Down
51 changes: 49 additions & 2 deletions Firmware/OpenLog_Artemis/autoDetect.ino
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,8 @@ void configureDevice(node * temp)

sensor->saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the current ioPortsettings to flash and BBR

//sensor->setAutoPVT(true); //Tell the GPS to "send" each solution
sensor->setAutoPVT(false); //We will poll the device for PVT solutions
sensor->setAutoPVT(nodeSetting->useAutoPVT); // Use autoPVT as required

if (1000000ULL / settings.usBetweenReadings <= 1) //If we are slower than 1Hz logging rate
// setNavigationFrequency expects a uint8_t to define the number of updates per second
// So the slowest rate we can set with setNavigationFrequency is 1Hz
Expand Down Expand Up @@ -1273,6 +1273,7 @@ deviceType_e testDevice(uint8_t i2cAddress, uint8_t muxAddress, uint8_t portNumb

//Given an address, returns the device type if it responds as we would expect
//This version is dedicated to testing muxes and uses a custom .begin to avoid the slippery mux problem
//However, we also need to check if an MS8607 is attached (address 0x76) as it can cause the I2C bus to lock up if not detected correctly
deviceType_e testMuxDevice(uint8_t i2cAddress, uint8_t muxAddress, uint8_t portNumber)
{
switch (i2cAddress)
Expand All @@ -1283,7 +1284,53 @@ deviceType_e testMuxDevice(uint8_t i2cAddress, uint8_t muxAddress, uint8_t portN
case 0x73:
case 0x74:
case 0x75:
{
//Ignore devices we've already recorded. This was causing the mux to get tested, a begin() would happen, and the mux would be reset.
if (deviceExists(DEVICE_MULTIPLEXER, i2cAddress, muxAddress, portNumber) == true) return (DEVICE_MULTIPLEXER);

//Confidence: Medium - Write/Read/Clear to 0x00
if (multiplexerBegin(i2cAddress, qwiic) == true) //Address, Wire port
return (DEVICE_MULTIPLEXER);
}
break;
case 0x76:
{
//Ignore devices we've already recorded. This was causing the mux to get tested, a begin() would happen, and the mux would be reset.
if (deviceExists(DEVICE_MULTIPLEXER, i2cAddress, muxAddress, portNumber) == true) return (DEVICE_MULTIPLEXER);

// If an MS8607 is connected, multiplexerBegin causes the MS8607 to 'crash' and lock up the I2C bus... So we need to check if an MS8607 is connected first.
// We will use the MS5637 as this will test for itself and the pressure sensor of the MS8607
// Just to make life even more complicated, a mux with address 0x76 will also appear as an MS5637 due to the way the MS5637 eeprom crc check is calculated.
// So, we can't use .begin as the test for a MS5637 / MS8607. We need to be more creative!
// If we write 0xA0 to i2cAddress and then read two bytes:
// A mux will return 0xA0A0
// An MS5637 / MS8607 will return the value stored in its eeprom which _hopefully_ is not 0xA0A0!

// Let's hope this doesn't cause problems for the BME280...! We should be OK as the default address for the BME280 is 0x77.

qwiic.beginTransmission((uint8_t)i2cAddress);
qwiic.write((uint8_t)0xA0);
uint8_t i2c_status = qwiic.endTransmission();

if (i2c_status == 0) // If the I2C write was successful
{
qwiic.requestFrom((uint8_t)i2cAddress, 2U); // Read two bytes
uint8_t buffer[2];
for (uint8_t i = 0; i < 2; i++)
{
buffer[i] = qwiic.read();
}
if ((buffer[0] != 0xA0) || (buffer[1] != 0xA0)) // If we read back something other than 0xA0A0 then we are probably talking to an MS5637 / MS8607, not a mux
{
return (DEVICE_PRESSURE_MS5637);
}
}

//Confidence: Medium - Write/Read/Clear to 0x00
if (multiplexerBegin(i2cAddress, qwiic) == true) //Address, Wire port
return (DEVICE_MULTIPLEXER);
}
break;
case 0x77:
{
//Ignore devices we've already recorded. This was causing the mux to get tested, a begin() would happen, and the mux would be reset.
Expand Down
16 changes: 14 additions & 2 deletions Firmware/OpenLog_Artemis/menuAttachedDevices.ino
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ bool detectQwiicDevices()

//First scan for Muxes. Valid addresses are 0x70 to 0x77 (112 to 119).
//If any are found, they will be begin()'d causing their ports to turn off
//testMuxDevice will check if an MS8607 is attached (address 0x76) as it can cause the I2C bus to lock up if we try to detect it as a mux
uint8_t muxCount = 0;
for (uint8_t address = 0x70 ; address < 0x78 ; address++)
{
Expand All @@ -73,6 +74,11 @@ bool detectQwiicDevices()
Serial.printf("detectQwiicDevices: multiplexer found at address 0x%02X\r\n", address);
muxCount++;
}
else if (foundType == DEVICE_PRESSURE_MS5637)
{
if (settings.printDebugMessages == true)
Serial.printf("detectQwiicDevices: MS8607/MS5637 found at address 0x%02X. Ignoring it for now...\r\n", address);
}
}
}

Expand Down Expand Up @@ -901,13 +907,17 @@ void menuConfigure_uBlox(void *configPtr)
if (sensorSetting->logpDOP == true) Serial.println(F("Enabled"));
else Serial.println(F("Disabled"));

Serial.flush();

Serial.print(F("13) Log Interval Time Of Week (iTOW): "));
if (sensorSetting->logiTOW == true) Serial.println(F("Enabled"));
else Serial.println(F("Disabled"));

Serial.printf("14) Set I2C Interface Speed (u-blox modules have pullups built in. Remove *all* I2C pullups to achieve 400kHz): %d\r\n", sensorSetting->i2cSpeed);

Serial.print(F("15) Use autoPVT: "));
if (sensorSetting->useAutoPVT == true) Serial.println(F("Yes"));
else Serial.println(F("No"));

Serial.flush();
}
Serial.println(F("x) Exit"));

Expand Down Expand Up @@ -950,6 +960,8 @@ void menuConfigure_uBlox(void *configPtr)
else
sensorSetting->i2cSpeed = 100000;
}
else if (incoming == 15)
sensorSetting->useAutoPVT ^= 1;
else if (incoming == STATUS_PRESSED_X)
break;
else if (incoming == STATUS_GETNUMBER_TIMEOUT)
Expand Down
10 changes: 8 additions & 2 deletions Firmware/OpenLog_Artemis/menuTimeStamp.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ void menuTimeStamp()
}
Serial.print(F("9) Local offset from UTC: "));
Serial.println(settings.localUTCOffset);

}

Serial.print(F("10) Log Microseconds: "));
if (settings.logMicroseconds == true) Serial.println(F("Enabled"));
else Serial.println(F("Disabled"));

Serial.println(F("x) Exit"));

int incoming = getNumber(menuTimeout); //Timeout after x seconds
Expand All @@ -75,12 +79,14 @@ void menuTimeStamp()
settings.logDate ^= 1;
else if (incoming == 2)
settings.logTime ^= 1;
else if (incoming == 10)
settings.logMicroseconds ^= 1;
else if (incoming == STATUS_PRESSED_X)
return;
else if (incoming == STATUS_GETNUMBER_TIMEOUT)
return;

if (settings.logDate == true || settings.logTime == true)
if ((settings.logDate == true) || (settings.logTime == true))
{
//Options 3, 8, 9
if (incoming == 3)
Expand Down
6 changes: 6 additions & 0 deletions Firmware/OpenLog_Artemis/nvm.ino
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ void recordSystemSettingsToFile()
settingsFile.println("imuAccDLPFBW=" + (String)settings.imuAccDLPFBW);
settingsFile.println("imuGyroFSS=" + (String)settings.imuGyroFSS);
settingsFile.println("imuGyroDLPFBW=" + (String)settings.imuGyroDLPFBW);
settingsFile.println("logMicroseconds=" + (String)settings.logMicroseconds);
updateDataFileAccess(&settingsFile); // Update the file access time & date
settingsFile.close();
}
Expand Down Expand Up @@ -394,6 +395,8 @@ bool parseLine(char* str) {
settings.imuGyroFSS = d;
else if (strcmp(settingName, "imuGyroDLPFBW") == 0)
settings.imuGyroDLPFBW = d;
else if (strcmp(settingName, "logMicroseconds") == 0)
settings.logMicroseconds = d;
else
Serial.printf("Unknown setting %s on line: %s\r\n", settingName, str);

Expand Down Expand Up @@ -471,6 +474,7 @@ void recordDeviceSettingsToFile()
settingsFile.println((String)base + "logpDOP=" + nodeSetting->logpDOP);
settingsFile.println((String)base + "logiTOW=" + nodeSetting->logiTOW);
settingsFile.println((String)base + "i2cSpeed=" + nodeSetting->i2cSpeed);
settingsFile.println((String)base + "useAutoPVT=" + nodeSetting->useAutoPVT);
}
break;
case DEVICE_PROXIMITY_VCNL4040:
Expand Down Expand Up @@ -866,6 +870,8 @@ bool parseDeviceLine(char* str) {
nodeSetting->logiTOW = d;
else if (strcmp(deviceSettingName, "i2cSpeed") == 0)
nodeSetting->i2cSpeed = d;
else if (strcmp(deviceSettingName, "useAutoPVT") == 0)
nodeSetting->useAutoPVT = d;
else
Serial.printf("Unknown device setting: %s\r\n", deviceSettingName);
}
Expand Down
2 changes: 2 additions & 0 deletions Firmware/OpenLog_Artemis/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ struct struct_uBlox {
bool logiTOW = false;
uint32_t i2cSpeed = 100000; //Default to 100kHz for least number of CRC issues
unsigned long powerOnDelayMillis = 1000; // Wait for at least this many millis before communicating with this device
bool useAutoPVT = false; // Use autoPVT - to allow data collection at rates faster than GPS
};

#define VL53L1X_DISTANCE_MODE_SHORT 0
Expand Down Expand Up @@ -349,6 +350,7 @@ struct struct_settings {
int imuAccDLPFBW = 7; // IMU accelerometer DLPF bandwidth - default to acc_d473bw_n499bw (ICM_20948_ACCEL_CONFIG_DLPCFG_e)
int imuGyroFSS = 0; // IMU gyro full scale - default to 250 degrees per second (ICM_20948_GYRO_CONFIG_1_FS_SEL_e)
int imuGyroDLPFBW = 7; // IMU gyro DLPF bandwidth - default to gyr_d361bw4_n376bw5 (ICM_20948_GYRO_CONFIG_1_DLPCFG_e)
bool logMicroseconds = false; // Log micros()
} settings;

//These are the devices on board OpenLog that may be on or offline.
Expand Down