Added build target for esp32 solo

This commit is contained in:
Gunnar Skjold
2022-06-01 20:51:25 +02:00
parent ba7915ca7c
commit cddb170f24
5 changed files with 93 additions and 7 deletions

View File

@@ -104,6 +104,15 @@ jobs:
asset_path: .pio/build/esp32/firmware.bin
asset_name: ams2mqtt-esp32-${{ steps.release_tag.outputs.tag }}.bin
asset_content_type: application/octet-stream
- name: Upload esp32solo binary to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .pio/build/esp32solo/firmware.bin
asset_name: ams2mqtt-esp32solo-${{ steps.release_tag.outputs.tag }}.bin
asset_content_type: application/octet-stream
- name: Upload esp32s2 binary to release
uses: actions/upload-release-asset@v1
env:

View File

@@ -17,7 +17,6 @@ extra_scripts =
pre:scripts/addversion.py
scripts/makeweb.py
[env:esp32]
platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
framework = arduino
@@ -30,9 +29,12 @@ extra_scripts =
pre:scripts/addversion.py
scripts/makeweb.py
# Tasmota has pre-built platform for C3, S2, S3 and Solo, more information at:
# https://github.com/Jason2866/esp32-arduino-lib-builder
[env:esp32s2]
platform = https://github.com/tasmota/platform-espressif32.git#v2.0.3
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.2
platform = https://github.com/tasmota/platform-espressif32/releases/download/v.2.0.3/platform-espressif32-v.2.0.3.zip
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.3
framework = arduino
board = esp32dev
board_build.mcu = esp32s2
@@ -46,3 +48,15 @@ lib_ignore = ${common.lib_ignore}
extra_scripts =
pre:scripts/addversion.py
scripts/makeweb.py
[env:esp32solo]
platform = https://github.com/tasmota/platform-espressif32/releases/download/v.2.0.3/platform-espressif32-solo1-v.2.0.3.zip
framework = arduino
board = esp32dev
board_build.f_cpu = 160000000L
build_flags = -D WEBSOCKET_DISABLED=1 -fexceptions
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
extra_scripts =
pre:scripts/addversion.py
scripts/makeweb.py

40
scripts/esp32solo/flash.sh Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/sh
if [ -z "$1" ];then
echo "Usage: "
echo " Flashing first time : $0 flash /dev/ttyUSB0"
echo " When upgrading to new version : $0 upgrade /dev/ttyUSB0"
echo " NOTE: Replace /dev/ttyUSB0 with correct port"
exit 1
fi
if [ -z "$2" ];then
echo "Please specify port"
exit 1
fi
esptool=`which esptool`
if [ -z "$esptool" ];then
esptool=`which esptool.py`
fi
if [ -z "$esptool" ];then
if [ -f esptool.py ];then
esptool="esptool.py"
fi
fi
if [ -z "$esptool" ];then
echo "esptool.py not available to run following command: "
esptool="echo esptool.py"
fi
if [ "$1" = "flash" ];then
$esptool --chip esp32 --port $2 --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect \
0x1000 bootloader_dio_40m.bin \
0x8000 partitions.bin \
0xe000 boot_app0.bin \
0x10000 firmware.bin
exit $?
elif [ "$1" = "upgrade" ];then
$esptool --chip esp32 --port $2 --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x10000 firmware.bin
exit $?
fi

14
scripts/esp32solo/mkzip.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
env="esp32solo"
build_dir=".pio/build/$env/"
if [ ! -d $build_dir ];then
echo "No build directory"
exit 1
fi
cp ~/.platformio/packages/framework-arduinoespressif32/tools/sdk/$env/bin/bootloader_dio_40m.bin $build_dir
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin $build_dir
chmod +x scripts/$env/flash.sh
zip -j $env.zip $build_dir/*.bin scripts/$env/flash.sh

View File

@@ -1614,11 +1614,15 @@ void AmsWebServer::firmwareHtml() {
String html = String((const __FlashStringHelper*) FIRMWARE_HTML);
#if defined(ESP8266)
html.replace("{chipset}", "ESP8266");
html.replace("{chipset}", "ESP8266");
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
html.replace("{chipset}", "ESP32S2");
html.replace("{chipset}", "ESP32S2");
#elif defined(ESP32)
html.replace("{chipset}", "ESP32");
#if defined(CONFIG_FREERTOS_UNICORE)
html.replace("{chipset}", "ESP32SOLO");
#else
html.replace("{chipset}", "ESP32");
#endif
#endif
server.setContentLength(html.length() + HEAD_HTML_LEN + FOOT_HTML_LEN);
@@ -1703,7 +1707,12 @@ void AmsWebServer::firmwareDownload() {
#elif defined(ESP32)
WiFiClientSecure client;
client.setInsecure();
String url = "https://github.com/gskjold/AmsToMqttBridge/releases/download/" + version + "/ams2mqtt-esp32-" + versionStripped + ".bin";
#if defined(CONFIG_FREERTOS_UNICORE)
String url = "https://github.com/gskjold/AmsToMqttBridge/releases/download/" + version + "/ams2mqtt-esp32solo-" + versionStripped + ".bin";
#else
String url = "https://github.com/gskjold/AmsToMqttBridge/releases/download/" + version + "/ams2mqtt-esp32-" + versionStripped + ".bin";
#endif
httpClient.addHeader("Referer", "https://github.com/gskjold/AmsToMqttBridge/releases");
#endif