Skip to content

Commit 6756a08

Browse files
authored
Merge pull request #13 from sparkfun/release_candidate
v2.1
2 parents c5aebe9 + 3da9327 commit 6756a08

File tree

13 files changed

+250
-110
lines changed

13 files changed

+250
-110
lines changed

.github/workflows/build-for-release.yml

Lines changed: 14 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
env:
77
FILENAME_PREFIX: GNSSDO_Firmware
88
FIRMWARE_VERSION_MAJOR: 2
9-
FIRMWARE_VERSION_MINOR: 0
9+
FIRMWARE_VERSION_MINOR: 1
1010
CORE_VERSION: 3.0.7
1111

1212
jobs:
@@ -44,61 +44,23 @@ jobs:
4444
echo "DEBUG_LEVEL=debug" >> "$GITHUB_ENV"
4545
fi
4646
47-
- name: Setup Arduino CLI
48-
uses: arduino/setup-arduino-cli@v1
49-
50-
- name: Start config file
51-
run: arduino-cli config init --additional-urls "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json,https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json"
52-
53-
- name: Update core index
54-
run: arduino-cli core update-index
55-
56-
- name: Update library index
57-
run: arduino-cli lib update-index
58-
59-
- name: Install platform
60-
run: arduino-cli core install esp32:esp32@${{ env.CORE_VERSION }}
61-
62-
- name: Get IDF version
47+
- name: Run Dockerfile and copy files
6348
run: |
64-
cd /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs
65-
IDF_VERSION=$(ls | grep idf-release)
66-
echo "ESP_IDF=${IDF_VERSION}" >> "$GITHUB_ENV"
67-
68-
- name: Get Known Libraries
69-
run: arduino-cli lib install
70-
71-
72-
"SparkFun Qwiic OLED Arduino Library"@1.0.13
73-
"SparkFun Toolkit"@0.9.2
74-
# "SparkFun SiT5358 DCTCXO Arduino Library"@1.0.0
75-
# "SparkFun SiT5811 OCXO Arduino Library"@1.0.0
76-
# "SparkFun STP3593LF OCXO Arduino Library"@1.0.0
77-
78-
- name: Enable external libs
79-
run: arduino-cli config set library.enable_unsafe_install true
80-
81-
- name: Get Libraries
82-
run: arduino-cli lib install --git-url
83-
https://github.com/sparkfun/SparkFun_SiT5358_DCTCXO_Arduino_Library.git
84-
https://github.com/sparkfun/SparkFun_SiT5811_OCXO_Arduino_Library.git
85-
https://github.com/sparkfun/SparkFun_STP3593LF_OCXO_Arduino_Library.git
86-
87-
- name: Copy custom app3M_fat9M_16MB.csv
88-
run:
89-
cp Firmware/app3M_fat9M_16MB.csv /home/runner/.arduino15/packages/esp32/hardware/esp32/${{ env.CORE_VERSION }}/tools/partitions/app3M_fat9M_16MB.csv
90-
91-
- name: Compile Sketch
92-
run: arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${{ env.DEBUG_LEVEL }} ./Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino
93-
--build-property build.partitions=app3M_fat9M_16MB
94-
--build-property upload.maximum_size=3145728
95-
--build-property "compiler.cpp.extra_flags=-MMD -c \"-DFIRMWARE_VERSION_MAJOR=$FIRMWARE_VERSION_MAJOR\" \"-DFIRMWARE_VERSION_MINOR=$FIRMWARE_VERSION_MINOR\""
96-
--export-binaries
49+
cd ./Firmware
50+
docker build -t gnssdo_firmware --no-cache \
51+
--build-arg CORE_VERSION=${{ env.CORE_VERSION }} \
52+
--build-arg FIRMWARE_VERSION_MAJOR=${{ env.FIRMWARE_VERSION_MAJOR }} \
53+
--build-arg FIRMWARE_VERSION_MINOR=${{ env.FIRMWARE_VERSION_MINOR }} \
54+
--build-arg DEBUG_LEVEL=${{ env.DEBUG_LEVEL }} \
55+
.
56+
docker create --name=gnssdo_image gnssdo_firmware:latest
57+
docker cp gnssdo_image:/GNSSDO_Firmware.ino.bin .
58+
docker container rm gnssdo_image
9759
9860
- name: Rename binary
9961
run: |
100-
cd Firmware/GNSSDO_Firmware/build/esp32.esp32.esp32/
101-
mv GNSSDO_Firmware.ino.bin ../../../Binaries/${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin
62+
cd ./Firmware
63+
mv GNSSDO_Firmware.ino.bin Binaries/${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin
10264
10365
- name: Commit and push binary
10466
uses: actions-js/push@master

.github/workflows/non-release-build.yml

Lines changed: 16 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -44,70 +44,35 @@ jobs:
4444
echo "DEBUG_LEVEL=debug" >> "$GITHUB_ENV"
4545
fi
4646
47-
- name: Setup Arduino CLI
48-
uses: arduino/setup-arduino-cli@v1
49-
50-
- name: Start config file
51-
run: arduino-cli config init --additional-urls "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json,https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json"
52-
53-
- name: Update core index
54-
run: arduino-cli core update-index
55-
56-
- name: Update library index
57-
run: arduino-cli lib update-index
58-
59-
- name: Install platform
60-
run: arduino-cli core install esp32:esp32@${{ env.CORE_VERSION }}
61-
62-
- name: Get IDF version
47+
- name: Run Dockerfile and copy files
6348
run: |
64-
cd /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs
65-
IDF_VERSION=$(ls | grep idf-release)
66-
echo "ESP_IDF=${IDF_VERSION}" >> "$GITHUB_ENV"
67-
68-
- name: Get Known Libraries
69-
run: arduino-cli lib install
70-
71-
72-
"SparkFun Qwiic OLED Arduino Library"@1.0.13
73-
"SparkFun Toolkit"@0.9.2
74-
# "SparkFun SiT5358 DCTCXO Arduino Library"@1.0.0
75-
# "SparkFun SiT5811 OCXO Arduino Library"@1.0.0
76-
# "SparkFun STP3593LF OCXO Arduino Library"@1.0.0
77-
78-
- name: Enable external libs
79-
run: arduino-cli config set library.enable_unsafe_install true
80-
81-
- name: Get Libraries
82-
run: arduino-cli lib install --git-url
83-
https://github.com/sparkfun/SparkFun_SiT5358_DCTCXO_Arduino_Library.git
84-
https://github.com/sparkfun/SparkFun_SiT5811_OCXO_Arduino_Library.git
85-
https://github.com/sparkfun/SparkFun_STP3593LF_OCXO_Arduino_Library.git
86-
87-
- name: Copy custom app3M_fat9M_16MB.csv
88-
run:
89-
cp Firmware/app3M_fat9M_16MB.csv /home/runner/.arduino15/packages/esp32/hardware/esp32/${{ env.CORE_VERSION }}/tools/partitions/app3M_fat9M_16MB.csv
90-
91-
- name: Compile Sketch
92-
run: arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${{ env.DEBUG_LEVEL }} ./Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino
93-
--build-property build.partitions=app3M_fat9M_16MB
94-
--build-property upload.maximum_size=3145728
95-
--build-property "compiler.cpp.extra_flags=-MMD -c \"-DFIRMWARE_VERSION_MAJOR=$FIRMWARE_VERSION_MAJOR\" \"-DFIRMWARE_VERSION_MINOR=$FIRMWARE_VERSION_MINOR\""
96-
--export-binaries
49+
cd ./Firmware
50+
docker build -t gnssdo_firmware --no-cache \
51+
--build-arg CORE_VERSION=${{ env.CORE_VERSION }} \
52+
--build-arg FIRMWARE_VERSION_MAJOR=${{ env.FIRMWARE_VERSION_MAJOR }} \
53+
--build-arg FIRMWARE_VERSION_MINOR=${{ env.FIRMWARE_VERSION_MINOR }} \
54+
--build-arg DEBUG_LEVEL=${{ env.DEBUG_LEVEL }} \
55+
.
56+
docker create --name=gnssdo_image gnssdo_firmware:latest
57+
mkdir ./build
58+
docker cp gnssdo_image:/GNSSDO_Firmware.ino.bin ./build
59+
docker cp gnssdo_image:/GNSSDO_Firmware.ino.elf ./build
60+
docker container rm gnssdo_image
9761
9862
- name: Create artifact name
9963
run: |
10064
echo "ARTIFACT=${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}" >> $GITHUB_ENV
10165
10266
- name: Create artifact directory
10367
run: |
104-
cd Firmware/GNSSDO_Firmware/build/esp32.esp32.esp32/
68+
cd ./Firmware/build/
10569
mkdir ${{ env.ARTIFACT }}
10670
mv GNSSDO_Firmware.ino.bin ${{ env.ARTIFACT }}
71+
mv GNSSDO_Firmware.ino.elf ${{ env.ARTIFACT }}
10772
10873
- name: Upload artifact directory to action - avoid double-zip
10974
uses: actions/upload-artifact@v4
11075
with:
11176
name: ${{ env.ARTIFACT }}
112-
path: Firmware/GNSSDO_Firmware/build/esp32.esp32.esp32/${{ env.ARTIFACT }}
77+
path: ./Firmware/build/${{ env.ARTIFACT }}
11378
retention-days: 7

Firmware/Dockerfile

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
FROM ubuntu:latest AS upstream
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
ARG CORE_VERSION=3.0.7
6+
7+
ARG FIRMWARE_VERSION_MAJOR=9
8+
ARG FIRMWARE_VERSION_MINOR=9
9+
10+
# ESP32 Core Debug Level
11+
# We use "none" for releases and "error" for release_candidate
12+
# You may find "verbose" useful while you are debugging your changes
13+
ARG DEBUG_LEVEL=error
14+
15+
# arduino-cli warnings: none default more all
16+
ARG WARNINGS=default
17+
18+
# Get curl and python3
19+
RUN apt-get update \
20+
&& apt-get install -y curl python3 python3-pip python3-venv \
21+
&& apt-get clean \
22+
&& rm -rf /var/lib/apt/lists/*
23+
24+
# Avoid the externally managed environment constraint
25+
RUN PYTHON_VER=$(ls /usr/lib | grep python3.) \
26+
&& echo "Python version: ${PYTHON_VER}" \
27+
&& rm /usr/lib/${PYTHON_VER}/EXTERNALLY-MANAGED
28+
29+
# Install Python dependencies - esptool needs pyserial
30+
#RUN python3 -m pip install --upgrade pip && \
31+
RUN pip install pyserial
32+
33+
# Setup Arduino CLI
34+
#RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh
35+
RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh -s nightly-latest
36+
37+
# Start config file
38+
RUN arduino-cli config init --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json,https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json
39+
40+
# Update core index
41+
RUN arduino-cli core update-index
42+
43+
# Update library index
44+
RUN arduino-cli lib update-index
45+
46+
# Install platform
47+
RUN arduino-cli core install "esp32:esp32@${CORE_VERSION}"
48+
49+
# Get Known Libraries
50+
RUN arduino-cli lib install [email protected]
51+
RUN arduino-cli lib install [email protected]
52+
RUN arduino-cli lib install "SparkFun Qwiic OLED Arduino Library"@1.0.13
53+
RUN arduino-cli lib install "SparkFun Toolkit"@0.9.2
54+
RUN arduino-cli lib install "SparkFun SiT5358 DCTCXO Arduino Library"@1.0.1
55+
RUN arduino-cli lib install "SparkFun SiT5811 OCXO Arduino Library"@1.0.1
56+
RUN arduino-cli lib install "SparkFun STP3593LF OCXO Arduino Library"@1.0.1
57+
58+
# Enable external libs
59+
#RUN arduino-cli config set library.enable_unsafe_install true
60+
61+
# Get external libs
62+
#RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_SiT5358_DCTCXO_Arduino_Library.git
63+
#RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_SiT5811_OCXO_Arduino_Library.git
64+
#RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_STP3593LF_OCXO_Arduino_Library.git
65+
66+
# Copy GNSSDO_Firmware and build deployment image
67+
FROM upstream AS deployment
68+
69+
# Add the source files
70+
ADD . .
71+
72+
# Copy custom app3M_fat9M_16MB.csv
73+
RUN cp app3M_fat9M_16MB.csv "/root/.arduino15/packages/esp32/hardware/esp32/${CORE_VERSION}/tools/partitions/app3M_fat9M_16MB.csv"
74+
75+
# Compile Sketch
76+
RUN cd ./GNSSDO_Firmware \
77+
&& arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${DEBUG_LEVEL} \
78+
--warnings ${WARNINGS} \
79+
./GNSSDO_Firmware.ino \
80+
--build-property build.partitions=app3M_fat9M_16MB \
81+
--build-property upload.maximum_size=3145728 \
82+
--build-property "compiler.cpp.extra_flags=-MMD -c \
83+
\"-DFIRMWARE_VERSION_MAJOR=${FIRMWARE_VERSION_MAJOR}\" \
84+
\"-DFIRMWARE_VERSION_MINOR=${FIRMWARE_VERSION_MINOR}\"" \
85+
--export-binaries
86+
87+
# Copy the compile output. List the files
88+
FROM deployment AS output
89+
COPY --from=deployment ./GNSSDO_Firmware/build/esp32.esp32.esp32 /
90+
CMD echo $(ls /*.*)

Firmware/GNSSDO_Firmware/Begin.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ void updateTCXOClockBias()
635635
tcxoClockBias_ms = gnssClockBias_ms; // Default to the PVTGeodetic RxClkBias
636636
tcxoClockDrift_ppm = gnssClockDrift_ppm;
637637
snprintf(rxClkBiasSource, sizeof(rxClkBiasSource), "PVT");
638+
snprintf(sysSource, sizeof(sysSource), mosaicTimeSystemNameFromId(gnssTimeSys));
638639

639640
if (settings.preferNonCompositeGPSBias || settings.preferNonCompositeGalileoBias) // These are mutex
640641
{
@@ -645,6 +646,7 @@ void updateTCXOClockBias()
645646
tcxoClockDrift_ppm = fugroTimeSystems[index].RxClkDrift_ppm;
646647
fugroTimeSystems[index].updated = false;
647648
snprintf(rxClkBiasSource, sizeof(rxClkBiasSource), fugroTimeSystems[index].name);
649+
snprintf(sysSource, sizeof(sysSource), "Fugro (%s)", fugroTimeSystems[index].name);
648650
}
649651
}
650652
}

Firmware/GNSSDO_Firmware/Display.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void updateDisplay()
158158
yPos += 8;
159159

160160
snprintf(textLine, sizeof(textLine), "Sys %s",
161-
mosaicTimeSystemNameFromId(gnssTimeSys));
161+
sysSource);
162162
oled->setCursor(0, yPos);
163163
oled->print(textLine);
164164
yPos += 8;

Firmware/GNSSDO_Firmware/GNSS.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,12 @@ bool initializeGNSS()
236236
return false;
237237
}
238238

239+
if (!sendWithResponse("spm, Static, , auto\n\r", "PVTMode"))
240+
{
241+
systemPrintln("GNSS FAIL (PVTMode)");
242+
return false;
243+
}
244+
239245
// Copy current configuration into boot
240246
if (!sendWithResponse("eccf, Current, Boot\n\r", "CopyConfigFile", 5000))
241247
{

Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
66
This is the firmware for the SparkFun SparkPNT GNSSDO.
77
It runs on an ESP32 and communicates with the mosaic-T and SiT5358.
8+
The SiTime SiT5811 and Rakon STP3593LF are also supported.
89
9-
Compiled with Arduino v1.8.19 with ESP32 core v3.0.1.
10+
Compiled with arduino-cli with ESP32 core v3.0.7
1011
11-
Set the board to "ESP32 Wrover Module"
12+
If you are compiling manually in the Arduino IDE: set the board to "ESP32 Wrover Module"
1213
13-
Settings are pulled from ESP32's file system LittleFS.
14+
Settings are stored in the ESP32's file system LittleFS.
1415
1516
Version history:
1617
1.0: Initial release
@@ -31,6 +32,14 @@
3132
Allow extra time when copying the mosaic-T configuration
3233
Print an error if no TCXO / OCXO is detected, but allow firmware to continue
3334
Print an ERROR if the display is not detected on I2C, but allow firmware to continue
35+
2.1: Resolves #10:
36+
Corrects an error an menuOperation where option 11 (ppsTimescale) was not wrapping correctly
37+
Resolves #11:
38+
OLED "Sys" will show "Fugro (GPS)" when the non-composite GPS time system is preferred and in use
39+
OLED "Sys" will show "Fugro (Galileo)" when the non-composite Galileo time system is preferred and in use
40+
Resolves #12:
41+
PVT Mode defaults to Static (after a Factory Reset) for best performance
42+
The user can modify the Mode and save the configuration if needed
3443
*/
3544

3645
// This is passed in from compiler extra flags

Firmware/GNSSDO_Firmware/compile_me.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

Firmware/GNSSDO_Firmware/menuSystem.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ void menuOperation()
509509
{
510510
settings.ppsTimeScale++;
511511
if ((settings.ppsTimeScale >= mosaicPPSParametersTimeScaleEntries) || (settings.ppsTimeScale < 0))
512-
settings.ppsPolarity = 0;
512+
settings.ppsTimeScale = 0;
513513
ppsStarted = false; // Restart PPS afterwards
514514
}
515515
else if (incoming == 12)

Firmware/GNSSDO_Firmware/settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ uint8_t mosaicTimeSystemIndexFromName(const char *name)
134134
double tcxoClockBias_ms; // Updated by updateTCXOClockBias
135135
float tcxoClockDrift_ppm;
136136
char rxClkBiasSource[8];
137+
char sysSource[16]; // "Fugro (Galileo)"
137138

138139
const char *const mosaicPVTErrorTable[] = {
139140
"None",

0 commit comments

Comments
 (0)