Skip to content
Merged

v2.1 #13

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
66 changes: 14 additions & 52 deletions .github/workflows/build-for-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
env:
FILENAME_PREFIX: GNSSDO_Firmware
FIRMWARE_VERSION_MAJOR: 2
FIRMWARE_VERSION_MINOR: 0
FIRMWARE_VERSION_MINOR: 1
CORE_VERSION: 3.0.7

jobs:
Expand Down Expand Up @@ -44,61 +44,23 @@ jobs:
echo "DEBUG_LEVEL=debug" >> "$GITHUB_ENV"
fi

- name: Setup Arduino CLI
uses: arduino/setup-arduino-cli@v1

- name: Start config file
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"

- name: Update core index
run: arduino-cli core update-index

- name: Update library index
run: arduino-cli lib update-index

- name: Install platform
run: arduino-cli core install esp32:esp32@${{ env.CORE_VERSION }}

- name: Get IDF version
- name: Run Dockerfile and copy files
run: |
cd /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs
IDF_VERSION=$(ls | grep idf-release)
echo "ESP_IDF=${IDF_VERSION}" >> "$GITHUB_ENV"

- name: Get Known Libraries
run: arduino-cli lib install
ESP32Time@2.0.0
JC_Button@2.1.2
"SparkFun Qwiic OLED Arduino Library"@1.0.13
"SparkFun Toolkit"@0.9.2
# "SparkFun SiT5358 DCTCXO Arduino Library"@1.0.0
# "SparkFun SiT5811 OCXO Arduino Library"@1.0.0
# "SparkFun STP3593LF OCXO Arduino Library"@1.0.0

- name: Enable external libs
run: arduino-cli config set library.enable_unsafe_install true

- name: Get Libraries
run: arduino-cli lib install --git-url
https://github.com/sparkfun/SparkFun_SiT5358_DCTCXO_Arduino_Library.git
https://github.com/sparkfun/SparkFun_SiT5811_OCXO_Arduino_Library.git
https://github.com/sparkfun/SparkFun_STP3593LF_OCXO_Arduino_Library.git

- name: Copy custom app3M_fat9M_16MB.csv
run:
cp Firmware/app3M_fat9M_16MB.csv /home/runner/.arduino15/packages/esp32/hardware/esp32/${{ env.CORE_VERSION }}/tools/partitions/app3M_fat9M_16MB.csv

- name: Compile Sketch
run: arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${{ env.DEBUG_LEVEL }} ./Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino
--build-property build.partitions=app3M_fat9M_16MB
--build-property upload.maximum_size=3145728
--build-property "compiler.cpp.extra_flags=-MMD -c \"-DFIRMWARE_VERSION_MAJOR=$FIRMWARE_VERSION_MAJOR\" \"-DFIRMWARE_VERSION_MINOR=$FIRMWARE_VERSION_MINOR\""
--export-binaries
cd ./Firmware
docker build -t gnssdo_firmware --no-cache \
--build-arg CORE_VERSION=${{ env.CORE_VERSION }} \
--build-arg FIRMWARE_VERSION_MAJOR=${{ env.FIRMWARE_VERSION_MAJOR }} \
--build-arg FIRMWARE_VERSION_MINOR=${{ env.FIRMWARE_VERSION_MINOR }} \
--build-arg DEBUG_LEVEL=${{ env.DEBUG_LEVEL }} \
.
docker create --name=gnssdo_image gnssdo_firmware:latest
docker cp gnssdo_image:/GNSSDO_Firmware.ino.bin .
docker container rm gnssdo_image

- name: Rename binary
run: |
cd Firmware/GNSSDO_Firmware/build/esp32.esp32.esp32/
mv GNSSDO_Firmware.ino.bin ../../../Binaries/${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin
cd ./Firmware
mv GNSSDO_Firmware.ino.bin Binaries/${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin

- name: Commit and push binary
uses: actions-js/push@master
Expand Down
67 changes: 16 additions & 51 deletions .github/workflows/non-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,70 +44,35 @@ jobs:
echo "DEBUG_LEVEL=debug" >> "$GITHUB_ENV"
fi

- name: Setup Arduino CLI
uses: arduino/setup-arduino-cli@v1

- name: Start config file
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"

- name: Update core index
run: arduino-cli core update-index

- name: Update library index
run: arduino-cli lib update-index

- name: Install platform
run: arduino-cli core install esp32:esp32@${{ env.CORE_VERSION }}

- name: Get IDF version
- name: Run Dockerfile and copy files
run: |
cd /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs
IDF_VERSION=$(ls | grep idf-release)
echo "ESP_IDF=${IDF_VERSION}" >> "$GITHUB_ENV"

- name: Get Known Libraries
run: arduino-cli lib install
ESP32Time@2.0.0
JC_Button@2.1.2
"SparkFun Qwiic OLED Arduino Library"@1.0.13
"SparkFun Toolkit"@0.9.2
# "SparkFun SiT5358 DCTCXO Arduino Library"@1.0.0
# "SparkFun SiT5811 OCXO Arduino Library"@1.0.0
# "SparkFun STP3593LF OCXO Arduino Library"@1.0.0

- name: Enable external libs
run: arduino-cli config set library.enable_unsafe_install true

- name: Get Libraries
run: arduino-cli lib install --git-url
https://github.com/sparkfun/SparkFun_SiT5358_DCTCXO_Arduino_Library.git
https://github.com/sparkfun/SparkFun_SiT5811_OCXO_Arduino_Library.git
https://github.com/sparkfun/SparkFun_STP3593LF_OCXO_Arduino_Library.git

- name: Copy custom app3M_fat9M_16MB.csv
run:
cp Firmware/app3M_fat9M_16MB.csv /home/runner/.arduino15/packages/esp32/hardware/esp32/${{ env.CORE_VERSION }}/tools/partitions/app3M_fat9M_16MB.csv

- name: Compile Sketch
run: arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${{ env.DEBUG_LEVEL }} ./Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino
--build-property build.partitions=app3M_fat9M_16MB
--build-property upload.maximum_size=3145728
--build-property "compiler.cpp.extra_flags=-MMD -c \"-DFIRMWARE_VERSION_MAJOR=$FIRMWARE_VERSION_MAJOR\" \"-DFIRMWARE_VERSION_MINOR=$FIRMWARE_VERSION_MINOR\""
--export-binaries
cd ./Firmware
docker build -t gnssdo_firmware --no-cache \
--build-arg CORE_VERSION=${{ env.CORE_VERSION }} \
--build-arg FIRMWARE_VERSION_MAJOR=${{ env.FIRMWARE_VERSION_MAJOR }} \
--build-arg FIRMWARE_VERSION_MINOR=${{ env.FIRMWARE_VERSION_MINOR }} \
--build-arg DEBUG_LEVEL=${{ env.DEBUG_LEVEL }} \
.
docker create --name=gnssdo_image gnssdo_firmware:latest
mkdir ./build
docker cp gnssdo_image:/GNSSDO_Firmware.ino.bin ./build
docker cp gnssdo_image:/GNSSDO_Firmware.ino.elf ./build
docker container rm gnssdo_image

- name: Create artifact name
run: |
echo "ARTIFACT=${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}" >> $GITHUB_ENV

- name: Create artifact directory
run: |
cd Firmware/GNSSDO_Firmware/build/esp32.esp32.esp32/
cd ./Firmware/build/
mkdir ${{ env.ARTIFACT }}
mv GNSSDO_Firmware.ino.bin ${{ env.ARTIFACT }}
mv GNSSDO_Firmware.ino.elf ${{ env.ARTIFACT }}

- name: Upload artifact directory to action - avoid double-zip
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT }}
path: Firmware/GNSSDO_Firmware/build/esp32.esp32.esp32/${{ env.ARTIFACT }}
path: ./Firmware/build/${{ env.ARTIFACT }}
retention-days: 7
90 changes: 90 additions & 0 deletions Firmware/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
FROM ubuntu:latest AS upstream

ARG DEBIAN_FRONTEND=noninteractive

ARG CORE_VERSION=3.0.7

ARG FIRMWARE_VERSION_MAJOR=9
ARG FIRMWARE_VERSION_MINOR=9

# ESP32 Core Debug Level
# We use "none" for releases and "error" for release_candidate
# You may find "verbose" useful while you are debugging your changes
ARG DEBUG_LEVEL=error

# arduino-cli warnings: none default more all
ARG WARNINGS=default

# Get curl and python3
RUN apt-get update \
&& apt-get install -y curl python3 python3-pip python3-venv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Avoid the externally managed environment constraint
RUN PYTHON_VER=$(ls /usr/lib | grep python3.) \
&& echo "Python version: ${PYTHON_VER}" \
&& rm /usr/lib/${PYTHON_VER}/EXTERNALLY-MANAGED

# Install Python dependencies - esptool needs pyserial
#RUN python3 -m pip install --upgrade pip && \
RUN pip install pyserial

# Setup Arduino CLI
#RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh
RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh -s nightly-latest

# Start config file
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

# Update core index
RUN arduino-cli core update-index

# Update library index
RUN arduino-cli lib update-index

# Install platform
RUN arduino-cli core install "esp32:esp32@${CORE_VERSION}"

# Get Known Libraries
RUN arduino-cli lib install ESP32Time@2.0.0
RUN arduino-cli lib install JC_Button@2.1.2
RUN arduino-cli lib install "SparkFun Qwiic OLED Arduino Library"@1.0.13
RUN arduino-cli lib install "SparkFun Toolkit"@0.9.2
RUN arduino-cli lib install "SparkFun SiT5358 DCTCXO Arduino Library"@1.0.1
RUN arduino-cli lib install "SparkFun SiT5811 OCXO Arduino Library"@1.0.1
RUN arduino-cli lib install "SparkFun STP3593LF OCXO Arduino Library"@1.0.1

# Enable external libs
#RUN arduino-cli config set library.enable_unsafe_install true

# Get external libs
#RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_SiT5358_DCTCXO_Arduino_Library.git
#RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_SiT5811_OCXO_Arduino_Library.git
#RUN arduino-cli lib install --git-url https://github.com/sparkfun/SparkFun_STP3593LF_OCXO_Arduino_Library.git

# Copy GNSSDO_Firmware and build deployment image
FROM upstream AS deployment

# Add the source files
ADD . .

# Copy custom app3M_fat9M_16MB.csv
RUN cp app3M_fat9M_16MB.csv "/root/.arduino15/packages/esp32/hardware/esp32/${CORE_VERSION}/tools/partitions/app3M_fat9M_16MB.csv"

# Compile Sketch
RUN cd ./GNSSDO_Firmware \
&& arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${DEBUG_LEVEL} \
--warnings ${WARNINGS} \
./GNSSDO_Firmware.ino \
--build-property build.partitions=app3M_fat9M_16MB \
--build-property upload.maximum_size=3145728 \
--build-property "compiler.cpp.extra_flags=-MMD -c \
\"-DFIRMWARE_VERSION_MAJOR=${FIRMWARE_VERSION_MAJOR}\" \
\"-DFIRMWARE_VERSION_MINOR=${FIRMWARE_VERSION_MINOR}\"" \
--export-binaries

# Copy the compile output. List the files
FROM deployment AS output
COPY --from=deployment ./GNSSDO_Firmware/build/esp32.esp32.esp32 /
CMD echo $(ls /*.*)
2 changes: 2 additions & 0 deletions Firmware/GNSSDO_Firmware/Begin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ void updateTCXOClockBias()
tcxoClockBias_ms = gnssClockBias_ms; // Default to the PVTGeodetic RxClkBias
tcxoClockDrift_ppm = gnssClockDrift_ppm;
snprintf(rxClkBiasSource, sizeof(rxClkBiasSource), "PVT");
snprintf(sysSource, sizeof(sysSource), mosaicTimeSystemNameFromId(gnssTimeSys));

if (settings.preferNonCompositeGPSBias || settings.preferNonCompositeGalileoBias) // These are mutex
{
Expand All @@ -645,6 +646,7 @@ void updateTCXOClockBias()
tcxoClockDrift_ppm = fugroTimeSystems[index].RxClkDrift_ppm;
fugroTimeSystems[index].updated = false;
snprintf(rxClkBiasSource, sizeof(rxClkBiasSource), fugroTimeSystems[index].name);
snprintf(sysSource, sizeof(sysSource), "Fugro (%s)", fugroTimeSystems[index].name);
}
}
}
2 changes: 1 addition & 1 deletion Firmware/GNSSDO_Firmware/Display.ino
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void updateDisplay()
yPos += 8;

snprintf(textLine, sizeof(textLine), "Sys %s",
mosaicTimeSystemNameFromId(gnssTimeSys));
sysSource);
oled->setCursor(0, yPos);
oled->print(textLine);
yPos += 8;
Expand Down
6 changes: 6 additions & 0 deletions Firmware/GNSSDO_Firmware/GNSS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ bool initializeGNSS()
return false;
}

if (!sendWithResponse("spm, Static, , auto\n\r", "PVTMode"))
{
systemPrintln("GNSS FAIL (PVTMode)");
return false;
}

// Copy current configuration into boot
if (!sendWithResponse("eccf, Current, Boot\n\r", "CopyConfigFile", 5000))
{
Expand Down
15 changes: 12 additions & 3 deletions Firmware/GNSSDO_Firmware/GNSSDO_Firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

This is the firmware for the SparkFun SparkPNT GNSSDO.
It runs on an ESP32 and communicates with the mosaic-T and SiT5358.
The SiTime SiT5811 and Rakon STP3593LF are also supported.

Compiled with Arduino v1.8.19 with ESP32 core v3.0.1.
Compiled with arduino-cli with ESP32 core v3.0.7

Set the board to "ESP32 Wrover Module"
If you are compiling manually in the Arduino IDE: set the board to "ESP32 Wrover Module"

Settings are pulled from ESP32's file system LittleFS.
Settings are stored in the ESP32's file system LittleFS.

Version history:
1.0: Initial release
Expand All @@ -31,6 +32,14 @@
Allow extra time when copying the mosaic-T configuration
Print an error if no TCXO / OCXO is detected, but allow firmware to continue
Print an ERROR if the display is not detected on I2C, but allow firmware to continue
2.1: Resolves #10:
Corrects an error an menuOperation where option 11 (ppsTimescale) was not wrapping correctly
Resolves #11:
OLED "Sys" will show "Fugro (GPS)" when the non-composite GPS time system is preferred and in use
OLED "Sys" will show "Fugro (Galileo)" when the non-composite Galileo time system is preferred and in use
Resolves #12:
PVT Mode defaults to Static (after a Factory Reset) for best performance
The user can modify the Mode and save the configuration if needed
*/

// This is passed in from compiler extra flags
Expand Down
1 change: 0 additions & 1 deletion Firmware/GNSSDO_Firmware/compile_me.bat

This file was deleted.

2 changes: 1 addition & 1 deletion Firmware/GNSSDO_Firmware/menuSystem.ino
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ void menuOperation()
{
settings.ppsTimeScale++;
if ((settings.ppsTimeScale >= mosaicPPSParametersTimeScaleEntries) || (settings.ppsTimeScale < 0))
settings.ppsPolarity = 0;
settings.ppsTimeScale = 0;
ppsStarted = false; // Restart PPS afterwards
}
else if (incoming == 12)
Expand Down
1 change: 1 addition & 0 deletions Firmware/GNSSDO_Firmware/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ uint8_t mosaicTimeSystemIndexFromName(const char *name)
double tcxoClockBias_ms; // Updated by updateTCXOClockBias
float tcxoClockDrift_ppm;
char rxClkBiasSource[8];
char sysSource[16]; // "Fugro (Galileo)"

const char *const mosaicPVTErrorTable[] = {
"None",
Expand Down
5 changes: 5 additions & 0 deletions Firmware/compile_with_docker.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
docker build -t gnssdo_firmware --no-cache-filter deployment .
docker create --name=gnssdo_image gnssdo_firmware:latest
docker cp gnssdo_image:/GNSSDO_Firmware.ino.bin .
docker cp gnssdo_image:/GNSSDO_Firmware.ino.elf .
docker container rm gnssdo_image
Binary file added docs/assets/img/Download_Zip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading