Skip to content

Commit

Permalink
Merge pull request #217 from thorrak/devel
Browse files Browse the repository at this point in the history
Convert D32 Pro to 4MB
  • Loading branch information
thorrak committed Jul 26, 2022
2 parents 81b780a + d2ee5ad commit dac8067
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
File renamed without changes.
5 changes: 5 additions & 0 deletions 4mb_no_ota.csv
@@ -0,0 +1,5 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x320000,
spiffs, data, spiffs, 0x330000,0xD0000,
24 changes: 15 additions & 9 deletions platformio.ini
Expand Up @@ -16,7 +16,7 @@

[common]
platform = espressif32
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.6
; platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.6
framework = arduino
; As the framework has grown, min_spiffs no longer has enough space. We're now
; requiring 16MB of flash space for most builds (which comes standard with the
Expand All @@ -35,7 +35,7 @@ monitor_rts = 1

build_flags = ; Do not use spaces around the "=" here, will give you a builder not found error
!python tools/git_rev.py ; Pick up git information for version (disabled), branch, and commit (in version.cpp)
-D PIO_SRC_TAG=1.1.1 ; Increment versions shown in about.htm page (from version.cpp)
-D PIO_SRC_TAG=1.1.2 ; Increment versions shown in about.htm page (from version.cpp)
; Async TCP Settings:
-D CONFIG_ASYNC_TCP_RUNNING_CORE=1 ; per: https://github.com/me-no-dev/ESPAsyncWebServer/issues/731#issuecomment-628163515
-D CONFIG_ASYNC_TCP_USE_WDT=1
Expand Down Expand Up @@ -66,10 +66,12 @@ lib_deps =
https://github.com/thorrak/Arduino-Log.git ; // Need this until ArduinoLog merges https://github.com/thijse/Arduino-Log/pull/23
https://github.com/lbussy/esptelnet.git
https://github.com/me-no-dev/ESPAsyncWebServer.git
https://github.com/lbussy/AsyncWiFiManager.git
; https://github.com/lbussy/AsyncWiFiManager.git
https://github.com/tzapu/WiFiManager.git ;#feature_asyncwebserver
h2zero/NimBLE-Arduino @ 1.3.4 ; https://github.com/h2zero/NimBLE-Arduino.git
256dpi/MQTT @ 2.4.8
https://github.com/lbussy/LCBUrl.git
https://github.com/thorrak/LCBUrl.git ; // Need this until Lee merges https://github.com/lbussy/LCBUrl/pull/43
; https://github.com/lbussy/LCBUrl.git
;https://github.com/DJMarlow/Parse-SDK-Arduino.git
https://github.com/lbussy/Parse-SDK-Arduino.git#fix_warnings

Expand All @@ -83,7 +85,7 @@ build_type = release ; debug
[env:lcd_ssd1306] ; Small OLED Board
board = lolin_d32
platform = ${common.platform}
platform_packages = ${common.platform_packages}
; platform_packages = ${common.platform_packages}
framework = ${common.framework}
; For the "OLED" variant, we can't guarantee we have more than 4MB of flash. Use
; huge_app to get us the space - but at the cost of being able to update OTA.
Expand All @@ -109,9 +111,13 @@ build_type = ${common.build_type}
[env:d32_pro_tft] ; Lolin ESP32 + ILI TFT
board = lolin_d32_pro
platform = ${common.platform}
platform_packages = ${common.platform_packages}
; platform_packages = ${common.platform_packages}
framework = ${common.framework}
board_build.partitions = large_spiffs_16MB.csv
; There's issues with the way that BrewFlasher flashes the bootloader with the latest esptool, meaning we can't use
; the 16MB boards unless we define a new devicefamily. I really don't want to do that, so we'll go back to 4MB.
; board_build.partitions = large_spiffs_16MB.csv
board_build.partitions = 4mb_no_ota.csv
; board_build.partitions = ${common.board_build.partitions}
upload_speed = ${common.upload_speed}
monitor_speed = ${common.monitor_speed}
monitor_filters = ${common.monitor_filters}
Expand Down Expand Up @@ -157,7 +163,7 @@ build_type = ${common.build_type}
; https://github.com/Bodmer/TFT_eSPI
board = esp32dev
platform = ${common.platform}
platform_packages = ${common.platform_packages}
; platform_packages = ${common.platform_packages}
framework = ${common.framework}
; The T-Display has 4MB of flash. Use huge_app to get us the space - but
; at the cost of being able to update OTA.
Expand Down Expand Up @@ -196,7 +202,7 @@ build_type = ${common.build_type}
board = m5stick-c
board_build.f_cpu = 240000000L
platform = ${common.platform}
platform_packages = ${common.platform_packages}
; platform_packages = ${common.platform_packages}
framework = ${common.framework}
board_build.partitions = ${common.board_build.partitions}
upload_speed = 1500000
Expand Down
4 changes: 1 addition & 3 deletions src/tilt/tiltScanner.cpp
Expand Up @@ -15,9 +15,7 @@ tiltScanner tilt_scanner;

void MyAdvertisedDeviceCallbacks::onResult(NimBLEAdvertisedDevice *advertisedDevice)
{
// uint8_t color = tilt_scanner.load_tilt_from_advert_hex(advertisedDevice.getManufacturerData());

if (advertisedDevice->getManufacturerData().length() > 4)
if (advertisedDevice->getManufacturerData().length() >= 24)
{
if (advertisedDevice->getManufacturerData()[0] == 0x4c && advertisedDevice->getManufacturerData()[1] == 0x00 &&
advertisedDevice->getManufacturerData()[2] == 0x02 && advertisedDevice->getManufacturerData()[3] == 0x15)
Expand Down
10 changes: 5 additions & 5 deletions src/wifi_setup.cpp
Expand Up @@ -3,10 +3,10 @@
#include <ESPmDNS.h>
#include <WiFiClient.h>
#include <LCBUrl.h>
#include <AsyncWiFiManager.h>
#include <WiFiManager.h>
#include "bridge_lcd.h"
#include "jsonconfig.h"
#include "http_server.h" // Make sure this include is after AsyncWiFiManager
#include "http_server.h" // Make sure this include is after WiFiManager
#include "serialhandler.h"

#include "wifi_setup.h"
Expand All @@ -19,7 +19,7 @@ void saveParamsCallback() {
shouldSaveConfig = true;
}

void apCallback(AsyncWiFiManager *myWiFiManager) {
void apCallback(WiFiManager *myWiFiManager) {
// Callback to display the WiFi LCD notification and set bandwidth
Log.verbose(F("Entered config mode: SSID: %s, IP: %s\r\n"), myWiFiManager->getConfigPortalSSID().c_str(), WiFi.softAPIP().toString().c_str());
lcd.display_wifi_connect_screen(myWiFiManager->getConfigPortalSSID().c_str(), WIFI_SETUP_AP_PASS);
Expand Down Expand Up @@ -58,7 +58,7 @@ void initWiFi() {

WiFi.mode(WIFI_STA); // Explicitly set mode, ESP defaults to STA+AP

AsyncWiFiManager wm;
WiFiManager wm;
#if ARDUINO_LOG_LEVEL == 6
wm.setDebugOutput(true); // Use debug if we are at max log level
#else
Expand All @@ -78,7 +78,7 @@ void initWiFi() {
wm.setCustomHeadElement("<style type=\"text/css\">body {background-image: url(\"data:image/svg+xml;utf8,%3Csvg%20id%3D%22Layer_1%22%20data-name%3D%22Layer%201%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20231.62%20169.18%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2281.067%22%20height%3D%2259.213%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%23f7f8fa%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22tb_logo%22%3E%3Cg%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M31.77%2C13.6A29.88%2C29.88%2C0%2C0%2C1%2C74%2C13.6a2.42%2C2.42%2C0%2C0%2C0%2C3.42-3.43%2C34.73%2C34.73%2C0%2C0%2C0-49.11%2C0%2C2.42%2C2.42%2C0%2C0%2C0%2C3.42%2C3.43Z%22%2F%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M67.93%2C22.13A2.42%2C2.42%2C0%2C0%2C0%2C69.64%2C18a23.65%2C23.65%2C0%2C0%2C0-33.47%2C0%2C2.42%2C2.42%2C0%2C0%2C0%2C3.42%2C3.42%2C18.84%2C18.84%2C0%2C0%2C1%2C26.63%2C0A2.42%2C2.42%2C0%2C0%2C0%2C67.93%2C22.13Z%22%2F%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M43.91%2C25.73a2.42%2C2.42%2C0%2C0%2C0%2C3.42%2C3.43%2C7.88%2C7.88%2C0%2C0%2C1%2C11.15%2C0%2C2.43%2C2.43%2C0%2C0%2C0%2C3.43-3.43A12.75%2C12.75%2C0%2C0%2C0%2C43.91%2C25.73Z%22%2F%3E%3C%2Fg%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M103.39%2C61.76H91.7C80%2C61.76%2C70.34%2C57.24%2C63%2C48.32a45.48%2C45.48%2C0%2C0%2C1-7.38-12.7%2C3.85%2C3.85%2C0%2C0%2C1-5.36%2C0A45.31%2C45.31%2C0%2C0%2C1%2C43%2C48.19%2C35.71%2C35.71%2C0%2C0%2C1%2C14.12%2C61.76H2.42a2.42%2C2.42%2C0%2C0%2C0%2C0%2C4.84h101a2.42%2C2.42%2C0%2C0%2C0%2C0-4.84Zm-52.9%2C0H34.08A42.36%2C42.36%2C0%2C0%2C0%2C46.7%2C51.26%2C52%2C52%2C0%2C0%2C0%2C50.49%2C46Zm4.84%2C0V46a50.35%2C50.35%2C0%2C0%2C0%2C3.78%2C5.3%2C42.49%2C42.49%2C0%2C0%2C0%2C12.62%2C10.5Z%22%2F%3E%3Ccircle%20class%3D%22cls-1%22%20cx%3D%2252.91%22%20cy%3D%2232.86%22%20r%3D%222.81%22%2F%3E%3Cg%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M22.39%2C77.09A2.44%2C2.44%2C0%2C0%2C1%2C20%2C74.65V64.52a2.45%2C2.45%2C0%2C0%2C1%2C4.89%2C0V74.65A2.45%2C2.45%2C0%2C0%2C1%2C22.39%2C77.09Z%22%2F%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M83.42%2C77.09A2.45%2C2.45%2C0%2C0%2C1%2C81%2C74.65V64.52a2.45%2C2.45%2C0%2C0%2C1%2C4.89%2C0V74.65A2.45%2C2.45%2C0%2C0%2C1%2C83.42%2C77.09Z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cuse%20xlink%3Ahref%3D%22%23tb_logo%22%20x%3D%220%22%20y%3D%220%22%2F%3E%3Cuse%20xlink%3Ahref%3D%22%23tb_logo%22%20x%3D%22115.81%22%20y%3D%220%22%2F%3E%3Cuse%20xlink%3Ahref%3D%22%23tb_logo%22%20x%3D%22-57.905%22%20y%3D%2284.59%22%2F%3E%3Cuse%20xlink%3Ahref%3D%22%23tb_logo%22%20x%3D%2257.905%22%20y%3D%2284.59%22%2F%3E%3Cuse%20xlink%3Ahref%3D%22%23tb_logo%22%20x%3D%22173.715%22%20y%3D%2284.59%22%2F%3E%3C%2Fsvg%3E\")}</style>");

// config.mdnsID is the default name that will appear on the form
AsyncWiFiManagerParameter custom_mdns_name("mdns", "Device (mDNS) Name", config.mdnsID, 20);
WiFiManagerParameter custom_mdns_name("mdns", "Device (mDNS) Name", config.mdnsID, 20);
wm.addParameter(&custom_mdns_name);

if (!wm.autoConnect(WIFI_SETUP_AP_NAME, WIFI_SETUP_AP_PASS)) {
Expand Down

0 comments on commit dac8067

Please sign in to comment.