Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge prerelease changes #108

Merged
merged 16 commits into from
Feb 1, 2024
Merged
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
25 changes: 10 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,48 @@ name: Build
on:
push:
branches:
- experimental
- v16
- master
# tags:
# - "v*"
# pull_request:
# types: [ open, synchronize, edited, reopened, closed ]

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
build:
name: Build bins for ${{ matrix.pio_env }}
strategy:
# Ensure that a builder finishes even if another fails
fail-fast: false
matrix:
pio_env: ['esp32_wifi_tft', 'esp32_wifi_iic', 'esp8266_wifi', 'esp8266_serial', 'esp32_s2_wifi', 'esp32_s2_serial']
pio_env: ['esp32_wifi_tft', 'esp32_wifi_iic', 'esp8266_wifi', 'esp8266_serial', 'esp32_s2_wifi', 'esp32_s2_serial', 'esp32_wifi_espi']

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3.3.0
- uses: actions/checkout@v4.1.1
- run: git fetch --prune --unshallow

- name: Cache pip
uses: actions/cache@v3.2.2
uses: actions/cache@v4.0.0
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Cache PlatformIO
uses: actions/cache@v3.2.2
uses: actions/cache@v4.0.0
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

- name: Set up Python
uses: actions/setup-python@v4.4.0
uses: actions/setup-python@v5.0.0

- name: Install PlatformIO
run: |
Expand Down Expand Up @@ -78,15 +82,6 @@ jobs:
run: |
cp .pio/build/${{ matrix.pio_env }}/littlefs.bin bin/${{ matrix.pio_env }}_littlefs.bin

# - name: "Create Prerelease"
# uses: "marvinpinto/action-automatic-releases@latest"
# with:
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
# prerelease: true
# files: |
# LICENSE
# bin/*.bin

- name: Create Draft Release
uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
Expand Down
Binary file modified data/index.css.gz
Binary file not shown.
Binary file modified data/index.js.gz
Binary file not shown.
112 changes: 67 additions & 45 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ default_envs = esp32_wifi_tft

[common]
framework = arduino
; The default platform & platform package only applies to ESP32 derivatives
platform = espressif32
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.14
lib_deps =
https://github.com/tzapu/WiFiManager.git ;#feature_asyncwebserver
https://github.com/tzapu/WiFiManager.git#0d84861270c3cd64f72a4eaf34443ee580d2547e ; Anchor to latest commit as of 1/26/24
pstolarz/OneWireNg@^0.13.1
https://github.com/pstolarz/Arduino-Temperature-Control-Library.git
https://github.com/pstolarz/Arduino-Temperature-Control-Library.git#ba26a1f1ee74dc875d3cc8fdb2ea1f55ee5ee333 ; Anchor to latest commit as of 1/26/24
bblanchon/ArduinoJson @ ^6.21.2
bblanchon/StreamUtils @ ^1.7.3
; https://github.com/thorrak/AsyncTCP
Expand All @@ -38,50 +41,20 @@ monitor_dtr = 1
monitor_rts = 1



; [env:esp32_m5stickc_plus]
; platform = espressif32
; board = lolin_d32
; framework = ${common.framework}
; ; For esp32_wifi_tft we want to enable LCD support, TFT support, and WiFi support
; build_flags =
; ${common.build_flags}
; -DBREWPI_LCD
; -DBREWPI_TFT
; -DESP8266_WiFi
; -DHAS_BLUETOOTH
; -DEXTERN_SENSOR_ACTUATOR_SUPPORT
; lib_deps =
; ${common.lib_deps}
; https://github.com/PaulStoffregen/XPT2046_Touchscreen
; Adafruit GFX Library
; Adafruit ILI9341
; Adafruit BusIO
; AsyncTCP
; h2zero/NimBLE-Arduino @ ^1.3.7 ; https://github.com/h2zero/NimBLE-Arduino.git

; upload_speed = 1500000
; monitor_speed = ${common.monitor_speed}
; board_build.partitions = 4mb_inc_ota.csv
; build_type = ${common.build_type}
; monitor_dtr = ${common.monitor_dtr}
; monitor_rts = ${common.monitor_rts}
; ;build_board.filesystem = spiffs
; monitor_filters =
; esp32_exception_decoder


[env:esp32_wifi_tft]
platform = espressif32
board = lolin_d32
framework = arduino
; platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.9
platform = ${common.platform}
framework = ${common.framework}
platform_packages = ${common.platform_packages}
; board_build.arduino.upstream_packages = no
; For esp32_wifi_tft we want to enable LCD support, TFT support, and WiFi support
build_flags =
${common.build_flags}
-DBREWPI_LCD
; BREWPI_TFT is the flag we're using for TFTs in general
; BREWPI_TFT_ILI9341 is the flag we're using for the "big" (LoLin) TFTs
-DBREWPI_TFT
-DBREWPI_TFT_ILI9341
-DESP8266_WiFi
-DHAS_BLUETOOTH
-DEXTERN_SENSOR_ACTUATOR_SUPPORT
Expand All @@ -108,9 +81,10 @@ monitor_filters =


[env:esp32_wifi_iic]
platform = espressif32
board = lolin_d32
platform = ${common.platform}
framework = ${common.framework}
platform_packages = ${common.platform_packages}
; For esp32_wifi_iic we want to enable LCD support, IIC support, and WiFi support
build_flags =
${common.build_flags}
Expand Down Expand Up @@ -209,14 +183,15 @@ monitor_filters = esp8266_exception_decoder, default


[env:esp32_s2_wifi]
platform = espressif32
board = lolin_s2_mini
platform = ${common.platform}
framework = ${common.framework}
platform_packages = ${common.platform_packages}
; v4.4.4 of esp-idf introduces a bug in the IIC implementation that causes MASSIVE delays
; in the IIC bus on the S2 (meaning that writes to the LCD grind the controller to a halt).
; This appears to be related to https://github.com/espressif/arduino-esp32/issues/8480#issuecomment-1708909457
platform_packages =
platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.12
; platform_packages =
; platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.12
; For esp32_s2_wifi we want to enable LCD support, IIC support, and WiFi support
; There is no Bluetooth support on this chip.
build_flags =
Expand All @@ -242,14 +217,15 @@ monitor_filters =


[env:esp32_s2_serial]
platform = espressif32
board = lolin_s2_mini
platform = ${common.platform}
framework = ${common.framework}
platform_packages = ${common.platform_packages}
; v4.4.4 of esp-idf introduces a bug in the IIC implementation that causes MASSIVE delays
; in the IIC bus on the S2 (meaning that writes to the LCD grind the controller to a halt).
; This appears to be related to https://github.com/espressif/arduino-esp32/issues/8480#issuecomment-1708909457
platform_packages =
platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.12
; platform_packages =
; platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.12
; For esp32_s2_serial we want to enable LCD support, IIC support, and Serial support
; There is no Bluetooth support on this chip.
build_flags =
Expand All @@ -270,3 +246,49 @@ build_type = ${common.build_type}
monitor_filters =
esp32_exception_decoder

[env:esp32_wifi_espi]
board = m5stick-c
platform = ${common.platform}
framework = ${common.framework}
platform_packages = ${common.platform_packages}
; board_build.arduino.upstream_packages = no
; For esp32_wifi_tft we want to enable LCD support, TFT support, and WiFi support
build_flags =
${common.build_flags}
-DBREWPI_LCD
-DBREWPI_TFT
-DBREWPI_TFT_ESPI
-DHAS_AXP192
-DESP8266_WiFi
-DHAS_BLUETOOTH
-DEXTERN_SENSOR_ACTUATOR_SUPPORT
; -DENABLE_PROMETHEUS_SERVER
-DENABLE_HTTP_INTERFACE
-DCONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED
-DCONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED
-DCONFIG_BT_NIMBLE_PINNED_TO_CORE=1
-DESP32_STOCK
-DUSER_SETUP_LOADED=1
-DST7789_DRIVER=1
-DTFT_WIDTH=135
-DTFT_HEIGHT=240
-DCGRAM_OFFSET=1
-DTFT_MISO=-1
-DTFT_MOSI=15
-DTFT_SCLK=13
-DTFT_CS=5
-DTFT_DC=23
-DTFT_RST=18
-DLOAD_GFXFF=1

lib_deps =
${common.lib_deps}
${common.lib_deps_bluetooth}
bodmer/TFT_eSPI @ 2.5.34 ; https://github.com/Bodmer/TFT_eSPI.git
upload_speed = 1500000
monitor_speed = ${common.monitor_speed}
board_build.partitions = 4mb_inc_ota.csv
;board_build.filesystem = spiffs
build_type = ${common.build_type}
monitor_filters =
esp32_exception_decoder
13 changes: 11 additions & 2 deletions src/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@


#ifdef BREWPI_TFT
// Check for generic settings for all TFT display types

#ifdef ESP8266
#error "Unable to use TFT displays with ESP8266 (not enough pins)"
Expand All @@ -162,15 +163,23 @@
#error "TFT displays only work with ESP32 devices"
#endif

// Pin definitions for TFT displays
#if defined(BREWPI_TFT_ILI9341)
// Pin definitions for TFT displays using the ILI9341 driver
#define TFT_CS 14 //for D32 Pro
#define TFT_DC 27 //for D32 Pro
#define TFT_RST 33 //for D32 Pro
#define TS_CS 12 //for D32 Pro
#define TFT_BACKLIGHT 32
#define BREWPI_MENU 0

#elif defined(BREWPI_TFT_ESPI)
// Pin definitions are set in platformio.ini
#define BREWPI_MENU 0
#else
#error "Unknown TFT display type"
#endif

#endif // BREWPI_TFT
//
//////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -346,7 +355,7 @@



#define FIRMWARE_REVISION "0.16"
#define FIRMWARE_REVISION "v16-alpha1"

#ifdef ESP8266_WiFi
#define WIFI_SETUP_AP_NAME "BrewPiAP"
Expand Down
14 changes: 12 additions & 2 deletions src/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,18 @@
* according to the compile-time config.
*/

#include "DisplayBase.h"
#include "DisplayLcd.h"
#include "displays/DisplayBase.h"

#ifdef BREWPI_IIC
// DisplayLCD covers both I2C and SPI LCD20004, as well as OLED 4 bit
#include "displays/DisplayLcd.h"
#elif defined(BREWPI_TFT_ILI9341)
#include "displays/DisplayTFT_ILI.h"
#elif defined(BREWPI_TFT_ESPI)
#include "displays/DisplayTFT_eSPI.h"
#else
#error "Must select at least one valid display type!"
#endif

typedef LcdDisplay DisplayType;

Expand Down
2 changes: 1 addition & 1 deletion src/ESP_BP_WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void initialize_wifi() {
// Not sure if wm.SetCleanConnect breaks the hack we have below for the race condition - no reason to test it.
// wifiManager.setCleanConnect(true); // Always disconnect before connecting
// wm.setCountry is causing crashes under Arduino Core 2.0, apparently
// wifiManager.setCountry("US"); // US country code is most restrictive, use for all countries
wifiManager.setCountry("US"); // US country code is most restrictive, use for all countries


// There is a race condition on some routers when processing the deauthorization that the ESP attempts as it
Expand Down
4 changes: 4 additions & 0 deletions src/JsonKeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ constexpr auto apiKey = "apiKey";
constexpr auto upstreamRegistrationError = "upstreamRegistrationError";
constexpr auto messageID = "messageID";
constexpr auto guid = "guid";
constexpr auto firmwareVersion = "fwVersion";
constexpr auto firmwareRelease = "fwRelease";
constexpr auto firmwareRevision = "fwRevision";
constexpr auto firmwareTag = "fwTag";
}; // namespace UpstreamSettingsKeys


Expand Down
10 changes: 5 additions & 5 deletions src/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ bool blinkLoop(
}

void clearSettingText() {
#ifndef BREWPI_TFT
#ifdef BREWPI_IIC
display.printAt_P(0, rotaryEncoder.read(), STR_6SPACES);
#endif
}
Expand Down Expand Up @@ -126,7 +126,7 @@ void changedMode() {
}

void clearMode() {
#ifndef BREWPI_TFT
#ifdef BREWPI_IIC
display.printAt_P(7, 0, PSTR(" ")); // print 13 spaces
#endif
}
Expand Down Expand Up @@ -180,7 +180,7 @@ void pickTempSetting(ReadTemp readTemp, WriteTemp writeTemp, const char* tempNam
lastChangeTime = ticks.seconds();
blinkTimer = 0;
startVal = tenthsToFixed(rotaryEncoder.read());
#ifndef BREWPI_TFT
#ifdef BREWPI_IIC
display.printTemperatureAt(12, row, startVal);
#endif

Expand All @@ -194,12 +194,12 @@ void pickTempSetting(ReadTemp readTemp, WriteTemp writeTemp, const char* tempNam
}
else{
if(blinkTimer == 0){
#ifndef BREWPI_TFT
#ifdef BREWPI_IIC
display.printTemperatureAt(12, row, startVal);
#endif
}
if(blinkTimer == 128){
#ifndef BREWPI_TFT
#ifdef BREWPI_IIC
display.printAt_P(12, row, STR_6SPACES); // only 5 needed, but 6 is okay to and lets us re-use the string
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/RotaryEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void RotaryEncoder::process(){

void RotaryEncoder::setPushed(){
pushFlag = true;
#ifndef BREWPI_TFT
#ifdef BREWPI_IIC
display.resetBacklightTimer();
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/Simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void simulateLoop()
// update the lcd for the chamber being displayed
display.printAll();

#ifndef BREWPI_TFT
#ifdef BREWPI_IIC
display.updateBacklight();
#endif
}
Expand Down
1 change: 0 additions & 1 deletion src/TemperatureFormats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ char * fixedPointToString(char * s, long_temperature rawValue, uint8_t numDecima
*/
temperature stringToTemp(const char * numberString){
char tempBuffer[20];
int bufferIdx = 0;
char tempFormat = tempControl.cc.tempFormat;

for (int i = 0; numberString[i] != '\0' && i < 19; i++) {
Expand Down
Loading