Skip to content

Commit dd40f2b

Browse files
committed
Create workflow for RC binary creation
1 parent 1d5a341 commit dd40f2b

File tree

3 files changed

+102
-10
lines changed

3 files changed

+102
-10
lines changed

.github/workflows/compile-rc.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Build Release Candidate
2+
on:
3+
workflow_dispatch:
4+
branches:
5+
- release_candidate
6+
7+
env:
8+
FILENAME_PREFIX: RTK_Surveyor_Firmware_
9+
RC_PREFIX: RC-
10+
POINTPERFECT_TOKEN: ${{ secrets.POINTPERFECT_TOKEN }}
11+
12+
jobs:
13+
build:
14+
15+
name: Build
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@master
21+
22+
- name: Setup Arduino CLI
23+
uses: arduino/setup-arduino-cli@v1
24+
25+
#We limit the ESP32 core to v2.0.2
26+
- name: Install platform
27+
run: arduino-cli core install esp32:esp32@2.0.2
28+
--additional-urls 'https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json'
29+
30+
- name: Start config file
31+
run: arduino-cli config init
32+
33+
- name: Enable external libs
34+
run: arduino-cli config set library.enable_unsafe_install true
35+
36+
- name: Get Libraries
37+
run: arduino-cli lib install --git-url
38+
https://github.com/fbiego/ESP32Time.git
39+
https://github.com/me-no-dev/ESPAsyncWebServer.git
40+
https://github.com/me-no-dev/AsyncTCP.git
41+
https://github.com/JChristensen/JC_Button.git
42+
https://github.com/greiman/SdFat.git
43+
https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library.git
44+
https://github.com/sparkfun/SparkFun_MAX1704x_Fuel_Gauge_Arduino_Library.git
45+
https://github.com/sparkfun/SparkFun_Qwiic_OLED_Arduino_Library.git
46+
https://github.com/sparkfun/SparkFun_LIS2DH12_Arduino_Library.git
47+
https://github.com/bblanchon/ArduinoJson.git
48+
https://github.com/knolleary/pubsubclient.git
49+
50+
- name: Compile Sketch
51+
run: arduino-cli compile --fqbn esp32:esp32:esp32 ./Firmware/RTK_Surveyor/RTK_Surveyor.ino
52+
--build-property build.partitions=partitions
53+
--build-property upload.maximum_size=3145728
54+
--export-binaries
55+
--build-property DebugLevel.debug.build.code_debug=4
56+
--build-property "compiler.cpp.extra_flags=\"-DPOINTPERFECT_TOKEN=$POINTPERFECT_TOKEN\""
57+
58+
- name: Get current date
59+
id: date
60+
run: echo "::set-output name=date::$(date +'%b_%d_%Y')"
61+
62+
- name: Rename binary
63+
run: |
64+
cd Firmware/RTK_Surveyor
65+
cd build
66+
cd esp32.esp32.esp32
67+
mv RTK_Surveyor.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.RC_PREFIX }}${{ steps.date.outputs.date }}.bin
68+
69+
- name: Upload binary to action
70+
uses: actions/upload-artifact@v3
71+
with:
72+
name: ${{ env.FILENAME_PREFIX }}${{ env.RC_PREFIX }}${{ steps.date.outputs.date }}
73+
path: ./Firmware/RTK_Surveyor/build/esp32.esp32.esp32/${{ env.FILENAME_PREFIX }}${{ env.RC_PREFIX }}${{ steps.date.outputs.date }}.bin

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -324,18 +324,13 @@ unsigned long timeSinceLastIncomingSetting = 0;
324324
SFE_UBLOX_GNSS_ADD i2cLBand; // NEO-D9S
325325
const char* pointPerfectKeyTopic = "/pp/ubx/0236/Lb";
326326

327-
#if __has_include("tokens.h")
328-
#include "tokens.h"
329-
#else
330-
uint8_t pointPerfectTokenArray[] = {0xAA, 0xBB, 0xCC, 0xDD, 0x00, 0x11, 0x22, 0x33, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03}; //Token in HEX form
331-
332-
static const char *AWS_PUBLIC_CERT = R"=====(
333-
-----BEGIN CERTIFICATE-----
334-
Certificate here
335-
-----END CERTIFICATE-----
336-
)=====";
327+
//The PointPerfect token is provided at compile time via build flags
328+
#ifndef POINTPERFECT_TOKEN
329+
#define POINTPERFECT_TOKEN 0xAA, 0xBB, 0xCC, 0xDD, 0x00, 0x11, 0x22, 0x33, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03
337330
#endif
338331

332+
uint8_t pointPerfectTokenArray[16] = {POINTPERFECT_TOKEN}; //Token in HEX form
333+
339334
const char* pointPerfectAPI = "https://api.thingstream.io/ztp/pointperfect/credentials";
340335
void checkRXMCOR(UBX_RXM_COR_data_t *ubxDataStruct);
341336
float lBandEBNO = 0.0; //Used on system status menu

Firmware/RTK_Surveyor/settings.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,3 +454,27 @@ struct struct_online {
454454
bool lbandCorrections = false;
455455
bool i2c = false;
456456
} online;
457+
458+
//AWS certificate for PointPerfect API
459+
static const char *AWS_PUBLIC_CERT = R"=====(
460+
-----BEGIN CERTIFICATE-----
461+
MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF
462+
ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6
463+
b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL
464+
MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv
465+
b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj
466+
ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM
467+
9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw
468+
IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6
469+
VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L
470+
93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm
471+
jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
472+
AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA
473+
A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI
474+
U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs
475+
N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv
476+
o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU
477+
5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy
478+
rqXRfboQnoZsG4q5WTP468SQvvG5
479+
-----END CERTIFICATE-----
480+
)=====";

0 commit comments

Comments
 (0)