Skip to content

Commit fd71b99

Browse files
committed
v3.0.0: unified setCiphers, missing cars
- Update ESP32 NetworkClientSecure to use same syntax as ESP8266 BearSSL - Add missingCars flag to departures - Add factory-Images for ESP32 to GitHub-actions-builds
1 parent fa354fe commit fd71b99

5 files changed

Lines changed: 26 additions & 14 deletions

File tree

.github/workflows/DBTFT-pio-build.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,33 @@ jobs:
4444
run: pio ci -c ./examples/DBTFT/platformio.ini -e 2432s028r --build-dir /tmp/pio-build --keep-build-dir ./examples/DBTFT/src
4545

4646
- name: Copy CYD-ILI9341 firmware
47-
run: cp /tmp/pio-build/.pio/build/2432s028r/firmware.bin /tmp/CYD-ILI9341.bin
47+
run: |
48+
cp /tmp/pio-build/.pio/build/2432s028r/firmware.bin /tmp/CYD-ILI9341.bin
49+
cp /tmp/pio-build/.pio/build/2432s028r/firmware.factory.bin /tmp/CYD-ILI9341-factory.bin
4850
4951
- name: Upload CYD-ILI9341
5052
uses: actions/upload-artifact@v4
5153
with:
5254
name: CYD-ILI9341
53-
path: /tmp/CYD-ILI9341.bin
55+
path: |
56+
/tmp/CYD-ILI9341.bin
57+
/tmp/CYD-ILI9341-factory.bin
5458
5559
- name: Build PlatformIO Project CYD 7798
5660
run: pio ci -c ./examples/DBTFT/platformio.ini -e 2432s028r_dualusb --build-dir /tmp/pio-build --keep-build-dir ./examples/DBTFT/src
5761

5862
- name: Copy CYD-ST7798 firmware
59-
run: cp /tmp/pio-build/.pio/build/2432s028r_dualusb/firmware.bin /tmp/CYD-ST7798.bin
63+
run: |
64+
cp /tmp/pio-build/.pio/build/2432s028r_dualusb/firmware.bin /tmp/CYD-ST7798.bin
65+
cp /tmp/pio-build/.pio/build/2432s028r_dualusb/firmware.factory.bin /tmp/CYD-ST7798-factory.bin
6066
6167
- name: Upload CYD-ST7798
6268
uses: actions/upload-artifact@v4
6369
with:
6470
name: CYD-ST7798
65-
path: /tmp/CYD-ST7798.bin
71+
path: |
72+
/tmp/CYD-ST7798.bin
73+
/tmp/CYD-ST7798-factory.bin
6674
6775
- name: Attach binaries to release
6876
if: startsWith(github.ref, 'refs/tags/')
@@ -71,4 +79,6 @@ jobs:
7179
files: |
7280
/tmp/ESP8266-ILI9341.bin
7381
/tmp/CYD-ILI9341.bin
82+
/tmp/CYD-ILI9341-factory.bin
7483
/tmp/CYD-ST7798.bin
84+
/tmp/CYD-ST7798-factory.bin

DBAPI.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@ DBstation* DBAPI::getStation(
6565
*/
6666
#ifdef ESP8266
6767
BearSSL::WiFiClientSecure client;
68-
client.setCiphers(dbCipherList, sizeof(dbCipherList) / sizeof(dbCipherList[0]));
6968
#else
7069
WiFiClientSecure client;
71-
client.setCiphersuites(dbCipherList);
7270
#endif
71+
client.setCiphers(dbCipherList, sizeof(dbCipherList) / sizeof(dbCipherList[0]));
7372
client.setInsecure(); // Don't check fingerprint
7473
if (!client.connect(host, 443)) {
7574
DB_DEBUG_MSG("DBAPI: Connection to Host failed.\n");
@@ -241,11 +240,10 @@ DBdeparr* DBAPI::getStationBoard(
241240
// Init new client for each request
242241
#ifdef ESP8266
243242
BearSSL::WiFiClientSecure client;
244-
client.setCiphers(dbCipherList, sizeof(dbCipherList) / sizeof(dbCipherList[0]));
245243
#else
246244
WiFiClientSecure client;
247-
client.setCiphersuites(dbCipherList);
248245
#endif
246+
client.setCiphers(dbCipherList, sizeof(dbCipherList) / sizeof(dbCipherList[0]));
249247
client.setInsecure(); // Don't check fingerprint
250248
if (!client.connect(host, 443)) {
251249
DB_DEBUG_MSG("DBAPI: Connection to Host failed.\n");

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Wenn nicht PlatformIO genutzt wird, werden folgende Bibliotheken zusätzlich ben
1515
- https://github.com/paulstoffregen/Time
1616
- https://github.com/bbx10/Hash_tng (nur für ESP32)
1717

18+
Außerdem muss für ESP32 eine angepasste NetworkClientSecure-Bibliothek verwendet werden.
19+
Diese befindet sich in einem separaten [Branch](https://github.com/ArduinoHannover/arduino-esp32/tree/add-setciphers).
20+
1821
## Beispielcode
1922

2023
Der DBTFT-Beispielcode ist für einen ESP8266 mit ILI9341 oder ein "Cheap Yellow Display" (ESP32 mit ILI9341 oder ST7798) ausgelegt.
@@ -101,6 +104,7 @@ Mittels bitweiser Oder-Verknüpfung (`|`) können mehrere Verkehrsmittel angefra
101104
| `realTime` | `time_t` | Tatsächliche Abfahrtszeit als Unix-Timestamp |
102105
| `delay` | `int16_t` | Verspätung |
103106
| `cancelled` | `bool` | Zug entfällt |
107+
| `missingCars` | `bool` | Fehlende Wagen |
104108
| `platform` | `char[8]` | Geplantes Gleis (ggf. inkl. Abschnitt), sofern existent, sonst leer |
105109
| `newPlatform` | `char[8]` | Tatsächliches Gleis, sofern geändert, sonst leer |
106110
| `target` | `char[50]` | Zielhaltestelle |

examples/DBTFT/platformio.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ platform = espressif8266
1313
board = d1_mini
1414
framework = arduino
1515
lib_deps =
16-
soundstorm/DBAPI @ ^2.4.2
16+
soundstorm/DBAPI @ ^3.0.0
1717
arduino-libraries/NTPClient @ ^3.2.1
1818
adafruit/Adafruit GFX Library@^1.11.10
1919
adafruit/Adafruit ILI9341 @ ^1.5.12
@@ -26,13 +26,13 @@ monitor_speed = 115200
2626
[env:2432s028r]
2727
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.39/platform-espressif32.zip
2828
platform_packages =
29-
platformio/framework-arduinoespressif32 @ https://github.com/ArduinoHannover/arduino-esp32.git#adjust-cipher-suits
29+
platformio/framework-arduinoespressif32 @ https://github.com/ArduinoHannover/arduino-esp32.git#add-setciphers
3030
board = esp32dev
3131
framework = arduino
3232
build_flags = -D BOARD_2432S028R
3333
lib_ldf_mode = deep
3434
lib_deps =
35-
soundstorm/DBAPI @ ^2.4.2
35+
soundstorm/DBAPI @ ^3.0.0
3636
arduino-libraries/NTPClient @ ^3.2.1
3737
adafruit/Adafruit GFX Library@^1.11.10
3838
adafruit/Adafruit ILI9341 @ ^1.5.12
@@ -46,13 +46,13 @@ board_build.partitions = esp32_4M.csv ;0x140000 by default is apprently not enou
4646
[env:2432s028r_dualusb]
4747
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.39/platform-espressif32.zip
4848
platform_packages =
49-
platformio/framework-arduinoespressif32 @ https://github.com/ArduinoHannover/arduino-esp32.git#adjust-cipher-suits
49+
platformio/framework-arduinoespressif32 @ https://github.com/ArduinoHannover/arduino-esp32.git#add-setciphers
5050
board = esp32dev
5151
framework = arduino
5252
build_flags = -D BOARD_2432S028R -D USE_ST7798
5353
lib_ldf_mode = deep
5454
lib_deps =
55-
soundstorm/DBAPI @ ^2.4.2
55+
soundstorm/DBAPI @ ^3.0.0
5656
arduino-libraries/NTPClient @ ^3.2.1
5757
adafruit/Adafruit GFX Library@^1.11.10
5858
adafruit/Adafruit ST7735 and ST7789 Library@^1.11.0

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "DBAPI",
3-
"version": "2.4.2",
3+
"version": "3.0.0",
44
"description": "Hacon/Hafas/DB API for ESP8266 / ESP32 (WiFiClientSecure)",
55
"keywords": "train, deutsche bahn, travel",
66
"repository":

0 commit comments

Comments
 (0)