Skip to content

Merge v4.0 #743

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

Merged
merged 36 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
65e4fe2
Add print during resistor ID check
nseidle Nov 2, 2023
13cecec
Increase default Bluetooth SPP RX buffer
nseidle Dec 12, 2023
82f2d26
Use modern sync() for compatibility with newer ESP cores.
nseidle Dec 12, 2023
9fe73c9
Add ability to disable RADIO/DATA ports
nseidle Dec 12, 2023
232072a
Add ability to disable ZED USB port
nseidle Dec 12, 2023
331d1fe
Increase ID tolerance. Modify ID threshold calculation.
nseidle Dec 13, 2023
5c497cc
Add GetKeys menu to display on L-Band units.
nseidle Dec 13, 2023
3218512
Convert Serial prints to systemPrints.
nseidle Dec 13, 2023
97ff64b
Increase version number
nseidle Dec 13, 2023
04a4aed
Update form.h via Python
github-actions[bot] Dec 13, 2023
fbe84da
Fix display sort order
nseidle Dec 13, 2023
ccfc924
Merge branch 'release_candidate' of https://github.com/sparkfun/Spark…
nseidle Dec 13, 2023
af5b104
Update form.h via Python
github-actions[bot] Dec 13, 2023
44fbb6b
Add "No SSIDs" error display.
nseidle Dec 13, 2023
38c39fc
Update form.h via Python
github-actions[bot] Dec 13, 2023
9d7b313
Correctly start/stop Bluetooth during key update
nseidle Dec 13, 2023
ba62573
Update form.h via Python
github-actions[bot] Dec 13, 2023
010a50a
Whitespace format
nseidle Dec 19, 2023
f99b8ff
Move log_ds to debugLBand prints
nseidle Dec 19, 2023
c99cc01
Output "Account Expired" if device is detected as deactivated.
nseidle Dec 19, 2023
04b5a2b
Add debugWiFiConfig. Change log_ds to prints.
nseidle Dec 27, 2023
9f8a951
L-Band: Display not listed if whitelist error is seen.
nseidle Dec 27, 2023
a13e053
Fix typo
nseidle Dec 27, 2023
04eef22
Correctly set WiFi protocol when entering AP mode.
nseidle Dec 27, 2023
89a1090
Change to station before setting WiFi protocols.
nseidle Dec 27, 2023
9f6d954
Display No SSIDs error if a caller calls for WiFi.
nseidle Dec 27, 2023
7231e20
Display RTK Config when local WiFi config fails.
nseidle Dec 27, 2023
5a41e7e
Update form.h via Python
github-actions[bot] Dec 27, 2023
60b6b7d
L-Band: Always print the HTTP response error.
nseidle Dec 27, 2023
894a26b
Update form.h via Python
github-actions[bot] Dec 27, 2023
59f79f9
Fix version checking when doing OTA
nseidle Dec 27, 2023
66fdc10
Update form.h via Python
github-actions[bot] Dec 27, 2023
f03c487
Increase major version number
nseidle Dec 27, 2023
65254c6
Merge branch 'release_candidate' of https://github.com/sparkfun/Spark…
nseidle Dec 27, 2023
8ed2e6b
Update form.h via Python
github-actions[bot] Dec 27, 2023
3356b72
Merge branch 'main' into release_candidate
nseidle Dec 27, 2023
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 .github/workflows/compile-rtk-firmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:

env:
FILENAME_PREFIX: RTK_Surveyor_Firmware
FIRMWARE_VERSION_MAJOR: 3
FIRMWARE_VERSION_MINOR: 10
FIRMWARE_VERSION_MAJOR: 4
FIRMWARE_VERSION_MINOR: 0
POINTPERFECT_TOKEN: ${{ secrets.POINTPERFECT_TOKEN }}

jobs:
Expand Down
114 changes: 55 additions & 59 deletions Firmware/RTK_Surveyor/Begin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,37 @@ Begin.ino
// Constants
//----------------------------------------

#define MAX_ADC_VOLTAGE 3300 // Millivolts
#define MAX_ADC_VOLTAGE 3300 // Millivolts

// Testing shows the combined ADC+resistors is under a 1% window
#define TOLERANCE 4.75 // Percent: 95.25% - 104.75%
#define TOLERANCE 5.20 // Percent: 94.8% - 105.2%

//----------------------------------------
// Hardware initialization functions
//----------------------------------------

// ADC input
// Ra KOhms | Rb KOhms
// MAX_ADC_VOLTAGE -----/\/\/\/\-----+-----/\/\/\/\----- Ground
//

// Determine if the measured value matches the product ID value
bool idWithAdc(uint16_t mvMeasured, float resVcc, float resGnd)
// idWithAdc applies resistor tolerance using worst-case tolerances:
// Upper threshold: R1 down by TOLERANCE, R2 up by TOLERANCE
// Lower threshold: R1 up by TOLERANCE, R2 down by TOLERANCE
bool idWithAdc(uint16_t mvMeasured, float r1, float r2)
{
uint16_t lowerThreshold;
float raK;
float rbK;
uint16_t upperThreshold;
float voltage;

// Compute the upper threshold
raK = resVcc * (1.0 - (TOLERANCE / 100.));
rbK = resGnd * (1.0 + (TOLERANCE / 100.));
voltage = MAX_ADC_VOLTAGE * rbK / (raK + rbK);
upperThreshold = (int)ceil(voltage);

// Compute the lower threshold
raK = (double)resVcc * (1.0 + (TOLERANCE / 100.));
rbK = (double)resGnd * (1.0 - (TOLERANCE / 100.));
voltage = MAX_ADC_VOLTAGE * rbK / (raK + rbK);
lowerThreshold = (int)floor(voltage);
float lowerThreshold;
float upperThreshold;

// ADC input
// r1 KOhms | r2 KOhms
// MAX_ADC_VOLTAGE -----/\/\/\/\-----+-----/\/\/\/\----- Ground

// Return true if the mvMeasured value is within the tolerance range
// of the mvProduct value
upperThreshold = ceil(MAX_ADC_VOLTAGE * (r2 * (1.0 + (TOLERANCE / 100.0))) /
((r1 * (1.0 - (TOLERANCE / 100.0))) + (r2 * (1.0 + (TOLERANCE / 100.0)))));
lowerThreshold = floor(MAX_ADC_VOLTAGE * (r2 * (1.0 - (TOLERANCE / 100.0))) /
((r1 * (1.0 + (TOLERANCE / 100.0))) + (r2 * (1.0 - (TOLERANCE / 100.0)))));

// systemPrintf("r1: %0.2f r2: %0.2f lowerThreshold: %0.0f mvMeasured: %d upperThreshold: %0.0f\r\n", r1, r2,
// lowerThreshold, mvMeasured, upperThreshold);

return (upperThreshold > mvMeasured) && (mvMeasured > lowerThreshold);
}

Expand All @@ -61,13 +55,13 @@ void identifyBoard()
uint16_t idValue = analogReadMilliVolts(pin_deviceID);
log_d("Board ADC ID (mV): %d", idValue);

// Order checks by millivolt values high to low
// Order the following ID checks, by millivolt values high to low

// Facet L-Band Direct: 4.7/1 --> 534mV < 578mV < 626mV
// Facet L-Band Direct: 4.7/1 --> 534mV < 579mV < 626mV
if (idWithAdc(idValue, 4.7, 1))
productVariant = RTK_FACET_LBAND_DIRECT;

// Express: 10/3.3 --> 761mV < 818mV < 879mV
// Express: 10/3.3 --> 761mV < 819mV < 879mV
else if (idWithAdc(idValue, 10, 3.3))
productVariant = RTK_EXPRESS;

Expand Down Expand Up @@ -95,7 +89,10 @@ void identifyBoard()
// Surveyor
// Unknown
else
{
log_d("Out of band or nonexistent resistor IDs");
productVariant = RTK_UNKNOWN; // Need to wait until the GNSS and Accel have been initialized
}
}

// Setup any essential power pins
Expand Down Expand Up @@ -611,8 +608,7 @@ void beginUART2()
// after discarding the oldest data
length = settings.gnssHandlerBufferSize;
rbOffsetEntries = (length >> 1) / AVERAGE_SENTENCE_LENGTH_IN_BYTES;
length = settings.gnssHandlerBufferSize
+ (rbOffsetEntries * sizeof(RING_BUFFER_OFFSET));
length = settings.gnssHandlerBufferSize + (rbOffsetEntries * sizeof(RING_BUFFER_OFFSET));
ringBuffer = nullptr;
rbOffsetArray = (RING_BUFFER_OFFSET *)malloc(length);
if (!rbOffsetArray)
Expand Down Expand Up @@ -1272,40 +1268,40 @@ void pinI2CTask(void *pvParameters)
i2cBusAvailable = true;
switch (addr)
{
default: {
systemPrintf("0x%02x\r\n", addr);
break;
}
default: {
systemPrintf("0x%02x\r\n", addr);
break;
}

case 0x19: {
systemPrintf("0x%02x - LIS2DH12 Accelerometer\r\n", addr);
break;
}
case 0x19: {
systemPrintf("0x%02x - LIS2DH12 Accelerometer\r\n", addr);
break;
}

case 0x36: {
systemPrintf("0x%02x - MAX17048 Fuel Gauge\r\n", addr);
break;
}
case 0x36: {
systemPrintf("0x%02x - MAX17048 Fuel Gauge\r\n", addr);
break;
}

case 0x3d: {
systemPrintf("0x%02x - SSD1306 (64x48) OLED Driver\r\n", addr);
break;
}
case 0x3d: {
systemPrintf("0x%02x - SSD1306 (64x48) OLED Driver\r\n", addr);
break;
}

case 0x42: {
systemPrintf("0x%02x - u-blox ZED-F9P GNSS Receiver\r\n", addr);
break;
}
case 0x42: {
systemPrintf("0x%02x - u-blox ZED-F9P GNSS Receiver\r\n", addr);
break;
}

case 0x43: {
systemPrintf("0x%02x - u-blox NEO-D9S-00B Correction Data Receiver\r\n", addr);
break;
}
case 0x43: {
systemPrintf("0x%02x - u-blox NEO-D9S-00B Correction Data Receiver\r\n", addr);
break;
}

case 0x60: {
systemPrintf("0x%02x - Crypto Coprocessor\r\n", addr);
break;
}
case 0x60: {
systemPrintf("0x%02x - Crypto Coprocessor\r\n", addr);
break;
}
}
}
else if ((millis() - timer) > 3)
Expand Down
Loading