Skip to content

Commit 0c11f88

Browse files
authored
Use per device self signed cert #238 (#248) and others
* Use per device self signed cert, closes #238 * Deletion of single tracks through the web interface, closes #163 * put firmware.bin on top level directory for better archive handling * extend details listed on the about page (WiFi & HTTP details) * Minor text cleanup, new 404 page. * add possibility to set pin used for HTTP, documented pin configuration
1 parent 6d04005 commit 0c11f88

File tree

13 files changed

+442
-356
lines changed

13 files changed

+442
-356
lines changed

.github/workflows/ci.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ jobs:
105105
cp bin/.pio/build/esp32dev/partitions.bin 0x08000.bin
106106
cp /github/home/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin 0x0e000.bin
107107
cp bin/.pio/build/esp32dev/firmware.bin 0x10000.bin
108+
cp bin/.pio/build/esp32dev/firmware.bin firmware.bin
108109
wget --no-verbose -O COPYRIGHT-ESP.html https://docs.espressif.com/projects/esp-idf/en/latest/esp32/COPYRIGHT.html
109110
wget --no-verbose -O LICENSE-ARDUINO-ESP32.md https://github.com/espressif/arduino-esp32/raw/master/LICENSE.md
110111
zip --junk-paths obs-${{ env.OBS_VERSION }}-initial-flash.zip \
@@ -113,7 +114,7 @@ jobs:
113114
LICENSE-ARDUINO-ESP32.md \
114115
LICENSE
115116
zip --junk-paths obs-${{ env.OBS_VERSION }}.zip \
116-
bin/.pio/build/esp32dev/firmware.bin \
117+
firmware.bin \
117118
COPYRIGHT-ESP.html \
118119
LICENSE-ARDUINO-ESP32.md \
119120
LICENSE
@@ -149,7 +150,7 @@ jobs:
149150
with:
150151
name: obs-${{ env.OBS_VERSION }}
151152
path: |
152-
bin/.pio/build/esp32dev/firmware.bin
153+
firmware.bin
153154
COPYRIGHT-ESP.html
154155
LICENSE-ARDUINO-ESP32.md
155156
LICENSE

docs/software/firmware/obs_cfg.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ relevant put the order of the array content.
4040
// For what GPS fix should the OBS wait at startup?
4141
// -2: FIX POS; -1: Time only; 0: No wait
4242
"gpsFix": -2,
43-
// Textual name of the profile - waiting for fetures to come.
43+
// PIN to be entered when accessing the OBS web interface.
44+
// a new one will be created when empty. The PIN is also displayed
45+
// on the OBS display when needed.
46+
"httpPin": "12345678",
47+
// Textual name of the profile - waiting for features to come.
4448
"name": "default",
4549
// Name of the OBS, will be used for WiFo, Bluetooth and other places
4650
// currently no way to change it, consists of OpenBikeSensor-<deviceId>
47-
"obsName": "OpenBikeSensor-affe",
51+
"obsName": "OpenBikeSensor-cafe",
4852
// The handle bar offset in cm, order right, left.
4953
"offset": [
5054
31,

platformio.ini

+3-2
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ lib_deps =
5454
adafruit/Adafruit BMP280 Library@^2.1.0
5555
pololu/VL53L0X@^1.3.0
5656
; https://github.com/fhessel/esp32_https_server
57-
esp32_https_server
57+
https://github.com/fhessel/esp32_https_server.git#feature/subjectAltName
58+
; esp32_https_server@
5859
build_flags =
5960
-DCORE_DEBUG_LEVEL=3
60-
-DHTTPS_DISABLE_SELFSIGNING
61+
-DHTTPS_LOGLEVEL=3
6162
-DHTTPS_REQUEST_MAX_REQUEST_LENGTH=1024
6263
; build number "-dev" will be replaced in github action
6364
-DBUILD_NUMBER=\"-dev\"

src/OpenBikeSensorFirmware.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static void buttonBluetooth(const DataSet *dataSet, uint16_t measureIndex) {
193193
void setup() {
194194
Serial.begin(115200);
195195

196-
log_i("setup()");
196+
log_i("openbikesensor.org - OBS/%s", OBSVersion);
197197

198198
//##############################################################
199199
// Configure button pin as INPUT
@@ -254,7 +254,7 @@ void setup() {
254254
}
255255

256256
if (SD.begin()) {
257-
displayTest->showTextOnGrid(2, displayTest->currentLine(), "SD... ok");
257+
displayTest->showTextOnGrid(2, displayTest->currentLine(), "SD... OK");
258258
}
259259
delay(333); // Added for user experience
260260

@@ -302,7 +302,7 @@ void setup() {
302302
writer = new CSVFileWriter;
303303
writer->setFileName();
304304
writer->writeHeader(trackUniqueIdentifier);
305-
displayTest->showTextOnGrid(2, displayTest->currentLine(), "CSV file... ok");
305+
displayTest->showTextOnGrid(2, displayTest->currentLine(), "CSV file... OK");
306306
} else {
307307
displayTest->showTextOnGrid(2, displayTest->currentLine(), "CSV. skipped");
308308
}

src/config.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -470,3 +470,13 @@ std::vector<int> ObsConfig::getIntegersProperty(const String &key) const {
470470
void ObsConfig::releaseJson() {
471471
jsonData.clear(); // should we just shrink?
472472
}
473+
474+
bool ObsConfig::removeConfig() {
475+
SPIFFS.remove(OLD_CONFIG_FILENAME);
476+
SPIFFS.remove(CONFIG_OLD_FILENAME);
477+
SPIFFS.remove(CONFIG_FILENAME);
478+
479+
return !SPIFFS.exists(OLD_CONFIG_FILENAME)
480+
&& !SPIFFS.exists(CONFIG_OLD_FILENAME)
481+
&& !SPIFFS.exists(CONFIG_FILENAME);
482+
}

src/config.h

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class ObsConfig {
9292
bool loadConfig(File &file);
9393
bool saveConfig() const;
9494
void printConfig() const;
95+
bool removeConfig();
9596

9697
std::vector<int> getIntegersProperty(String const &name) const;
9798
template<typename T> T getProperty(const String &key) const;

0 commit comments

Comments
 (0)