mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +03:00
Compare commits
47 Commits
developmen
...
ESP32-A1S-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67ea623ba3 | ||
|
|
9dbddd2c18 | ||
|
|
72345e1394 | ||
|
|
f3662d4ca8 | ||
|
|
386f5a8cf7 | ||
|
|
d23def1c02 | ||
|
|
2861940b30 | ||
|
|
14f1e00540 | ||
|
|
f1232eb83a | ||
|
|
42882265dd | ||
|
|
56d3c86b60 | ||
|
|
445d335974 | ||
|
|
4825dc6644 | ||
|
|
33ad6d5950 | ||
|
|
8ad02bd24c | ||
|
|
412227b958 | ||
|
|
754b864647 | ||
|
|
65571c4fb6 | ||
|
|
81bcc0def5 | ||
|
|
24e060cb3b | ||
|
|
b46ae1e77c | ||
|
|
45b655c34c | ||
|
|
0d954b2132 | ||
|
|
6a215b81c7 | ||
|
|
bfc1544ed1 | ||
|
|
6866216dd0 | ||
|
|
42b9a54a45 | ||
|
|
f6282fb798 | ||
|
|
830f1324ec | ||
|
|
f8a425e188 | ||
|
|
117aab6bef | ||
|
|
c73566caef | ||
|
|
4167abb00e | ||
|
|
3e74292fc0 | ||
|
|
b301376fc6 | ||
|
|
262f5ff3e7 | ||
|
|
d379858dd2 | ||
|
|
368832d0d5 | ||
|
|
be1d841039 | ||
|
|
6ae47a908b | ||
|
|
797a21ee9f | ||
|
|
7f1db60c45 | ||
|
|
fb530645b8 | ||
|
|
7f932630fc | ||
|
|
458efb376a | ||
|
|
3ffbe022e5 | ||
|
|
762c529563 |
145
.github/workflows/CrossBuild.yml
vendored
Normal file
145
.github/workflows/CrossBuild.yml
vendored
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
# This is a basic workflow to help you get started with Actions
|
||||||
|
|
||||||
|
name: Cross-Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master-cmake ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master-cmake ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
job1:
|
||||||
|
name: Build Number
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
build_number: ${{ steps.buildnumber.outputs.build_number }}
|
||||||
|
steps:
|
||||||
|
- name: Generate common build number
|
||||||
|
id: buildnumber
|
||||||
|
uses: einaregilsson/build-number@v2
|
||||||
|
with:
|
||||||
|
token: ${{secrets.github_token}}
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: job1
|
||||||
|
strategy:
|
||||||
|
max-parallel: 1
|
||||||
|
matrix:
|
||||||
|
node: [I2S-4MFlash, ESP32-A1S, SqueezeAmp]
|
||||||
|
steps:
|
||||||
|
- name: Set target name
|
||||||
|
run: |
|
||||||
|
echo "TARGET_BUILD_NAME=${{ matrix.node }}" >> $GITHUB_ENV
|
||||||
|
echo "build_version_prefix=V0." >> $GITHUB_ENV
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 15
|
||||||
|
submodules: true
|
||||||
|
- name: Cache build
|
||||||
|
id: cache-build
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{github.workspace}}/build
|
||||||
|
key: ${{ runner.os }}-${{ matrix.node }}
|
||||||
|
- name: Set build parameters
|
||||||
|
run: |
|
||||||
|
shopt -s nocasematch
|
||||||
|
branch_name="${GITHUB_REF//refs\/heads\//}"
|
||||||
|
branch_name="${branch_name//[^a-zA-Z0-9\-~!@_\.]/}"
|
||||||
|
BUILD_NUMBER=${{ needs.job1.outputs.build_number }}
|
||||||
|
echo "BUILD_NUMBER=${BUILD_NUMBER}" >> $GITHUB_ENV
|
||||||
|
tag="${TARGET_BUILD_NAME}-development-${BUILD_NUMBER}-${branch_name}"
|
||||||
|
echo "tag=${tag}" >> $GITHUB_ENV
|
||||||
|
last_commit="$(git log --pretty=format:'%s' --max-count=1)"
|
||||||
|
if [[ "$last_commit" =~ .*"Release".* ]]; then echo "release_flag=1" >> $GITHUB_ENV; else echo "release_flag=0" >> $GITHUB_ENV; fi
|
||||||
|
name="development.${BUILD_NUMBER}#v4.0#${TARGET_BUILD_NAME}#${branch_name}"
|
||||||
|
artifact_prefix="squeezelite-esp32-${branch_name}-${TARGET_BUILD_NAME}-${build_version_prefix}${BUILD_NUMBER}"
|
||||||
|
artifact_file_name="${artifact_prefix}.zip"
|
||||||
|
artifact_bin_file_name="${artifact_prefix}.bin"
|
||||||
|
echo "name=${name}" >> $GITHUB_ENV
|
||||||
|
echo "last_commit=${last_commit}" >> $GITHUB_ENV
|
||||||
|
echo "artifact_file_name=${artifact_file_name}" >> $GITHUB_ENV
|
||||||
|
echo "PROJECT_VER=${TARGET_BUILD_NAME}-${{ steps.buildnumber.outputs.build_number }} " >> $GITHUB_ENV
|
||||||
|
echo "artifact_bin_file_name=${artifact_bin_file_name}" >> $GITHUB_ENV
|
||||||
|
description=""
|
||||||
|
description=${description}$'------------------------------\n### Revision Log\n\n'
|
||||||
|
description="$description$(git log --pretty=format:'%h %s (%cI) <%an>' --abbrev-commit --max-count=15 | sed --r 's/(^[\*]+)/\\\1/g') "
|
||||||
|
echo 'description<<~EOD' >> $GITHUB_ENV
|
||||||
|
echo ${description}>> $GITHUB_ENV
|
||||||
|
echo '~EOD' >> $GITHUB_ENV
|
||||||
|
echo #######
|
||||||
|
echo ####### Environment
|
||||||
|
echo #######
|
||||||
|
env
|
||||||
|
echo #######
|
||||||
|
echo ####### GITHUB ENV
|
||||||
|
echo #######
|
||||||
|
cat $GITHUB_ENV
|
||||||
|
- name: Build the firmware
|
||||||
|
run: |
|
||||||
|
env | grep "artifact\|tag\|GITHUB\|version\|NUMBER\|TARGET" >${TARGET_BUILD_NAME}-env.txt
|
||||||
|
echo "${tag}" >version.txt
|
||||||
|
docker run --env-file=${TARGET_BUILD_NAME}-env.txt --rm -v $PWD:/project -w /project espressif/idf:release-v4.0 /bin/bash -c "cp build-scripts/${TARGET_BUILD_NAME}-sdkconfig.defaults sdkconfig && idf.py build && zip build/${artifact_file_name} partitions*.csv build/*.bin build/bootloader/bootloader.bin build/partition_table/partition-table.bin build/flash_project_args build/size_*.txt"
|
||||||
|
# - name: Build Mock firmware
|
||||||
|
# run: |
|
||||||
|
# mkdir -p build
|
||||||
|
# cd build
|
||||||
|
# mkdir -p partition_table
|
||||||
|
# mkdir -p bootloader
|
||||||
|
# echo "mock content"> squeezelite.bin
|
||||||
|
# echo "mock content"> recovery.bin
|
||||||
|
# echo "mock content"> ./bootloader/bootloader.bin
|
||||||
|
# echo "mock content"> ./partition_table/partition-table.bin
|
||||||
|
# echo "mock content"> flash_project_args
|
||||||
|
# echo "mock content"> size_comp1.txt
|
||||||
|
# echo "mock content"> size_comp2.txt
|
||||||
|
# echo "mock content"> ../partitions.csv
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ${{ env.artifact_file_name }}
|
||||||
|
path: |
|
||||||
|
build/*.bin
|
||||||
|
build/bootloader/bootloader.bin
|
||||||
|
build/partition_table/partition-table.bin
|
||||||
|
build/flash_project_args
|
||||||
|
build/size_comp1.txt
|
||||||
|
build/size_comp2.txt
|
||||||
|
partitions.csv
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ${{ env.artifact_bin_file_name }}
|
||||||
|
path: |
|
||||||
|
build/squeezelite.bin
|
||||||
|
- name: Create Release
|
||||||
|
if: env.release_flag == 1
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
||||||
|
with:
|
||||||
|
tag_name: ${{ env.tag }}
|
||||||
|
release_name: ${{ env.name }}
|
||||||
|
body: ${{ env.description }}
|
||||||
|
draft: false
|
||||||
|
prerelease: true
|
||||||
|
- name: Upload Release Asset - Squeezelite binary file
|
||||||
|
id: upload-release-asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
||||||
|
asset_path: build/squeezelite.bin
|
||||||
|
asset_name: ${{ env.artifact_bin_file_name }}
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
- name: Upload Release Asset - Zip file
|
||||||
|
id: upload-release-asset-zip
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
||||||
|
asset_path: build/${{ env.artifact_file_name }}
|
||||||
|
asset_name: ${{ env.artifact_file_name }}
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
26
.gitignore
vendored
26
.gitignore
vendored
@@ -69,3 +69,29 @@ squeezelite-esp32-jsonblob.zip
|
|||||||
/flash_cmd.txt
|
/flash_cmd.txt
|
||||||
/writeSequeezeEsp.bat
|
/writeSequeezeEsp.bat
|
||||||
/writeSequeezeEsp.sh
|
/writeSequeezeEsp.sh
|
||||||
|
all_releases.json
|
||||||
|
alltags.txt
|
||||||
|
releases.json
|
||||||
|
sdkconfig
|
||||||
|
|
||||||
|
.vscode/c_cpp_properties.json
|
||||||
|
|
||||||
|
.vscode/launch.json
|
||||||
|
|
||||||
|
.vscode/settings.json
|
||||||
|
|
||||||
|
.vscode/tasks.json
|
||||||
|
|
||||||
|
components/wifi-manager/.project
|
||||||
|
|
||||||
|
components/wifi-manager/.settings/.jsdtscope
|
||||||
|
|
||||||
|
components/wifi-manager/.settings/org.eclipse.wst.jsdt.ui.superType.container
|
||||||
|
|
||||||
|
components/wifi-manager/.settings/org.eclipse.wst.jsdt.ui.superType.name
|
||||||
|
|
||||||
|
components/wifi-manager/res/backup/
|
||||||
|
|
||||||
|
*.code-workspace
|
||||||
|
|
||||||
|
test/.vscode/
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
set(EXTRA_COMPONENT_DIRS components/platform_console/app_recovery components/platform_console/app_squeezelite )
|
set(EXTRA_COMPONENT_DIRS components/platform_console/app_recovery components/platform_console/app_squeezelite )
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
|
add_definitions(-DbSqueezeESP32)
|
||||||
message(STATUS "Building RECOVERY")
|
message(STATUS "Building RECOVERY")
|
||||||
project(recovery)
|
project(recovery)
|
||||||
set_property(TARGET recovery.elf PROPERTY RECOVERY_PREFIX app_recovery )
|
set_property(TARGET recovery.elf PROPERTY RECOVERY_PREFIX app_recovery )
|
||||||
@@ -11,5 +11,5 @@ include(squeezelite.cmake)
|
|||||||
|
|
||||||
set(PROJECT_VER $ENV{PROJECT_VER})
|
set(PROJECT_VER $ENV{PROJECT_VER})
|
||||||
|
|
||||||
#target_compile_definitions(__idf_squeezelite-ota PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE)
|
#target_compile_definitions(__idf_squeezelite-ota PRIVATE DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE)
|
||||||
#target_compile_definitions(__idf_driver_bt PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE)
|
#target_compile_definitions(__idf_driver_bt PRIVATE DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE)
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -1,3 +1,7 @@
|
|||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
# Squeezelite-esp32
|
# Squeezelite-esp32
|
||||||
## Supported Hardware
|
## Supported Hardware
|
||||||
### SqueezeAMP
|
### SqueezeAMP
|
||||||
@@ -250,15 +254,7 @@ The above command will mount this repo into the docker container and start a bas
|
|||||||
for you to then follow the below build steps
|
for you to then follow the below build steps
|
||||||
|
|
||||||
### Manual Install of ESP-IDF
|
### Manual Install of ESP-IDF
|
||||||
<<<<<<< HEAD
|
|
||||||
Follow the instructions from https://docs.espressif.com/projects/esp-idf/en/v4.0/get-started/index.html to install the esp-idf v4.0. This is the currently supported release of the espressif software development system.
|
Follow the instructions from https://docs.espressif.com/projects/esp-idf/en/v4.0/get-started/index.html to install the esp-idf v4.0. This is the currently supported release of the espressif software development system.
|
||||||
=======
|
|
||||||
<strong>Currently the master branch of this project requires this [IDF](https://github.com/espressif/esp-idf/tree/28f1cdf5ed7149d146ad5019c265c8bc3bfa2ac9) with gcc 5.2 (toolschain dated 20181001)
|
|
||||||
If you want to use a more recent version of gcc and IDF (4.0 stable), move to cmake-master branch</strong>
|
|
||||||
|
|
||||||
You can install IDF manually on Linux or Windows (using the Subsystem for Linux) following the instructions at: https://www.instructables.com/id/ESP32-Development-on-Windows-Subsystem-for-Linux/
|
|
||||||
You also need to use esp-dsp recent version or at least make sure you have this patch https://github.com/espressif/esp-dsp/pull/12/commits/8b082c1071497d49346ee6ed55351470c1cb4264
|
|
||||||
>>>>>>> refs/remotes/origin/master
|
|
||||||
|
|
||||||
## Building Squeezelite-esp32
|
## Building Squeezelite-esp32
|
||||||
MOST IMPORTANT: create the right default config file
|
MOST IMPORTANT: create the right default config file
|
||||||
@@ -354,3 +350,5 @@ See squeezlite command line, but keys options are
|
|||||||
- If you have already cloned the repository and you are getting compile errors on one of the submodules (e.g. telnet), run the following git command in the root of the repository location
|
- If you have already cloned the repository and you are getting compile errors on one of the submodules (e.g. telnet), run the following git command in the root of the repository location
|
||||||
- git submodule update --init --recursive
|
- git submodule update --init --recursive
|
||||||
|
|
||||||
|
## Additional notes
|
||||||
|
Build will start migrating to github workflows
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,840 +0,0 @@
|
|||||||
#
|
|
||||||
# Automatically generated file. DO NOT EDIT.
|
|
||||||
# Espressif IoT Development Framework (ESP-IDF) Project Configuration
|
|
||||||
#
|
|
||||||
CONFIG_IDF_TARGET_ESP32=y
|
|
||||||
CONFIG_IDF_TARGET="esp32"
|
|
||||||
CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000
|
|
||||||
|
|
||||||
#
|
|
||||||
# SDK tool configuration
|
|
||||||
#
|
|
||||||
CONFIG_SDK_TOOLPREFIX="xtensa-esp32-elf-"
|
|
||||||
CONFIG_APP_COMPILE_TIME_DATE=y
|
|
||||||
# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set
|
|
||||||
# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set
|
|
||||||
# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set
|
|
||||||
# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set
|
|
||||||
# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set
|
|
||||||
CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
|
|
||||||
# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set
|
|
||||||
# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set
|
|
||||||
CONFIG_BOOTLOADER_LOG_LEVEL=3
|
|
||||||
CONFIG_BOOTLOADER_SPI_WP_PIN=7
|
|
||||||
CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y
|
|
||||||
# CONFIG_BOOTLOADER_FACTORY_RESET is not set
|
|
||||||
# CONFIG_BOOTLOADER_APP_TEST is not set
|
|
||||||
CONFIG_BOOTLOADER_WDT_ENABLE=y
|
|
||||||
# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set
|
|
||||||
CONFIG_BOOTLOADER_WDT_TIME_MS=9000
|
|
||||||
# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set
|
|
||||||
# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set
|
|
||||||
# CONFIG_SECURE_BOOT_ENABLED is not set
|
|
||||||
# CONFIG_SECURE_FLASH_ENC_ENABLED is not set
|
|
||||||
CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200
|
|
||||||
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
|
|
||||||
# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set
|
|
||||||
# CONFIG_ESPTOOLPY_FLASHMODE_DIO is not set
|
|
||||||
# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set
|
|
||||||
CONFIG_ESPTOOLPY_FLASHMODE="dio"
|
|
||||||
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
|
|
||||||
# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set
|
|
||||||
# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set
|
|
||||||
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
|
|
||||||
CONFIG_ESPTOOLPY_FLASHFREQ="80m"
|
|
||||||
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
|
|
||||||
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
|
|
||||||
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
|
||||||
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
|
|
||||||
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
|
|
||||||
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
|
|
||||||
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
|
|
||||||
CONFIG_ESPTOOLPY_BEFORE_RESET=y
|
|
||||||
# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
|
|
||||||
CONFIG_ESPTOOLPY_BEFORE="default_reset"
|
|
||||||
CONFIG_ESPTOOLPY_AFTER_RESET=y
|
|
||||||
# CONFIG_ESPTOOLPY_AFTER_NORESET is not set
|
|
||||||
CONFIG_ESPTOOLPY_AFTER="hard_reset"
|
|
||||||
# CONFIG_ESPTOOLPY_MONITOR_BAUD_9600B is not set
|
|
||||||
# CONFIG_ESPTOOLPY_MONITOR_BAUD_57600B is not set
|
|
||||||
CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y
|
|
||||||
# CONFIG_ESPTOOLPY_MONITOR_BAUD_230400B is not set
|
|
||||||
# CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B is not set
|
|
||||||
# CONFIG_ESPTOOLPY_MONITOR_BAUD_2MB is not set
|
|
||||||
# CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER is not set
|
|
||||||
CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER_VAL=115200
|
|
||||||
CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
|
|
||||||
# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
|
|
||||||
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
|
|
||||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
|
||||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|
||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
|
||||||
CONFIG_PARTITION_TABLE_OFFSET=0x8000
|
|
||||||
CONFIG_PARTITION_TABLE_MD5=y
|
|
||||||
CONFIG_LOGGING_SLIMPROTO="info"
|
|
||||||
CONFIG_LOGGING_STREAM="info"
|
|
||||||
CONFIG_LOGGING_DECODE="info"
|
|
||||||
CONFIG_LOGGING_OUTPUT="info"
|
|
||||||
# CONFIG_SQUEEZEAMP is not set
|
|
||||||
# CONFIG_A1S is not set
|
|
||||||
CONFIG_BASIC_I2C_BT=y
|
|
||||||
CONFIG_I2S_NUM=0
|
|
||||||
CONFIG_I2S_BCK_IO=33
|
|
||||||
CONFIG_I2S_WS_IO=25
|
|
||||||
CONFIG_I2S_DO_IO=32
|
|
||||||
CONFIG_I2S_DI_IO=-1
|
|
||||||
CONFIG_SDIF_NUM=0
|
|
||||||
CONFIG_SPDIF_BCK_IO=33
|
|
||||||
CONFIG_SPDIF_WS_IO=25
|
|
||||||
CONFIG_SPDIF_DO_IO=15
|
|
||||||
CONFIG_A2DP_SINK_NAME="SMSL BT4.2"
|
|
||||||
CONFIG_A2DP_DEV_NAME="Squeezelite"
|
|
||||||
CONFIG_A2DP_CONTROL_DELAY_MS=500
|
|
||||||
CONFIG_A2DP_CONNECT_TIMEOUT_MS=1000
|
|
||||||
CONFIG_BT_SINK=y
|
|
||||||
CONFIG_BT_NAME="ESP32-BT"
|
|
||||||
CONFIG_BT_SINK_PIN=1234
|
|
||||||
CONFIG_AIRPLAY_SINK=y
|
|
||||||
CONFIG_AIRPLAY_NAME="ESP32-AirPlay"
|
|
||||||
CONFIG_AIRPLAY_PORT="5000"
|
|
||||||
CONFIG_DISPLAY_CONFIG=""
|
|
||||||
CONFIG_I2C_CONFIG=""
|
|
||||||
CONFIG_SPI_CONFIG=""
|
|
||||||
CONFIG_SET_GPIO=""
|
|
||||||
CONFIG_ROTARY_ENCODER=""
|
|
||||||
CONFIG_LED_GREEN_GPIO=-1
|
|
||||||
CONFIG_LED_RED_GPIO=-1
|
|
||||||
CONFIG_JACK_GPIO=-1
|
|
||||||
CONFIG_SPKFAULT_GPIO=-1
|
|
||||||
CONFIG_BAT_CHANNEL=-1
|
|
||||||
CONFIG_WIFI_MANAGER_TASK_PRIORITY=5
|
|
||||||
CONFIG_WIFI_MANAGER_MAX_RETRY=2
|
|
||||||
CONFIG_DEFAULT_AP_SSID="squeezelite"
|
|
||||||
CONFIG_DEFAULT_AP_PASSWORD="squeezelite"
|
|
||||||
CONFIG_DEFAULT_AP_CHANNEL=1
|
|
||||||
CONFIG_DEFAULT_AP_IP="192.168.4.1"
|
|
||||||
CONFIG_DEFAULT_AP_GATEWAY="192.168.4.1"
|
|
||||||
CONFIG_DEFAULT_AP_NETMASK="255.255.255.0"
|
|
||||||
CONFIG_DEFAULT_AP_MAX_CONNECTIONS=4
|
|
||||||
CONFIG_DEFAULT_AP_BEACON_INTERVAL=100
|
|
||||||
CONFIG_DEFAULT_COMMAND_LINE="squeezelite -o I2S -b 500:2000 -d all=info -C 30"
|
|
||||||
# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set
|
|
||||||
CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y
|
|
||||||
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE is not set
|
|
||||||
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y
|
|
||||||
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set
|
|
||||||
# CONFIG_COMPILER_CXX_EXCEPTIONS is not set
|
|
||||||
CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y
|
|
||||||
# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set
|
|
||||||
# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set
|
|
||||||
# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set
|
|
||||||
# CONFIG_COMPILER_STACK_CHECK is not set
|
|
||||||
# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set
|
|
||||||
# CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set
|
|
||||||
# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set
|
|
||||||
CONFIG_ESP32_APPTRACE_DEST_NONE=y
|
|
||||||
# CONFIG_ESP32_APPTRACE_ENABLE is not set
|
|
||||||
CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y
|
|
||||||
CONFIG_BT_ENABLED=y
|
|
||||||
# CONFIG_BTDM_CTRL_MODE_BLE_ONLY is not set
|
|
||||||
CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y
|
|
||||||
# CONFIG_BTDM_CTRL_MODE_BTDM is not set
|
|
||||||
CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN=2
|
|
||||||
CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN=0
|
|
||||||
# CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_HCI is not set
|
|
||||||
CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM=y
|
|
||||||
CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF=1
|
|
||||||
# CONFIG_BTDM_CTRL_AUTO_LATENCY_EFF is not set
|
|
||||||
CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=0
|
|
||||||
CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF=2
|
|
||||||
CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF=0
|
|
||||||
CONFIG_BTDM_CTRL_PINNED_TO_CORE_0=y
|
|
||||||
# CONFIG_BTDM_CTRL_PINNED_TO_CORE_1 is not set
|
|
||||||
CONFIG_BTDM_CTRL_PINNED_TO_CORE=0
|
|
||||||
CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y
|
|
||||||
# CONFIG_BTDM_CTRL_HCI_MODE_UART_H4 is not set
|
|
||||||
CONFIG_BTDM_MODEM_SLEEP=y
|
|
||||||
CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG=y
|
|
||||||
# CONFIG_BTDM_MODEM_SLEEP_MODE_EVED is not set
|
|
||||||
CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL=y
|
|
||||||
CONFIG_BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF=1
|
|
||||||
# CONFIG_BTDM_COEX_BT_OPTIONS is not set
|
|
||||||
CONFIG_BT_BLUEDROID_ENABLED=y
|
|
||||||
# CONFIG_BT_NIMBLE_ENABLED is not set
|
|
||||||
# CONFIG_BT_CONTROLLER_ONLY is not set
|
|
||||||
CONFIG_BT_BTC_TASK_STACK_SIZE=3072
|
|
||||||
CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y
|
|
||||||
# CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 is not set
|
|
||||||
CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0
|
|
||||||
CONFIG_BT_BTU_TASK_STACK_SIZE=4096
|
|
||||||
# CONFIG_BT_BLUEDROID_MEM_DEBUG is not set
|
|
||||||
CONFIG_BT_CLASSIC_ENABLED=y
|
|
||||||
CONFIG_BT_A2DP_ENABLE=y
|
|
||||||
# CONFIG_BT_SPP_ENABLED is not set
|
|
||||||
# CONFIG_BT_HFP_ENABLE is not set
|
|
||||||
CONFIG_BT_SSP_ENABLED=y
|
|
||||||
CONFIG_BT_BLE_ENABLED=y
|
|
||||||
CONFIG_BT_GATTS_ENABLE=y
|
|
||||||
# CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set
|
|
||||||
CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y
|
|
||||||
CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0
|
|
||||||
CONFIG_BT_GATTC_ENABLE=y
|
|
||||||
# CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set
|
|
||||||
CONFIG_BT_BLE_SMP_ENABLE=y
|
|
||||||
# CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set
|
|
||||||
CONFIG_BT_STACK_NO_LOG=y
|
|
||||||
CONFIG_BT_ACL_CONNECTIONS=4
|
|
||||||
CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y
|
|
||||||
CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y
|
|
||||||
# CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set
|
|
||||||
CONFIG_BT_SMP_ENABLE=y
|
|
||||||
CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30
|
|
||||||
CONFIG_BT_RESERVE_DRAM=0xdb5c
|
|
||||||
# CONFIG_BLE_MESH is not set
|
|
||||||
# CONFIG_ADC_FORCE_XPD_FSM is not set
|
|
||||||
CONFIG_ADC_DISABLE_DAC=y
|
|
||||||
# CONFIG_SPI_MASTER_IN_IRAM is not set
|
|
||||||
CONFIG_SPI_MASTER_ISR_IN_IRAM=y
|
|
||||||
# CONFIG_SPI_SLAVE_IN_IRAM is not set
|
|
||||||
CONFIG_SPI_SLAVE_ISR_IN_IRAM=y
|
|
||||||
# CONFIG_EFUSE_CUSTOM_TABLE is not set
|
|
||||||
# CONFIG_EFUSE_VIRTUAL is not set
|
|
||||||
# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set
|
|
||||||
CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y
|
|
||||||
# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set
|
|
||||||
CONFIG_EFUSE_MAX_BLK_LEN=192
|
|
||||||
# CONFIG_ESP_TLS_SERVER is not set
|
|
||||||
CONFIG_ESP32_REV_MIN_0=y
|
|
||||||
# CONFIG_ESP32_REV_MIN_1 is not set
|
|
||||||
# CONFIG_ESP32_REV_MIN_2 is not set
|
|
||||||
# CONFIG_ESP32_REV_MIN_3 is not set
|
|
||||||
CONFIG_ESP32_REV_MIN=0
|
|
||||||
CONFIG_ESP32_DPORT_WORKAROUND=y
|
|
||||||
# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set
|
|
||||||
# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set
|
|
||||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
|
||||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
|
|
||||||
CONFIG_ESP32_SPIRAM_SUPPORT=y
|
|
||||||
CONFIG_SPIRAM_BOOT_INIT=y
|
|
||||||
# CONFIG_SPIRAM_USE_MEMMAP is not set
|
|
||||||
# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
|
|
||||||
CONFIG_SPIRAM_USE_MALLOC=y
|
|
||||||
CONFIG_SPIRAM_TYPE_AUTO=y
|
|
||||||
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
|
|
||||||
# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
|
|
||||||
CONFIG_SPIRAM_SIZE=-1
|
|
||||||
# CONFIG_SPIRAM_SPEED_40M is not set
|
|
||||||
CONFIG_SPIRAM_SPEED_80M=y
|
|
||||||
CONFIG_SPIRAM_MEMTEST=y
|
|
||||||
CONFIG_SPIRAM_CACHE_WORKAROUND=y
|
|
||||||
CONFIG_SPIRAM_BANKSWITCH_ENABLE=y
|
|
||||||
CONFIG_SPIRAM_BANKSWITCH_RESERVE=8
|
|
||||||
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=256
|
|
||||||
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
|
|
||||||
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=65536
|
|
||||||
CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y
|
|
||||||
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
|
|
||||||
# CONFIG_SPIRAM_OCCUPY_HSPI_HOST is not set
|
|
||||||
CONFIG_SPIRAM_OCCUPY_VSPI_HOST=y
|
|
||||||
# CONFIG_SPIRAM_OCCUPY_NO_HOST is not set
|
|
||||||
CONFIG_D0WD_PSRAM_CLK_IO=17
|
|
||||||
CONFIG_D0WD_PSRAM_CS_IO=16
|
|
||||||
CONFIG_D2WD_PSRAM_CLK_IO=9
|
|
||||||
CONFIG_D2WD_PSRAM_CS_IO=10
|
|
||||||
CONFIG_PICO_PSRAM_CS_IO=10
|
|
||||||
# CONFIG_ESP32_MEMMAP_TRACEMEM is not set
|
|
||||||
# CONFIG_ESP32_MEMMAP_TRACEMEM_TWOBANKS is not set
|
|
||||||
# CONFIG_ESP32_TRAX is not set
|
|
||||||
CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0
|
|
||||||
# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set
|
|
||||||
CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y
|
|
||||||
CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4
|
|
||||||
# CONFIG_ESP32_ULP_COPROC_ENABLED is not set
|
|
||||||
CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
|
|
||||||
# CONFIG_ESP32_PANIC_PRINT_HALT is not set
|
|
||||||
CONFIG_ESP32_PANIC_PRINT_REBOOT=y
|
|
||||||
# CONFIG_ESP32_PANIC_SILENT_REBOOT is not set
|
|
||||||
# CONFIG_ESP32_PANIC_GDBSTUB is not set
|
|
||||||
CONFIG_ESP32_DEBUG_OCDAWARE=y
|
|
||||||
# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set
|
|
||||||
CONFIG_ESP32_BROWNOUT_DET=y
|
|
||||||
CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y
|
|
||||||
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set
|
|
||||||
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set
|
|
||||||
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set
|
|
||||||
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set
|
|
||||||
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set
|
|
||||||
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set
|
|
||||||
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set
|
|
||||||
CONFIG_ESP32_BROWNOUT_DET_LVL=0
|
|
||||||
CONFIG_ESP32_REDUCE_PHY_TX_POWER=y
|
|
||||||
CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y
|
|
||||||
# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set
|
|
||||||
# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set
|
|
||||||
# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set
|
|
||||||
CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
|
|
||||||
# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set
|
|
||||||
# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set
|
|
||||||
# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set
|
|
||||||
CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024
|
|
||||||
CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000
|
|
||||||
CONFIG_ESP32_XTAL_FREQ_40=y
|
|
||||||
# CONFIG_ESP32_XTAL_FREQ_26 is not set
|
|
||||||
# CONFIG_ESP32_XTAL_FREQ_AUTO is not set
|
|
||||||
CONFIG_ESP32_XTAL_FREQ=40
|
|
||||||
# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set
|
|
||||||
# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set
|
|
||||||
# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set
|
|
||||||
CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5
|
|
||||||
# CONFIG_PM_ENABLE is not set
|
|
||||||
CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y
|
|
||||||
CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y
|
|
||||||
CONFIG_ADC_CAL_LUT_ENABLE=y
|
|
||||||
# CONFIG_ESP_TIMER_PROFILING is not set
|
|
||||||
CONFIG_ESP_ERR_TO_NAME_LOOKUP=y
|
|
||||||
CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32
|
|
||||||
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304
|
|
||||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
|
|
||||||
CONFIG_ESP_IPC_TASK_STACK_SIZE=1024
|
|
||||||
CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584
|
|
||||||
CONFIG_ESP_CONSOLE_UART_DEFAULT=y
|
|
||||||
# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set
|
|
||||||
# CONFIG_ESP_CONSOLE_UART_NONE is not set
|
|
||||||
CONFIG_ESP_CONSOLE_UART_NUM=0
|
|
||||||
CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
|
|
||||||
CONFIG_ESP_INT_WDT=y
|
|
||||||
CONFIG_ESP_INT_WDT_TIMEOUT_MS=800
|
|
||||||
CONFIG_ESP_INT_WDT_CHECK_CPU1=y
|
|
||||||
CONFIG_ESP_TASK_WDT=y
|
|
||||||
# CONFIG_ESP_TASK_WDT_PANIC is not set
|
|
||||||
CONFIG_ESP_TASK_WDT_TIMEOUT_S=5
|
|
||||||
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
|
|
||||||
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
|
|
||||||
CONFIG_ETH_USE_ESP32_EMAC=y
|
|
||||||
CONFIG_ETH_PHY_INTERFACE_RMII=y
|
|
||||||
# CONFIG_ETH_PHY_INTERFACE_MII is not set
|
|
||||||
CONFIG_ETH_RMII_CLK_INPUT=y
|
|
||||||
# CONFIG_ETH_RMII_CLK_OUTPUT is not set
|
|
||||||
CONFIG_ETH_RMII_CLK_IN_GPIO=0
|
|
||||||
CONFIG_ETH_DMA_BUFFER_SIZE=512
|
|
||||||
CONFIG_ETH_DMA_RX_BUFFER_NUM=10
|
|
||||||
CONFIG_ETH_DMA_TX_BUFFER_NUM=10
|
|
||||||
# CONFIG_ETH_USE_SPI_ETHERNET is not set
|
|
||||||
# CONFIG_ESP_EVENT_LOOP_PROFILING is not set
|
|
||||||
CONFIG_ESP_EVENT_POST_FROM_ISR=y
|
|
||||||
CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y
|
|
||||||
CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y
|
|
||||||
# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set
|
|
||||||
CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024
|
|
||||||
CONFIG_HTTPD_MAX_URI_LEN=512
|
|
||||||
CONFIG_HTTPD_ERR_RESP_NO_DELAY=y
|
|
||||||
CONFIG_HTTPD_PURGE_BUF_LEN=32
|
|
||||||
# CONFIG_HTTPD_LOG_PURGE_DATA is not set
|
|
||||||
CONFIG_OTA_ALLOW_HTTP=y
|
|
||||||
# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set
|
|
||||||
CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y
|
|
||||||
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=12
|
|
||||||
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=40
|
|
||||||
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y
|
|
||||||
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0
|
|
||||||
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=12
|
|
||||||
# CONFIG_ESP32_WIFI_CSI_ENABLED is not set
|
|
||||||
# CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED is not set
|
|
||||||
# CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED is not set
|
|
||||||
CONFIG_ESP32_WIFI_RX_BA_WIN=16
|
|
||||||
CONFIG_ESP32_WIFI_NVS_ENABLED=y
|
|
||||||
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
|
|
||||||
# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set
|
|
||||||
CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752
|
|
||||||
CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32
|
|
||||||
# CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE is not set
|
|
||||||
# CONFIG_ESP32_WIFI_IRAM_OPT is not set
|
|
||||||
# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set
|
|
||||||
CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y
|
|
||||||
#CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION=y
|
|
||||||
CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20
|
|
||||||
CONFIG_ESP32_PHY_MAX_TX_POWER=20
|
|
||||||
# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set
|
|
||||||
# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set
|
|
||||||
CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y
|
|
||||||
# CONFIG_ESP32_ENABLE_COREDUMP is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set
|
|
||||||
CONFIG_FATFS_CODEPAGE_437=y
|
|
||||||
# CONFIG_FATFS_CODEPAGE_720 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_737 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_771 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_775 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_850 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_852 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_855 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_857 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_860 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_861 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_862 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_863 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_864 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_865 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_866 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_869 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_932 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_936 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_949 is not set
|
|
||||||
# CONFIG_FATFS_CODEPAGE_950 is not set
|
|
||||||
CONFIG_FATFS_CODEPAGE=437
|
|
||||||
CONFIG_FATFS_LFN_NONE=y
|
|
||||||
# CONFIG_FATFS_LFN_HEAP is not set
|
|
||||||
# CONFIG_FATFS_LFN_STACK is not set
|
|
||||||
CONFIG_FATFS_FS_LOCK=0
|
|
||||||
CONFIG_FATFS_TIMEOUT_MS=10000
|
|
||||||
CONFIG_FATFS_PER_FILE_CACHE=y
|
|
||||||
CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y
|
|
||||||
CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150
|
|
||||||
CONFIG_FMB_MASTER_DELAY_MS_CONVERT=200
|
|
||||||
CONFIG_FMB_QUEUE_LENGTH=20
|
|
||||||
CONFIG_FMB_SERIAL_TASK_STACK_SIZE=2048
|
|
||||||
CONFIG_FMB_SERIAL_BUF_SIZE=256
|
|
||||||
CONFIG_FMB_SERIAL_TASK_PRIO=10
|
|
||||||
# CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT is not set
|
|
||||||
CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20
|
|
||||||
CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE=20
|
|
||||||
CONFIG_FMB_CONTROLLER_STACK_SIZE=4096
|
|
||||||
CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20
|
|
||||||
CONFIG_FMB_TIMER_PORT_ENABLED=y
|
|
||||||
CONFIG_FMB_TIMER_GROUP=0
|
|
||||||
CONFIG_FMB_TIMER_INDEX=0
|
|
||||||
# CONFIG_FREERTOS_UNICORE is not set
|
|
||||||
CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF
|
|
||||||
CONFIG_FREERTOS_CORETIMER_0=y
|
|
||||||
# CONFIG_FREERTOS_CORETIMER_1 is not set
|
|
||||||
CONFIG_FREERTOS_HZ=100
|
|
||||||
CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y
|
|
||||||
# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set
|
|
||||||
# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set
|
|
||||||
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y
|
|
||||||
# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set
|
|
||||||
CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y
|
|
||||||
CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1
|
|
||||||
CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y
|
|
||||||
# CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set
|
|
||||||
# CONFIG_FREERTOS_ASSERT_DISABLE is not set
|
|
||||||
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536
|
|
||||||
CONFIG_FREERTOS_ISR_STACKSIZE=1536
|
|
||||||
# CONFIG_FREERTOS_LEGACY_HOOKS is not set
|
|
||||||
CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16
|
|
||||||
CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
|
|
||||||
# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set
|
|
||||||
CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1
|
|
||||||
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2432
|
|
||||||
CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10
|
|
||||||
CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0
|
|
||||||
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
|
|
||||||
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
|
|
||||||
CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID=y
|
|
||||||
CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y
|
|
||||||
CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER=y
|
|
||||||
# CONFIG_FREERTOS_RUN_TIME_STATS_USING_CPU_CLK is not set
|
|
||||||
# CONFIG_FREERTOS_DEBUG_INTERNALS is not set
|
|
||||||
CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y
|
|
||||||
# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set
|
|
||||||
CONFIG_HEAP_POISONING_DISABLED=y
|
|
||||||
# CONFIG_HEAP_POISONING_LIGHT is not set
|
|
||||||
# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set
|
|
||||||
CONFIG_HEAP_TRACING_OFF=y
|
|
||||||
# CONFIG_HEAP_TRACING_STANDALONE is not set
|
|
||||||
# CONFIG_HEAP_TRACING_TOHOST is not set
|
|
||||||
# CONFIG_HEAP_TRACING is not set
|
|
||||||
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
|
|
||||||
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
|
|
||||||
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
|
||||||
# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set
|
|
||||||
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
|
|
||||||
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
|
|
||||||
CONFIG_LOG_DEFAULT_LEVEL=3
|
|
||||||
CONFIG_LOG_COLORS=y
|
|
||||||
CONFIG_LWIP_LOCAL_HOSTNAME="squeezelite-esp32"
|
|
||||||
# CONFIG_LWIP_L2_TO_L3_COPY is not set
|
|
||||||
# CONFIG_LWIP_IRAM_OPTIMIZATION is not set
|
|
||||||
CONFIG_LWIP_TIMERS_ONDEMAND=y
|
|
||||||
CONFIG_LWIP_MAX_SOCKETS=16
|
|
||||||
# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set
|
|
||||||
CONFIG_LWIP_SO_REUSE=y
|
|
||||||
CONFIG_LWIP_SO_REUSE_RXTOALL=y
|
|
||||||
# CONFIG_LWIP_SO_RCVBUF is not set
|
|
||||||
CONFIG_LWIP_IP_FRAG=y
|
|
||||||
# CONFIG_LWIP_IP_REASSEMBLY is not set
|
|
||||||
# CONFIG_LWIP_STATS is not set
|
|
||||||
# CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set
|
|
||||||
CONFIG_LWIP_ESP_GRATUITOUS_ARP=y
|
|
||||||
CONFIG_LWIP_GARP_TMR_INTERVAL=60
|
|
||||||
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32
|
|
||||||
CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y
|
|
||||||
CONFIG_LWIP_DHCP_RESTORE_LAST_IP=y
|
|
||||||
CONFIG_LWIP_DHCPS_LEASE_UNIT=60
|
|
||||||
CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8
|
|
||||||
# CONFIG_LWIP_AUTOIP is not set
|
|
||||||
# CONFIG_LWIP_IPV6_AUTOCONFIG is not set
|
|
||||||
CONFIG_LWIP_NETIF_LOOPBACK=y
|
|
||||||
CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8
|
|
||||||
CONFIG_LWIP_MAX_ACTIVE_TCP=16
|
|
||||||
CONFIG_LWIP_MAX_LISTENING_TCP=16
|
|
||||||
CONFIG_LWIP_TCP_MAXRTX=12
|
|
||||||
CONFIG_LWIP_TCP_SYNMAXRTX=6
|
|
||||||
CONFIG_LWIP_TCP_MSS=1440
|
|
||||||
CONFIG_LWIP_TCP_MSL=60000
|
|
||||||
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=8192
|
|
||||||
CONFIG_LWIP_TCP_WND_DEFAULT=32768
|
|
||||||
CONFIG_LWIP_TCP_RECVMBOX_SIZE=32
|
|
||||||
CONFIG_LWIP_TCP_QUEUE_OOSEQ=y
|
|
||||||
# CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set
|
|
||||||
CONFIG_LWIP_TCP_OVERSIZE_MSS=y
|
|
||||||
# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set
|
|
||||||
# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set
|
|
||||||
# CONFIG_LWIP_WND_SCALE is not set
|
|
||||||
CONFIG_LWIP_MAX_UDP_PCBS=16
|
|
||||||
CONFIG_LWIP_UDP_RECVMBOX_SIZE=32
|
|
||||||
CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072
|
|
||||||
CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
|
|
||||||
# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set
|
|
||||||
# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set
|
|
||||||
CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF
|
|
||||||
# CONFIG_LWIP_PPP_SUPPORT is not set
|
|
||||||
# CONFIG_LWIP_MULTICAST_PING is not set
|
|
||||||
# CONFIG_LWIP_BROADCAST_PING is not set
|
|
||||||
CONFIG_LWIP_MAX_RAW_PCBS=16
|
|
||||||
CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1
|
|
||||||
CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000
|
|
||||||
# CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC is not set
|
|
||||||
CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
|
|
||||||
# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set
|
|
||||||
# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set
|
|
||||||
CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y
|
|
||||||
CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384
|
|
||||||
CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096
|
|
||||||
# CONFIG_MBEDTLS_DEBUG is not set
|
|
||||||
# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set
|
|
||||||
# CONFIG_MBEDTLS_CMAC_C is not set
|
|
||||||
CONFIG_MBEDTLS_HARDWARE_AES=y
|
|
||||||
# CONFIG_MBEDTLS_HARDWARE_MPI is not set
|
|
||||||
CONFIG_MBEDTLS_HARDWARE_SHA=y
|
|
||||||
CONFIG_MBEDTLS_HAVE_TIME=y
|
|
||||||
# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set
|
|
||||||
# CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT is not set
|
|
||||||
# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set
|
|
||||||
CONFIG_MBEDTLS_TLS_CLIENT_ONLY=y
|
|
||||||
# CONFIG_MBEDTLS_TLS_DISABLED is not set
|
|
||||||
CONFIG_MBEDTLS_TLS_CLIENT=y
|
|
||||||
CONFIG_MBEDTLS_TLS_ENABLED=y
|
|
||||||
# CONFIG_MBEDTLS_PSK_MODES is not set
|
|
||||||
CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y
|
|
||||||
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y
|
|
||||||
CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y
|
|
||||||
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y
|
|
||||||
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y
|
|
||||||
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y
|
|
||||||
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y
|
|
||||||
CONFIG_MBEDTLS_SSL_RENEGOTIATION=y
|
|
||||||
# CONFIG_MBEDTLS_SSL_PROTO_SSL3 is not set
|
|
||||||
CONFIG_MBEDTLS_SSL_PROTO_TLS1=y
|
|
||||||
CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y
|
|
||||||
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
|
|
||||||
# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set
|
|
||||||
CONFIG_MBEDTLS_SSL_ALPN=y
|
|
||||||
CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y
|
|
||||||
CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y
|
|
||||||
CONFIG_MBEDTLS_AES_C=y
|
|
||||||
# CONFIG_MBEDTLS_CAMELLIA_C is not set
|
|
||||||
# CONFIG_MBEDTLS_DES_C is not set
|
|
||||||
CONFIG_MBEDTLS_RC4_DISABLED=y
|
|
||||||
# CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT is not set
|
|
||||||
# CONFIG_MBEDTLS_RC4_ENABLED is not set
|
|
||||||
# CONFIG_MBEDTLS_BLOWFISH_C is not set
|
|
||||||
# CONFIG_MBEDTLS_XTEA_C is not set
|
|
||||||
CONFIG_MBEDTLS_CCM_C=y
|
|
||||||
CONFIG_MBEDTLS_GCM_C=y
|
|
||||||
# CONFIG_MBEDTLS_RIPEMD160_C is not set
|
|
||||||
CONFIG_MBEDTLS_PEM_PARSE_C=y
|
|
||||||
CONFIG_MBEDTLS_PEM_WRITE_C=y
|
|
||||||
CONFIG_MBEDTLS_X509_CRL_PARSE_C=y
|
|
||||||
CONFIG_MBEDTLS_X509_CSR_PARSE_C=y
|
|
||||||
CONFIG_MBEDTLS_ECP_C=y
|
|
||||||
CONFIG_MBEDTLS_ECDH_C=y
|
|
||||||
CONFIG_MBEDTLS_ECDSA_C=y
|
|
||||||
CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y
|
|
||||||
CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y
|
|
||||||
CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y
|
|
||||||
CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y
|
|
||||||
CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y
|
|
||||||
CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y
|
|
||||||
CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y
|
|
||||||
CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y
|
|
||||||
CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y
|
|
||||||
CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y
|
|
||||||
CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y
|
|
||||||
CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y
|
|
||||||
CONFIG_MBEDTLS_ECP_NIST_OPTIM=y
|
|
||||||
CONFIG_MDNS_MAX_SERVICES=10
|
|
||||||
CONFIG_MQTT_PROTOCOL_311=y
|
|
||||||
CONFIG_MQTT_TRANSPORT_SSL=y
|
|
||||||
CONFIG_MQTT_TRANSPORT_WEBSOCKET=y
|
|
||||||
CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y
|
|
||||||
# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set
|
|
||||||
# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set
|
|
||||||
# CONFIG_MQTT_CUSTOM_OUTBOX is not set
|
|
||||||
CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y
|
|
||||||
# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set
|
|
||||||
# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set
|
|
||||||
# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set
|
|
||||||
# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set
|
|
||||||
CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
|
|
||||||
# CONFIG_NEWLIB_NANO_FORMAT is not set
|
|
||||||
# CONFIG_OPENSSL_DEBUG is not set
|
|
||||||
CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
|
|
||||||
# CONFIG_OPENSSL_ASSERT_EXIT is not set
|
|
||||||
CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5
|
|
||||||
CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
|
|
||||||
CONFIG_PTHREAD_STACK_MIN=768
|
|
||||||
# CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY is not set
|
|
||||||
# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set
|
|
||||||
CONFIG_PTHREAD_DEFAULT_CORE_1=y
|
|
||||||
CONFIG_PTHREAD_TASK_CORE_DEFAULT=1
|
|
||||||
CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
|
|
||||||
# CONFIG_SPI_FLASH_VERIFY_WRITE is not set
|
|
||||||
# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set
|
|
||||||
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
|
|
||||||
CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y
|
|
||||||
# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set
|
|
||||||
# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set
|
|
||||||
# CONFIG_SPI_FLASH_USE_LEGACY_IMPL is not set
|
|
||||||
CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y
|
|
||||||
CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y
|
|
||||||
CONFIG_SPIFFS_MAX_PARTITIONS=3
|
|
||||||
CONFIG_SPIFFS_CACHE=y
|
|
||||||
CONFIG_SPIFFS_CACHE_WR=y
|
|
||||||
# CONFIG_SPIFFS_CACHE_STATS is not set
|
|
||||||
CONFIG_SPIFFS_PAGE_CHECK=y
|
|
||||||
CONFIG_SPIFFS_GC_MAX_RUNS=10
|
|
||||||
# CONFIG_SPIFFS_GC_STATS is not set
|
|
||||||
CONFIG_SPIFFS_PAGE_SIZE=256
|
|
||||||
CONFIG_SPIFFS_OBJ_NAME_LEN=32
|
|
||||||
CONFIG_SPIFFS_USE_MAGIC=y
|
|
||||||
CONFIG_SPIFFS_USE_MAGIC_LENGTH=y
|
|
||||||
CONFIG_SPIFFS_META_LENGTH=4
|
|
||||||
CONFIG_SPIFFS_USE_MTIME=y
|
|
||||||
# CONFIG_SPIFFS_DBG is not set
|
|
||||||
# CONFIG_SPIFFS_API_DBG is not set
|
|
||||||
# CONFIG_SPIFFS_GC_DBG is not set
|
|
||||||
# CONFIG_SPIFFS_CACHE_DBG is not set
|
|
||||||
# CONFIG_SPIFFS_CHECK_DBG is not set
|
|
||||||
# CONFIG_SPIFFS_TEST_VISUALISATION is not set
|
|
||||||
CONFIG_NETIF_IP_LOST_TIMER_INTERVAL=120
|
|
||||||
CONFIG_TCPIP_LWIP=y
|
|
||||||
CONFIG_UNITY_ENABLE_FLOAT=y
|
|
||||||
CONFIG_UNITY_ENABLE_DOUBLE=y
|
|
||||||
# CONFIG_UNITY_ENABLE_COLOR is not set
|
|
||||||
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
|
|
||||||
# CONFIG_UNITY_ENABLE_FIXTURE is not set
|
|
||||||
# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set
|
|
||||||
CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y
|
|
||||||
CONFIG_VFS_SUPPORT_TERMIOS=y
|
|
||||||
CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1
|
|
||||||
CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
# CONFIG_WL_SECTOR_SIZE_4096 is not set
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
# CONFIG_WL_SECTOR_MODE_PERF is not set
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16
|
|
||||||
CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30
|
|
||||||
CONFIG_WPA_MBEDTLS_CRYPTO=y
|
|
||||||
# CONFIG_DSP_ANSI is not set
|
|
||||||
CONFIG_DSP_OPTIMIZED=y
|
|
||||||
CONFIG_DSP_OPTIMIZATION=1
|
|
||||||
CONFIG_DSP_MAX_FFT_SIZE_512=y
|
|
||||||
# CONFIG_DSP_MAX_FFT_SIZE_1024 is not set
|
|
||||||
# CONFIG_DSP_MAX_FFT_SIZE_2048 is not set
|
|
||||||
# CONFIG_DSP_MAX_FFT_SIZE_4096 is not set
|
|
||||||
# CONFIG_DSP_MAX_FFT_SIZE_8192 is not set
|
|
||||||
# CONFIG_DSP_MAX_FFT_SIZE_16384 is not set
|
|
||||||
# CONFIG_DSP_MAX_FFT_SIZE_32768 is not set
|
|
||||||
CONFIG_DSP_MAX_FFT_SIZE=512
|
|
||||||
# CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set
|
|
||||||
|
|
||||||
# Deprecated options for backward compatibility
|
|
||||||
CONFIG_TOOLPREFIX="xtensa-esp32-elf-"
|
|
||||||
# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set
|
|
||||||
# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set
|
|
||||||
# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set
|
|
||||||
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y
|
|
||||||
# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set
|
|
||||||
# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set
|
|
||||||
CONFIG_LOG_BOOTLOADER_LEVEL=3
|
|
||||||
# CONFIG_APP_ROLLBACK_ENABLE is not set
|
|
||||||
# CONFIG_FLASH_ENCRYPTION_ENABLED is not set
|
|
||||||
CONFIG_FLASHMODE_QIO=y
|
|
||||||
# CONFIG_FLASHMODE_QOUT is not set
|
|
||||||
# CONFIG_FLASHMODE_DIO is not set
|
|
||||||
# CONFIG_FLASHMODE_DOUT is not set
|
|
||||||
# CONFIG_MONITOR_BAUD_9600B is not set
|
|
||||||
# CONFIG_MONITOR_BAUD_57600B is not set
|
|
||||||
CONFIG_MONITOR_BAUD_115200B=y
|
|
||||||
# CONFIG_MONITOR_BAUD_230400B is not set
|
|
||||||
# CONFIG_MONITOR_BAUD_921600B is not set
|
|
||||||
# CONFIG_MONITOR_BAUD_2MB is not set
|
|
||||||
# CONFIG_MONITOR_BAUD_OTHER is not set
|
|
||||||
CONFIG_MONITOR_BAUD_OTHER_VAL=115200
|
|
||||||
CONFIG_MONITOR_BAUD=115200
|
|
||||||
# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set
|
|
||||||
CONFIG_OPTIMIZATION_LEVEL_RELEASE=y
|
|
||||||
# CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED is not set
|
|
||||||
CONFIG_OPTIMIZATION_ASSERTIONS_SILENT=y
|
|
||||||
# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set
|
|
||||||
# CONFIG_CXX_EXCEPTIONS is not set
|
|
||||||
CONFIG_STACK_CHECK_NONE=y
|
|
||||||
# CONFIG_STACK_CHECK_NORM is not set
|
|
||||||
# CONFIG_STACK_CHECK_STRONG is not set
|
|
||||||
# CONFIG_STACK_CHECK_ALL is not set
|
|
||||||
# CONFIG_STACK_CHECK is not set
|
|
||||||
# CONFIG_WARN_WRITE_STRINGS is not set
|
|
||||||
# CONFIG_DISABLE_GCC8_WARNINGS is not set
|
|
||||||
# CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY is not set
|
|
||||||
CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y
|
|
||||||
# CONFIG_BTDM_CONTROLLER_MODE_BTDM is not set
|
|
||||||
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN=2
|
|
||||||
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN=0
|
|
||||||
CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=0
|
|
||||||
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=2
|
|
||||||
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0
|
|
||||||
CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0
|
|
||||||
CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y
|
|
||||||
# CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4 is not set
|
|
||||||
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=y
|
|
||||||
CONFIG_BLUEDROID_ENABLED=y
|
|
||||||
CONFIG_BTC_TASK_STACK_SIZE=3072
|
|
||||||
CONFIG_BLUEDROID_PINNED_TO_CORE_0=y
|
|
||||||
# CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set
|
|
||||||
CONFIG_BLUEDROID_PINNED_TO_CORE=0
|
|
||||||
CONFIG_BTU_TASK_STACK_SIZE=4096
|
|
||||||
# CONFIG_BLUEDROID_MEM_DEBUG is not set
|
|
||||||
CONFIG_CLASSIC_BT_ENABLED=y
|
|
||||||
CONFIG_A2DP_ENABLE=y
|
|
||||||
# CONFIG_HFP_ENABLE is not set
|
|
||||||
CONFIG_GATTS_ENABLE=y
|
|
||||||
# CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set
|
|
||||||
CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y
|
|
||||||
CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE=0
|
|
||||||
CONFIG_GATTC_ENABLE=y
|
|
||||||
# CONFIG_GATTC_CACHE_NVS_FLASH is not set
|
|
||||||
CONFIG_BLE_SMP_ENABLE=y
|
|
||||||
# CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set
|
|
||||||
# CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK is not set
|
|
||||||
CONFIG_SMP_ENABLE=y
|
|
||||||
CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30
|
|
||||||
CONFIG_ADC2_DISABLE_DAC=y
|
|
||||||
CONFIG_SPIRAM_SUPPORT=y
|
|
||||||
CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST=y
|
|
||||||
# CONFIG_MEMMAP_TRACEMEM is not set
|
|
||||||
# CONFIG_MEMMAP_TRACEMEM_TWOBANKS is not set
|
|
||||||
CONFIG_TRACEMEM_RESERVE_DRAM=0x0
|
|
||||||
# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set
|
|
||||||
CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y
|
|
||||||
CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4
|
|
||||||
# CONFIG_ULP_COPROC_ENABLED is not set
|
|
||||||
CONFIG_ULP_COPROC_RESERVE_MEM=0
|
|
||||||
CONFIG_BROWNOUT_DET=y
|
|
||||||
CONFIG_BROWNOUT_DET_LVL_SEL_0=y
|
|
||||||
# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set
|
|
||||||
# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set
|
|
||||||
# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set
|
|
||||||
# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set
|
|
||||||
# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set
|
|
||||||
# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set
|
|
||||||
# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set
|
|
||||||
CONFIG_BROWNOUT_DET_LVL=0
|
|
||||||
CONFIG_REDUCE_PHY_TX_POWER=y
|
|
||||||
CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y
|
|
||||||
# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set
|
|
||||||
# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set
|
|
||||||
# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set
|
|
||||||
# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set
|
|
||||||
# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set
|
|
||||||
CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32
|
|
||||||
CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304
|
|
||||||
CONFIG_MAIN_TASK_STACK_SIZE=8192
|
|
||||||
CONFIG_IPC_TASK_STACK_SIZE=1024
|
|
||||||
CONFIG_TIMER_TASK_STACK_SIZE=3584
|
|
||||||
CONFIG_CONSOLE_UART_DEFAULT=y
|
|
||||||
# CONFIG_CONSOLE_UART_CUSTOM is not set
|
|
||||||
# CONFIG_CONSOLE_UART_NONE is not set
|
|
||||||
CONFIG_CONSOLE_UART_NUM=0
|
|
||||||
CONFIG_CONSOLE_UART_BAUDRATE=115200
|
|
||||||
CONFIG_INT_WDT=y
|
|
||||||
CONFIG_INT_WDT_TIMEOUT_MS=800
|
|
||||||
CONFIG_INT_WDT_CHECK_CPU1=y
|
|
||||||
CONFIG_TASK_WDT=y
|
|
||||||
# CONFIG_TASK_WDT_PANIC is not set
|
|
||||||
CONFIG_TASK_WDT_TIMEOUT_S=5
|
|
||||||
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
|
|
||||||
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
|
|
||||||
# CONFIG_EVENT_LOOP_PROFILING is not set
|
|
||||||
CONFIG_POST_EVENTS_FROM_ISR=y
|
|
||||||
CONFIG_POST_EVENTS_FROM_IRAM_ISR=y
|
|
||||||
CONFIG_SW_COEXIST_ENABLE=y
|
|
||||||
CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150
|
|
||||||
CONFIG_MB_MASTER_DELAY_MS_CONVERT=200
|
|
||||||
CONFIG_MB_QUEUE_LENGTH=20
|
|
||||||
CONFIG_MB_SERIAL_TASK_STACK_SIZE=2048
|
|
||||||
CONFIG_MB_SERIAL_BUF_SIZE=256
|
|
||||||
CONFIG_MB_SERIAL_TASK_PRIO=10
|
|
||||||
# CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT is not set
|
|
||||||
CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20
|
|
||||||
CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20
|
|
||||||
CONFIG_MB_CONTROLLER_STACK_SIZE=4096
|
|
||||||
CONFIG_MB_EVENT_QUEUE_TIMEOUT=20
|
|
||||||
CONFIG_MB_TIMER_PORT_ENABLED=y
|
|
||||||
CONFIG_MB_TIMER_GROUP=0
|
|
||||||
CONFIG_MB_TIMER_INDEX=0
|
|
||||||
CONFIG_SUPPORT_STATIC_ALLOCATION=y
|
|
||||||
# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set
|
|
||||||
CONFIG_TIMER_TASK_PRIORITY=1
|
|
||||||
CONFIG_TIMER_TASK_STACK_DEPTH=2432
|
|
||||||
CONFIG_TIMER_QUEUE_LENGTH=10
|
|
||||||
# CONFIG_L2_TO_L3_COPY is not set
|
|
||||||
# CONFIG_USE_ONLY_LWIP_SELECT is not set
|
|
||||||
CONFIG_ESP_GRATUITOUS_ARP=y
|
|
||||||
CONFIG_GARP_TMR_INTERVAL=60
|
|
||||||
CONFIG_TCPIP_RECVMBOX_SIZE=32
|
|
||||||
CONFIG_TCP_MAXRTX=12
|
|
||||||
CONFIG_TCP_SYNMAXRTX=6
|
|
||||||
CONFIG_TCP_MSS=1440
|
|
||||||
CONFIG_TCP_MSL=60000
|
|
||||||
CONFIG_TCP_SND_BUF_DEFAULT=8192
|
|
||||||
CONFIG_TCP_WND_DEFAULT=32768
|
|
||||||
CONFIG_TCP_RECVMBOX_SIZE=32
|
|
||||||
CONFIG_TCP_QUEUE_OOSEQ=y
|
|
||||||
# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set
|
|
||||||
CONFIG_TCP_OVERSIZE_MSS=y
|
|
||||||
# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set
|
|
||||||
# CONFIG_TCP_OVERSIZE_DISABLE is not set
|
|
||||||
CONFIG_UDP_RECVMBOX_SIZE=32
|
|
||||||
CONFIG_TCPIP_TASK_STACK_SIZE=3072
|
|
||||||
CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
|
|
||||||
# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set
|
|
||||||
# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set
|
|
||||||
CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF
|
|
||||||
# CONFIG_PPP_SUPPORT is not set
|
|
||||||
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
|
|
||||||
CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
|
|
||||||
CONFIG_ESP32_PTHREAD_STACK_MIN=768
|
|
||||||
# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY is not set
|
|
||||||
# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set
|
|
||||||
CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1=y
|
|
||||||
CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=1
|
|
||||||
CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
|
|
||||||
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y
|
|
||||||
# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set
|
|
||||||
# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set
|
|
||||||
CONFIG_IP_LOST_TIMER_INTERVAL=120
|
|
||||||
CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y
|
|
||||||
CONFIG_SUPPORT_TERMIOS=y
|
|
||||||
# End of deprecated options
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
idf_component_register(SRC_DIRS . core core/ifaces fonts
|
idf_component_register(SRC_DIRS . core core/ifaces fonts
|
||||||
INCLUDE_DIRS . fonts core
|
INCLUDE_DIRS . fonts core
|
||||||
REQUIRES platform_config tools esp_common
|
REQUIRES platform_config tools esp_common
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ static const char *known_drivers[] = {"SH1106",
|
|||||||
"SSD1327",
|
"SSD1327",
|
||||||
"SSD1675",
|
"SSD1675",
|
||||||
"SSD1351",
|
"SSD1351",
|
||||||
"ST77xx",
|
"ST7735",
|
||||||
|
"ST7789",
|
||||||
"ILI9341",
|
"ILI9341",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
@@ -381,14 +382,14 @@ void displayer_control(enum displayer_cmd_e cmd, ...) {
|
|||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool display_is_valid_driver(char * driver){
|
bool display_is_valid_driver(const char * driver){
|
||||||
return display_conf_get_driver_name(driver)!=NULL;
|
return display_conf_get_driver_name(driver)!=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const char *display_conf_get_driver_name(char * driver){
|
const char *display_conf_get_driver_name(const char * driver){
|
||||||
for(uint8_t i=0;known_drivers[i]!=NULL && strlen(known_drivers[i])>0;i++ ){
|
for(uint8_t i=0;known_drivers[i]!=NULL && strlen(known_drivers[i])>0;i++ ){
|
||||||
if(strcasestr(driver,known_drivers[i])){
|
if(strcasestr(driver,known_drivers[i])){
|
||||||
return known_drivers[i];
|
return known_drivers[i];
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ enum displayer_time_e { DISPLAYER_ELAPSED, DISPLAYER_REMAINING };
|
|||||||
|
|
||||||
enum display_bus_cmd_e { DISPLAY_BUS_TAKE, DISPLAY_BUS_GIVE };
|
enum display_bus_cmd_e { DISPLAY_BUS_TAKE, DISPLAY_BUS_GIVE };
|
||||||
bool (*display_bus)(void *from, enum display_bus_cmd_e cmd);
|
bool (*display_bus)(void *from, enum display_bus_cmd_e cmd);
|
||||||
const char *display_conf_get_driver_name(char * driver);
|
const char *display_conf_get_driver_name(const char * driver);
|
||||||
bool display_is_valid_driver(char * driver);
|
bool display_is_valid_driver(const char * driver);
|
||||||
|
|
||||||
void displayer_scroll(char *string, int speed, int pause);
|
void displayer_scroll(char *string, int speed, int pause);
|
||||||
void displayer_control(enum displayer_cmd_e cmd, ...);
|
void displayer_control(enum displayer_cmd_e cmd, ...);
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ idf_component_register( SRCS
|
|||||||
cmd_system.c
|
cmd_system.c
|
||||||
cmd_wifi.c
|
cmd_wifi.c
|
||||||
platform_console.c
|
platform_console.c
|
||||||
|
cmd_config.c
|
||||||
INCLUDE_DIRS .
|
INCLUDE_DIRS .
|
||||||
REQUIRES nvs_flash
|
REQUIRES nvs_flash
|
||||||
PRIV_REQUIRES console app_update tools services spi_flash platform_config vfs pthread wifi-manager platform_config newlib telnet display )
|
PRIV_REQUIRES console app_update tools services spi_flash platform_config vfs pthread wifi-manager platform_config newlib telnet display squeezelite)
|
||||||
target_link_libraries(${COMPONENT_LIB} "-Wl,--undefined=GDS_DrawPixelFast")
|
target_link_libraries(${COMPONENT_LIB} "-Wl,--undefined=GDS_DrawPixelFast")
|
||||||
target_link_libraries(${COMPONENT_LIB} ${build_dir}/esp-idf/$<TARGET_PROPERTY:RECOVERY_PREFIX>/lib$<TARGET_PROPERTY:RECOVERY_PREFIX>.a )
|
target_link_libraries(${COMPONENT_LIB} ${build_dir}/esp-idf/$<TARGET_PROPERTY:RECOVERY_PREFIX>/lib$<TARGET_PROPERTY:RECOVERY_PREFIX>.a )
|
||||||
|
|||||||
622
components/platform_console/cmd_config.c
Normal file
622
components/platform_console/cmd_config.c
Normal file
@@ -0,0 +1,622 @@
|
|||||||
|
/* cmd_i2ctools.c
|
||||||
|
|
||||||
|
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, this
|
||||||
|
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||||
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
*/
|
||||||
|
//#define LOG_LOCAL_LEVEL ESP_LOG_DEBUG
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "cmd_config.h"
|
||||||
|
#include "argtable3/argtable3.h"
|
||||||
|
#include "platform_console.h"
|
||||||
|
#include "esp_log.h"
|
||||||
|
#include "string.h"
|
||||||
|
#include "stdio.h"
|
||||||
|
#include "platform_config.h"
|
||||||
|
#include "trace.h"
|
||||||
|
#include "messaging.h"
|
||||||
|
#include "accessors.h"
|
||||||
|
|
||||||
|
const char * desc_squeezelite ="Squeezelite Options";
|
||||||
|
const char * desc_dac= "DAC Options";
|
||||||
|
const char * desc_spdif= "SPDIF Options";
|
||||||
|
const char * desc_audio= "General Audio Options";
|
||||||
|
|
||||||
|
|
||||||
|
#define CODECS_BASE "flac|pcm|mp3|ogg"
|
||||||
|
#if NO_FAAD
|
||||||
|
#define CODECS_AAC ""
|
||||||
|
#else
|
||||||
|
#define CODECS_AAC "|aac"
|
||||||
|
#endif
|
||||||
|
#if FFMPEG
|
||||||
|
#define CODECS_FF "|wma|alac"
|
||||||
|
#else
|
||||||
|
#define CODECS_FF ""
|
||||||
|
#endif
|
||||||
|
#if DSD
|
||||||
|
#define CODECS_DSD "|dsd"
|
||||||
|
#else
|
||||||
|
#define CODECS_DSD ""
|
||||||
|
#endif
|
||||||
|
#define CODECS_MP3 "|mad|mpg"
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(MODEL_NAME)
|
||||||
|
#define MODEL_NAME SqueezeLite
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef QUOTE
|
||||||
|
#define QUOTE(name) #name
|
||||||
|
#define STR(macro) QUOTE(macro)
|
||||||
|
#endif
|
||||||
|
#ifndef MODEL_NAME_STRING
|
||||||
|
#define MODEL_NAME_STRING STR(MODEL_NAME)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CODECS CODECS_BASE CODECS_AAC CODECS_FF CODECS_DSD CODECS_MP3
|
||||||
|
#define NOT_OUTPUT "has input capabilities only"
|
||||||
|
#define NOT_GPIO "is not a GPIO"
|
||||||
|
|
||||||
|
static const char *TAG = "cmd_config";
|
||||||
|
extern struct arg_end *getParmsEnd(struct arg_hdr * * argtable);
|
||||||
|
//bck=<gpio>,ws=<gpio>,do=<gpio>[,mute=<gpio>[:0|1][,model=TAS57xx|TAS5713|AC101|I2S][,sda=<gpio>,scl=gpio[,i2c=<addr>]]
|
||||||
|
static struct {
|
||||||
|
struct arg_str *model_name;
|
||||||
|
struct arg_int *clock;
|
||||||
|
struct arg_int *wordselect;
|
||||||
|
struct arg_int *data;
|
||||||
|
struct arg_int *mute_gpio;
|
||||||
|
struct arg_lit *mute_level;
|
||||||
|
struct arg_int *dac_sda;
|
||||||
|
struct arg_int *dac_scl;
|
||||||
|
struct arg_int *dac_i2c;
|
||||||
|
struct arg_lit *clear;
|
||||||
|
struct arg_end *end;
|
||||||
|
} i2s_args;
|
||||||
|
static struct {
|
||||||
|
struct arg_int *clock;
|
||||||
|
struct arg_int *wordselect;
|
||||||
|
struct arg_int *data;
|
||||||
|
struct arg_lit *clear;
|
||||||
|
struct arg_end *end;
|
||||||
|
} spdif_args;
|
||||||
|
static struct {
|
||||||
|
struct arg_str *jack_behavior;
|
||||||
|
struct arg_end *end;
|
||||||
|
} audio_args;
|
||||||
|
static struct {
|
||||||
|
struct arg_str * output_device; // " -d <log>=<level>\tSet logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug\n"
|
||||||
|
struct arg_str * name;// " -n <name>\t\tSet the player name\n"
|
||||||
|
struct arg_str * server; // -s <server>[:<port>]\tConnect to specified server, otherwise uses autodiscovery to find server\n"
|
||||||
|
struct arg_str * buffers;// " -b <stream>:<output>\tSpecify internal Stream and Output buffer sizes in Kbytes\n"
|
||||||
|
struct arg_str * codecs;// " -c <codec1>,<codec2>\tRestrict codecs to those specified, otherwise load all available codecs; known codecs: " CODECS "\n"
|
||||||
|
struct arg_int * timeout;// " -C <timeout>\t\tClose output device when idle after timeout seconds, default is to keep it open while player is 'on'\n"
|
||||||
|
struct arg_str * log_level; // " -d <log>=<level>\tSet logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug\n"
|
||||||
|
// struct arg_str * log_level_all; // " -d <log>=<level>\tSet logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug\n"
|
||||||
|
// struct arg_str * log_level_slimproto; // " -d <log>=<level>\tSet logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug\n"
|
||||||
|
// struct arg_str * log_level_stream;
|
||||||
|
// struct arg_str * log_level_decode;
|
||||||
|
// struct arg_str * log_level_output;
|
||||||
|
#if IR
|
||||||
|
struct arg_str * log_level_ir;
|
||||||
|
#endif
|
||||||
|
// " -e <codec1>,<codec2>\tExplicitly exclude native support of one or more codecs; known codecs: " CODECS "\n"
|
||||||
|
// " -f <logfile>\t\tWrite debug to logfile\n"
|
||||||
|
// #if IR
|
||||||
|
// " -i [<filename>]\tEnable lirc remote control support (lirc config file ~/.lircrc used if filename not specified)\n"
|
||||||
|
// #endif
|
||||||
|
struct arg_str * mac_addr; // " -m <mac addr>\t\tSet mac address, format: ab:cd:ef:12:34:56\n"
|
||||||
|
struct arg_str * model_name;// " -M <modelname>\tSet the squeezelite player model name sent to the server (default: " MODEL_NAME_STRING ")\n"
|
||||||
|
struct arg_lit * header_format;// " -W\t\t\tRead wave and aiff format from header, ignore server parameters\n"
|
||||||
|
struct arg_str * rates; // " -r <rates>[:<delay>]\tSample rates supported, allows output to be off when squeezelite is started; rates = <maxrate>|<minrate>-<maxrate>|<rate1>,<rate2>,<rate3>; delay = optional delay switching rates in ms\n"
|
||||||
|
#if RESAMPLE
|
||||||
|
struct arg_lit * resample;
|
||||||
|
struct arg_str * resample_parms; //" -R -u [params]\tResample, params = <recipe>:<flags>:<attenuation>:<precision>:<passband_end>:<stopband_start>:<phase_response>,\n"
|
||||||
|
#endif
|
||||||
|
#if RESAMPLE16
|
||||||
|
struct arg_lit * resample;
|
||||||
|
struct arg_str * resample_parms; //" -R -u [params]\tResample, params = (b|l|m)[:i],\n"
|
||||||
|
// " \t\t\t b = basic linear interpolation, l = 13 taps, m = 21 taps, i = interpolate filter coefficients\n"
|
||||||
|
#endif
|
||||||
|
struct arg_int * rate;// " -Z <rate>\t\tReport rate to server in helo as the maximum sample rate we can support\n"
|
||||||
|
|
||||||
|
struct arg_end *end;
|
||||||
|
} squeezelite_args;
|
||||||
|
|
||||||
|
int is_output_gpio(struct arg_int * gpio, FILE * f, int * gpio_out, bool mandatory){
|
||||||
|
int res = 0;
|
||||||
|
const char * name = gpio->hdr.longopts?gpio->hdr.longopts:gpio->hdr.glossary;
|
||||||
|
*gpio_out=-1;
|
||||||
|
int t_gpio=gpio->ival[0];
|
||||||
|
if(gpio->count==0){
|
||||||
|
if(mandatory){
|
||||||
|
fprintf(f,"Missing: %s\n", name);
|
||||||
|
res++;
|
||||||
|
}
|
||||||
|
} else if(!GPIO_IS_VALID_OUTPUT_GPIO(t_gpio)){
|
||||||
|
fprintf(f,"Invalid %s gpio: [%d] %s\n",name, t_gpio, GPIO_IS_VALID_GPIO(t_gpio)?NOT_OUTPUT:NOT_GPIO );
|
||||||
|
res++;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
*gpio_out = t_gpio;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
int check_missing_parm(struct arg_int * int_parm, FILE * f){
|
||||||
|
int res=0;
|
||||||
|
const char * name = int_parm->hdr.longopts?int_parm->hdr.longopts:int_parm->hdr.glossary;
|
||||||
|
if(int_parm->count==0){
|
||||||
|
fprintf(f,"Missing: %s\n", name);
|
||||||
|
res++;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int do_audio_cmd(int argc, char **argv){
|
||||||
|
esp_err_t err=ESP_OK;
|
||||||
|
int nerrors = arg_parse(argc, argv,(void **)&audio_args);
|
||||||
|
char *buf = NULL;
|
||||||
|
size_t buf_size = 0;
|
||||||
|
FILE *f = open_memstream(&buf, &buf_size);
|
||||||
|
if (f == NULL) {
|
||||||
|
cmd_send_messaging(argv[0],MESSAGING_ERROR,"Unable to open memory stream.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if(nerrors >0){
|
||||||
|
arg_print_errors(f,audio_args.end,desc_audio);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(audio_args.jack_behavior->count>0){
|
||||||
|
err = ESP_OK; // suppress any error code that might have happened in a previous step
|
||||||
|
if(strcasecmp(audio_args.jack_behavior->sval[0],"Headphones")==0){
|
||||||
|
err = config_set_value(NVS_TYPE_STR, "jack_mutes_amp", "y");
|
||||||
|
}
|
||||||
|
else if(strcasecmp(audio_args.jack_behavior->sval[0],"Subwoofer")==0){
|
||||||
|
err = config_set_value(NVS_TYPE_STR, "jack_mutes_amp", "n");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
nerrors++;
|
||||||
|
fprintf(f,"Unknown Audio Jack Behavior %s.\n",audio_args.jack_behavior->sval[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(err!=ESP_OK){
|
||||||
|
nerrors++;
|
||||||
|
fprintf(f,"Error setting Audio Jack Behavior %s. %s\n",audio_args.jack_behavior->sval[0], esp_err_to_name(err));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fprintf(f,"Audio Jack Behavior changed to %s\n",audio_args.jack_behavior->sval[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!nerrors ){
|
||||||
|
fprintf(f,"Done.\n");
|
||||||
|
}
|
||||||
|
fflush (f);
|
||||||
|
cmd_send_messaging(argv[0],nerrors>0?MESSAGING_ERROR:MESSAGING_INFO,"%s", buf);
|
||||||
|
fclose(f);
|
||||||
|
FREE_AND_NULL(buf);
|
||||||
|
return (nerrors==0 && err==ESP_OK)?0:1;
|
||||||
|
}
|
||||||
|
static int do_spdif_cmd(int argc, char **argv){
|
||||||
|
i2s_platform_config_t i2s_dac_pin = {
|
||||||
|
.i2c_addr = -1,
|
||||||
|
.sda= -1,
|
||||||
|
.scl = -1,
|
||||||
|
.mute_gpio = -1,
|
||||||
|
.mute_level = -1
|
||||||
|
};
|
||||||
|
if(is_spdif_config_locked()){
|
||||||
|
cmd_send_messaging(argv[0],MESSAGING_ERROR,"SPDIF Configuration is locked on this platform\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
esp_err_t err=ESP_OK;
|
||||||
|
int nerrors = arg_parse(argc, argv,(void **)&spdif_args);
|
||||||
|
if (spdif_args.clear->count) {
|
||||||
|
cmd_send_messaging(argv[0],MESSAGING_WARNING,"SPDIF config cleared\n");
|
||||||
|
config_set_value(NVS_TYPE_STR, "spdif_config", "");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *buf = NULL;
|
||||||
|
size_t buf_size = 0;
|
||||||
|
FILE *f = open_memstream(&buf, &buf_size);
|
||||||
|
if (f == NULL) {
|
||||||
|
cmd_send_messaging(argv[0],MESSAGING_ERROR,"Unable to open memory stream.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if(nerrors >0){
|
||||||
|
arg_print_errors(f,spdif_args.end,desc_dac);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
nerrors+=is_output_gpio(spdif_args.clock, f, &i2s_dac_pin.pin.bck_io_num, true);
|
||||||
|
nerrors+=is_output_gpio(spdif_args.wordselect, f, &i2s_dac_pin.pin.ws_io_num, true);
|
||||||
|
nerrors+=is_output_gpio(spdif_args.data, f, &i2s_dac_pin.pin.data_out_num, true);
|
||||||
|
if(!nerrors ){
|
||||||
|
fprintf(f,"Storing SPDIF parameters.\n");
|
||||||
|
nerrors+=(config_spdif_set(&i2s_dac_pin )!=ESP_OK);
|
||||||
|
}
|
||||||
|
if(!nerrors ){
|
||||||
|
fprintf(f,"Done.\n");
|
||||||
|
}
|
||||||
|
fflush (f);
|
||||||
|
cmd_send_messaging(argv[0],nerrors>0?MESSAGING_ERROR:MESSAGING_INFO,"%s", buf);
|
||||||
|
fclose(f);
|
||||||
|
FREE_AND_NULL(buf);
|
||||||
|
return (nerrors==0 && err==ESP_OK)?0:1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int do_i2s_cmd(int argc, char **argv)
|
||||||
|
{
|
||||||
|
i2s_platform_config_t i2s_dac_pin = {
|
||||||
|
.i2c_addr = -1,
|
||||||
|
.sda= -1,
|
||||||
|
.scl = -1,
|
||||||
|
.mute_gpio = -1,
|
||||||
|
.mute_level = -1
|
||||||
|
};
|
||||||
|
if(is_dac_config_locked()){
|
||||||
|
cmd_send_messaging(argv[0],MESSAGING_ERROR,"DAC Configuration is locked on this platform\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
strcpy(i2s_dac_pin.model, "I2S");
|
||||||
|
|
||||||
|
esp_err_t err=ESP_OK;
|
||||||
|
int nerrors = arg_parse(argc, argv,(void **)&i2s_args);
|
||||||
|
if (i2s_args.clear->count) {
|
||||||
|
cmd_send_messaging(argv[0],MESSAGING_WARNING,"DAC config cleared\n");
|
||||||
|
config_set_value(NVS_TYPE_STR, "dac_config", "");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *buf = NULL;
|
||||||
|
size_t buf_size = 0;
|
||||||
|
FILE *f = open_memstream(&buf, &buf_size);
|
||||||
|
if (f == NULL) {
|
||||||
|
cmd_send_messaging(argv[0],MESSAGING_ERROR,"Unable to open memory stream.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if(nerrors >0){
|
||||||
|
arg_print_errors(f,i2s_args.end,desc_dac);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
nerrors+=is_output_gpio(i2s_args.clock, f, &i2s_dac_pin.pin.bck_io_num, true);
|
||||||
|
nerrors+=is_output_gpio(i2s_args.wordselect, f, &i2s_dac_pin.pin.ws_io_num, true);
|
||||||
|
nerrors+=is_output_gpio(i2s_args.data, f, &i2s_dac_pin.pin.data_out_num, true);
|
||||||
|
nerrors+=is_output_gpio(i2s_args.mute_gpio, f, &i2s_dac_pin.mute_gpio, false);
|
||||||
|
if(i2s_dac_pin.mute_gpio>0){
|
||||||
|
i2s_dac_pin.mute_level = i2s_args.mute_level->count>0?1:0;
|
||||||
|
}
|
||||||
|
if(i2s_args.dac_sda->count>0 && i2s_args.dac_sda->ival[0]>=0){
|
||||||
|
// if SDA specified, then SDA and SCL are both mandatory
|
||||||
|
nerrors+=is_output_gpio(i2s_args.dac_sda, f, &i2s_dac_pin.sda, false);
|
||||||
|
nerrors+=is_output_gpio(i2s_args.dac_scl, f, &i2s_dac_pin.scl, false);
|
||||||
|
}
|
||||||
|
if(i2s_args.dac_sda->count==0&& i2s_args.dac_i2c->count>0){
|
||||||
|
fprintf(f,"warning: ignoring i2c address, since dac i2c gpios config is incomplete\n");
|
||||||
|
}
|
||||||
|
else if(i2s_args.dac_i2c->count>0){
|
||||||
|
i2s_dac_pin.i2c_addr = i2s_args.dac_i2c->ival[0];
|
||||||
|
}
|
||||||
|
if(i2s_args.model_name->count>0 && strlen(i2s_args.model_name->sval[0])>0){
|
||||||
|
strncpy(i2s_dac_pin.model,i2s_args.model_name->sval[0],sizeof(i2s_dac_pin.model));
|
||||||
|
}
|
||||||
|
if(!nerrors ){
|
||||||
|
fprintf(f,"Storing i2s parameters.\n");
|
||||||
|
nerrors+=(config_i2s_set(&i2s_dac_pin, "dac_config")!=ESP_OK);
|
||||||
|
}
|
||||||
|
if(!nerrors ){
|
||||||
|
fprintf(f,"Done.\n");
|
||||||
|
}
|
||||||
|
fflush (f);
|
||||||
|
cmd_send_messaging(argv[0],nerrors>0?MESSAGING_ERROR:MESSAGING_INFO,"%s", buf);
|
||||||
|
fclose(f);
|
||||||
|
FREE_AND_NULL(buf);
|
||||||
|
|
||||||
|
return (nerrors==0 && err==ESP_OK)?0:1;
|
||||||
|
}
|
||||||
|
|
||||||
|
cJSON * example_cb(){
|
||||||
|
cJSON * values = cJSON_CreateObject();
|
||||||
|
// int i2c_port;
|
||||||
|
// const i2c_config_t * i2c= config_i2c_get(&i2c_port);
|
||||||
|
// if(i2c->scl_io_num>0) {
|
||||||
|
// cJSON_AddNumberToObject(values,"scl",i2c->scl_io_num);
|
||||||
|
// }
|
||||||
|
// if(i2c->sda_io_num>0) {
|
||||||
|
// cJSON_AddNumberToObject(values,"sda",i2c->sda_io_num);
|
||||||
|
// }
|
||||||
|
// if(i2c->master.clk_speed>0) {
|
||||||
|
// cJSON_AddNumberToObject(values,"freq",i2c->master.clk_speed);
|
||||||
|
// }
|
||||||
|
// if(i2c_port>0) {
|
||||||
|
// cJSON_AddNumberToObject(values,"port",i2c_port);
|
||||||
|
// }
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
//const i2s_pin_config_t * config_get_spdif_pin_struct( );
|
||||||
|
|
||||||
|
cJSON * i2s_cb(){
|
||||||
|
cJSON * values = cJSON_CreateObject();
|
||||||
|
const i2s_platform_config_t * i2s_conf= config_dac_get( );
|
||||||
|
if(i2s_conf->pin.bck_io_num>0 ) {
|
||||||
|
cJSON_AddNumberToObject(values,"clock",i2s_conf->pin.bck_io_num);
|
||||||
|
}
|
||||||
|
if(i2s_conf->pin.ws_io_num>=0 ) {
|
||||||
|
cJSON_AddNumberToObject(values,"wordselect",i2s_conf->pin.ws_io_num);
|
||||||
|
}
|
||||||
|
if(i2s_conf->pin.data_out_num>=0 ) {
|
||||||
|
cJSON_AddNumberToObject(values,"data",i2s_conf->pin.data_out_num);
|
||||||
|
}
|
||||||
|
if(i2s_conf->sda>=0 ) {
|
||||||
|
cJSON_AddNumberToObject(values,"dac_sda",i2s_conf->sda);
|
||||||
|
}
|
||||||
|
if(i2s_conf->scl>=0 ) {
|
||||||
|
cJSON_AddNumberToObject(values,"dac_scl",i2s_conf->scl);
|
||||||
|
}
|
||||||
|
if(i2s_conf->i2c_addr>=0 ) {
|
||||||
|
cJSON_AddNumberToObject(values,"dac_i2c",i2s_conf->i2c_addr);
|
||||||
|
}
|
||||||
|
if(i2s_conf->mute_gpio>=0 ) {
|
||||||
|
cJSON_AddNumberToObject(values,"mute_gpio",i2s_conf->mute_gpio);
|
||||||
|
}
|
||||||
|
if(i2s_conf->mute_level>=0 ) {
|
||||||
|
cJSON_AddBoolToObject(values,"mute_level",i2s_conf->mute_level>0);
|
||||||
|
}
|
||||||
|
if(strlen(i2s_conf->model)>0){
|
||||||
|
cJSON_AddStringToObject(values,"model_name",i2s_conf->model);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cJSON_AddStringToObject(values,"model_name","I2S");
|
||||||
|
}
|
||||||
|
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
cJSON * spdif_cb(){
|
||||||
|
cJSON * values = cJSON_CreateObject();
|
||||||
|
const i2s_platform_config_t * spdif_conf= config_spdif_get( );
|
||||||
|
if(spdif_conf->pin.bck_io_num>0 ) {
|
||||||
|
cJSON_AddNumberToObject(values,"clock",spdif_conf->pin.bck_io_num);
|
||||||
|
}
|
||||||
|
if(spdif_conf->pin.ws_io_num>=0 ) {
|
||||||
|
cJSON_AddNumberToObject(values,"wordselect",spdif_conf->pin.ws_io_num);
|
||||||
|
}
|
||||||
|
if(spdif_conf->pin.data_out_num>=0 ) {
|
||||||
|
cJSON_AddNumberToObject(values,"data",spdif_conf->pin.data_out_num);
|
||||||
|
}
|
||||||
|
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
cJSON * audio_cb(){
|
||||||
|
cJSON * values = cJSON_CreateObject();
|
||||||
|
char * p = config_alloc_get_default(NVS_TYPE_STR, "jack_mutes_amp", "n", 0);
|
||||||
|
cJSON_AddStringToObject(values,"jack_behavior",(strcmp(p,"1") == 0 ||strcasecmp(p,"y") == 0)?"Headphones":"Subwoofer");
|
||||||
|
FREE_AND_NULL(p);
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void get_str_parm_json(struct arg_str * parm, cJSON * entry){
|
||||||
|
const char * name = parm->hdr.longopts?parm->hdr.longopts:parm->hdr.glossary;
|
||||||
|
if(parm->count>0){
|
||||||
|
cJSON_AddStringToObject(entry,name,parm->sval[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void get_file_parm_json(struct arg_file * parm, cJSON * entry){
|
||||||
|
const char * name = parm->hdr.longopts?parm->hdr.longopts:parm->hdr.glossary;
|
||||||
|
if(parm->count>0){
|
||||||
|
cJSON_AddStringToObject(entry,name,parm->filename[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void get_lit_parm_json(struct arg_lit * parm, cJSON * entry){
|
||||||
|
const char * name = parm->hdr.longopts?parm->hdr.longopts:parm->hdr.glossary;
|
||||||
|
cJSON_AddBoolToObject(entry,name,(parm->count>0));
|
||||||
|
}
|
||||||
|
void get_int_parm_json(struct arg_int * parm, cJSON * entry){
|
||||||
|
const char * name = parm->hdr.longopts?parm->hdr.longopts:parm->hdr.glossary;
|
||||||
|
if(parm->count>0){
|
||||||
|
cJSON_AddNumberToObject(entry,name,parm->ival[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int do_squeezelite_cmd(int argc, char **argv)
|
||||||
|
{
|
||||||
|
esp_err_t err=ESP_OK;
|
||||||
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr ** )&squeezelite_args);
|
||||||
|
char *buf = NULL;
|
||||||
|
size_t buf_size = 0;
|
||||||
|
FILE *f = open_memstream(&buf, &buf_size);
|
||||||
|
if (f == NULL) {
|
||||||
|
cmd_send_messaging(argv[0],MESSAGING_ERROR,"Unable to open memory stream.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
fprintf(f,"Not yet implemented!");
|
||||||
|
nerrors+=1;
|
||||||
|
fflush (f);
|
||||||
|
cmd_send_messaging(argv[0],nerrors>0?MESSAGING_ERROR:MESSAGING_INFO,"%s", buf);
|
||||||
|
fclose(f);
|
||||||
|
FREE_AND_NULL(buf);
|
||||||
|
return (nerrors==0 && err==ESP_OK)?0:1;
|
||||||
|
}
|
||||||
|
|
||||||
|
cJSON * squeezelite_cb(){
|
||||||
|
cJSON * values = cJSON_CreateObject();
|
||||||
|
char * nvs_config= config_alloc_get(NVS_TYPE_STR, "autoexec1");
|
||||||
|
char **argv = NULL;
|
||||||
|
char *buf = NULL;
|
||||||
|
size_t buf_size = 0;
|
||||||
|
int nerrors=1;
|
||||||
|
FILE *f = open_memstream(&buf, &buf_size);
|
||||||
|
if (f == NULL) {
|
||||||
|
log_send_messaging(MESSAGING_ERROR,"Unable to parse squeezelite parameters");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
if(nvs_config && strlen(nvs_config)>0){
|
||||||
|
ESP_LOGD(TAG,"Parsing command %s",nvs_config);
|
||||||
|
argv = (char **) calloc(22, sizeof(char *));
|
||||||
|
if (argv == NULL) {
|
||||||
|
FREE_AND_NULL(nvs_config);
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
size_t argc = esp_console_split_argv(nvs_config, argv,22);
|
||||||
|
if (argc != 0) {
|
||||||
|
nerrors = arg_parse(argc, argv,(void **)&squeezelite_args);
|
||||||
|
ESP_LOGD(TAG,"Parsing completed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nerrors == 0) {
|
||||||
|
get_str_parm_json(squeezelite_args.buffers, values);
|
||||||
|
get_str_parm_json(squeezelite_args.codecs, values);
|
||||||
|
get_lit_parm_json(squeezelite_args.header_format, values);
|
||||||
|
get_str_parm_json(squeezelite_args.log_level, values);
|
||||||
|
|
||||||
|
// get_str_parm_json(squeezelite_args.log_level_all, values);
|
||||||
|
// get_str_parm_json(squeezelite_args.log_level_decode, values);
|
||||||
|
// get_str_parm_json(squeezelite_args.log_level_output, values);
|
||||||
|
// get_str_parm_json(squeezelite_args.log_level_slimproto, values);
|
||||||
|
// get_str_parm_json(squeezelite_args.log_level_stream, values);
|
||||||
|
get_str_parm_json(squeezelite_args.mac_addr, values);
|
||||||
|
get_str_parm_json(squeezelite_args.output_device, values);
|
||||||
|
get_str_parm_json(squeezelite_args.model_name, values);
|
||||||
|
get_str_parm_json(squeezelite_args.name, values);
|
||||||
|
get_int_parm_json(squeezelite_args.rate, values);
|
||||||
|
get_str_parm_json(squeezelite_args.rates, values);
|
||||||
|
get_str_parm_json(squeezelite_args.server, values);
|
||||||
|
get_int_parm_json(squeezelite_args.timeout, values);
|
||||||
|
char * p = cJSON_Print(values);
|
||||||
|
ESP_LOGD(TAG,"%s",p);
|
||||||
|
free(p);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
arg_print_errors(f, squeezelite_args.end, desc_squeezelite);
|
||||||
|
}
|
||||||
|
fflush (f);
|
||||||
|
if(strlen(buf)>0){
|
||||||
|
log_send_messaging(nerrors?MESSAGING_ERROR:MESSAGING_INFO,"%s", buf);
|
||||||
|
}
|
||||||
|
fclose(f);
|
||||||
|
FREE_AND_NULL(buf);
|
||||||
|
}
|
||||||
|
FREE_AND_NULL(nvs_config);
|
||||||
|
FREE_AND_NULL(argv);
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
static char * get_log_level_options(const char * longname){
|
||||||
|
const char * template = "<%s=info|%s=debug|%s=sdebug>";
|
||||||
|
char * options = NULL;
|
||||||
|
int len = snprintf(NULL,0,template,longname,longname,longname);
|
||||||
|
if(len>0){
|
||||||
|
options = malloc(len+1);
|
||||||
|
snprintf(options,len,template,longname,longname,longname);
|
||||||
|
}
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
static void register_i2s_config(void){
|
||||||
|
i2s_args.model_name = arg_str1(NULL,"model_name","TAS57xx|TAS5713|AC101|I2S","DAC Model Name");
|
||||||
|
i2s_args.clear = arg_lit0(NULL, "clear", "Clear configuration");
|
||||||
|
i2s_args.clock = arg_int1(NULL,"clock","<n>","Clock GPIO. e.g. 33");
|
||||||
|
i2s_args.wordselect = arg_int1(NULL,"wordselect","<n>","Word Select GPIO. e.g. 25");
|
||||||
|
i2s_args.data = arg_int1(NULL,"data","<n>","Data GPIO. e.g. 32");
|
||||||
|
i2s_args.mute_gpio = arg_int0(NULL,"mute_gpio", "<n>", "Mute GPIO. e.g. 14");
|
||||||
|
i2s_args.mute_level = arg_lit0(NULL,"mute_level","Mute GPIO level. Checked=HIGH, Unchecked=LOW");
|
||||||
|
i2s_args.dac_sda = arg_int0(NULL,"dac_sda", "<n>", "SDA GPIO. e.g. 27");
|
||||||
|
i2s_args.dac_scl = arg_int0(NULL,"dac_scl", "<n>", "SCL GPIO. e.g. 26");
|
||||||
|
i2s_args.dac_i2c = arg_int0(NULL,"dac_i2c", "<n>", "I2C device address. e.g. 106");
|
||||||
|
i2s_args.end = arg_end(6);
|
||||||
|
|
||||||
|
const esp_console_cmd_t cmd = {
|
||||||
|
.command = CFG_TYPE_HW("dac"),
|
||||||
|
.help = desc_dac,
|
||||||
|
.hint = NULL,
|
||||||
|
.func = &do_i2s_cmd,
|
||||||
|
.argtable = &i2s_args
|
||||||
|
};
|
||||||
|
cmd_to_json_with_cb(&cmd,&i2s_cb);
|
||||||
|
ESP_ERROR_CHECK(esp_console_cmd_register(&cmd));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void register_audio_config(void){
|
||||||
|
audio_args.jack_behavior = arg_str0("j", "jack_behavior","Headphones|Subwoofer","On supported DAC, determines the audio jack behavior. Selecting headphones will cause the external amp to be muted on insert, while selecting Subwoofer will keep the amp active all the time.");
|
||||||
|
audio_args.end = arg_end(6);
|
||||||
|
const esp_console_cmd_t cmd = {
|
||||||
|
.command = CFG_TYPE_AUDIO("general"),
|
||||||
|
.help = desc_audio,
|
||||||
|
.hint = NULL,
|
||||||
|
.func = &do_audio_cmd,
|
||||||
|
.argtable = &audio_args
|
||||||
|
};
|
||||||
|
cmd_to_json_with_cb(&cmd,&audio_cb);
|
||||||
|
ESP_ERROR_CHECK(esp_console_cmd_register(&cmd));
|
||||||
|
}static void register_spdif_config(void){
|
||||||
|
spdif_args.clear = arg_lit0(NULL, "clear", "Clear configuration");
|
||||||
|
spdif_args.clock = arg_int1(NULL,"clock","<n>","Clock GPIO. e.g. 33");
|
||||||
|
spdif_args.wordselect = arg_int1(NULL,"wordselect","<n>","Word Select GPIO. e.g. 25");
|
||||||
|
spdif_args.data = arg_int1(NULL,"data","<n>","Data GPIO. e.g. 32");
|
||||||
|
spdif_args.end = arg_end(6);
|
||||||
|
|
||||||
|
const esp_console_cmd_t cmd = {
|
||||||
|
.command = CFG_TYPE_HW("spdif"),
|
||||||
|
.help = desc_spdif,
|
||||||
|
.hint = NULL,
|
||||||
|
.func = &do_spdif_cmd,
|
||||||
|
.argtable = &spdif_args
|
||||||
|
};
|
||||||
|
cmd_to_json_with_cb(&cmd,&spdif_cb);
|
||||||
|
ESP_ERROR_CHECK(esp_console_cmd_register(&cmd));
|
||||||
|
}
|
||||||
|
static void register_squeezelite_config(void){
|
||||||
|
squeezelite_args.server = arg_str0("s","server","<server>[:<port>]","Connect to specified server, otherwise uses autodiscovery to find server");
|
||||||
|
squeezelite_args.buffers = arg_str0("b","buffers","<stream>:<output>","Internal Stream and Output buffer sizes in Kbytes");
|
||||||
|
squeezelite_args.codecs = arg_strn("c","codecs","+" CODECS "+",0,20,"Restrict codecs to those specified, otherwise load all available codecs; known codecs: " CODECS );
|
||||||
|
squeezelite_args.timeout = arg_int0("C","timeout","<n>","Close output device when idle after timeout seconds, default is to keep it open while player is 'on");
|
||||||
|
squeezelite_args.log_level = arg_str0("d","loglevel","log=level","Set logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug"); // " -d <log>=<level>\tSet logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug\n"
|
||||||
|
// squeezelite_args.log_level_all = arg_str0(NULL,"all",get_log_level_options("all"),"Overall Logging Level");
|
||||||
|
// squeezelite_args.log_level_slimproto = arg_str0(NULL,"loglevel_slimproto",get_log_level_options("slimproto"),"Slimproto Logging Level");
|
||||||
|
// squeezelite_args.log_level_stream= arg_str0(NULL,"loglevel_stream",get_log_level_options("stream"),"Stream Logging Level");
|
||||||
|
// squeezelite_args.log_level_decode= arg_str0(NULL,"loglevel_decode",get_log_level_options("decode"),"Decode Logging Level");
|
||||||
|
// squeezelite_args.log_level_output= arg_str0(NULL,"loglevel_output",get_log_level_options("output"),"Output Logging Level");
|
||||||
|
#if IR
|
||||||
|
squeezelite_args.log_level_ir= arg_str0(NULL,"loglevel_ir",get_log_level_options("ir"),"IR Logging Level");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
squeezelite_args.output_device = arg_str0("o","output_device","<string>","Output device (BT, I2S or SPDIF)");
|
||||||
|
squeezelite_args.mac_addr = arg_str0("m","mac_addr","<string>","Mac address, format: ab:cd:ef:12:34:56.");
|
||||||
|
squeezelite_args.model_name = arg_str0("M", "modelname", "<string>","Set the squeezelite player model name sent to the server (default: " MODEL_NAME_STRING ")");
|
||||||
|
squeezelite_args.name = arg_str0("n","name","<string>","Player name, if different from the current host name. Name can alternatively be assigned from the system/device name configuration.");
|
||||||
|
squeezelite_args.header_format = arg_lit0("W","header_format","Read wave and aiff format from header, ignore server parameters");
|
||||||
|
squeezelite_args.rates = arg_str0("r","rates","<rates>[:<delay>]", "Sample rates supported, allows output to be off when squeezelite is started; rates = <maxrate>|<minrate>-<maxrate>|<rate1>,<rate2>,<rate3>; delay = optional delay switching rates in ms\n");
|
||||||
|
#if RESAMPLE
|
||||||
|
squeezelite_args.resample = arg_lit0("R","resample","Activate Resample");
|
||||||
|
squeezelite_args.resample_parms = arg_str0("u","resample_parms","<recipe>:<flags>:<attenuation>:<precision>:<passband_end>:<stopband_start>:<phase_response>","Resample, params");
|
||||||
|
#endif
|
||||||
|
#if RESAMPLE16
|
||||||
|
squeezelite_args.resample = arg_lit0("R","resample","Activate Resample");
|
||||||
|
squeezelite_args.resample_parms = arg_str0("u","resample_parms","(b|l|m)[:i]","Resample, params. b = basic linear interpolation, l = 13 taps, m = 21 taps, i = interpolate filter coefficients");
|
||||||
|
#endif
|
||||||
|
squeezelite_args.rate = arg_int0("Z","max_rate", "<n>", "Report rate to server in helo as the maximum sample rate we can support");
|
||||||
|
squeezelite_args.end = arg_end(6);
|
||||||
|
const esp_console_cmd_t cmd = {
|
||||||
|
.command = CFG_TYPE_AUDIO("squeezelite"),
|
||||||
|
.help = desc_squeezelite,
|
||||||
|
.hint = NULL,
|
||||||
|
.func = &do_squeezelite_cmd,
|
||||||
|
.argtable = &squeezelite_args
|
||||||
|
};
|
||||||
|
cmd_to_json_with_cb(&cmd,&squeezelite_cb);
|
||||||
|
ESP_ERROR_CHECK(esp_console_cmd_register(&cmd));
|
||||||
|
}
|
||||||
|
|
||||||
|
void register_config_cmd(void){
|
||||||
|
register_audio_config();
|
||||||
|
// register_squeezelite_config();
|
||||||
|
register_i2s_config();
|
||||||
|
register_spdif_config();
|
||||||
|
}
|
||||||
|
|
||||||
19
components/platform_console/cmd_config.h
Normal file
19
components/platform_console/cmd_config.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
/* cmd_i2ctools.h
|
||||||
|
|
||||||
|
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, this
|
||||||
|
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||||
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "stdbool.h"
|
||||||
|
#include "stdio.h"
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
void register_config_cmd(void);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -17,6 +17,7 @@ extern "C" {
|
|||||||
#include "cmd_nvs.h"
|
#include "cmd_nvs.h"
|
||||||
#include "cmd_i2ctools.h"
|
#include "cmd_i2ctools.h"
|
||||||
#include "cmd_ota.h"
|
#include "cmd_ota.h"
|
||||||
|
#include "cmd_config.h"
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -330,11 +330,11 @@ static int set_value(int argc, char **argv)
|
|||||||
const char *key = set_args.key->sval[0];
|
const char *key = set_args.key->sval[0];
|
||||||
const char *type = set_args.type->sval[0];
|
const char *type = set_args.type->sval[0];
|
||||||
const char *values = set_args.value->sval[0];
|
const char *values = set_args.value->sval[0];
|
||||||
log_send_messaging(MESSAGING_INFO, "Setting '%s' (type %s)", key,type);
|
cmd_send_messaging(argv[0],MESSAGING_INFO, "Setting '%s' (type %s)", key,type);
|
||||||
esp_err_t err = set_value_in_nvs(key, type, values);
|
esp_err_t err = set_value_in_nvs(key, type, values);
|
||||||
|
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
log_send_messaging(MESSAGING_ERROR, "%s", esp_err_to_name(err));
|
cmd_send_messaging(argv[0],MESSAGING_ERROR, "%s", esp_err_to_name(err));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,7 +355,7 @@ static int get_value(int argc, char **argv)
|
|||||||
esp_err_t err = get_value_from_nvs(key, type);
|
esp_err_t err = get_value_from_nvs(key, type);
|
||||||
|
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
log_send_messaging(MESSAGING_ERROR, "%s", esp_err_to_name(err));
|
cmd_send_messaging(argv[0],MESSAGING_ERROR, "%s", esp_err_to_name(err));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,7 +374,7 @@ static int erase_value(int argc, char **argv)
|
|||||||
esp_err_t err = erase(key);
|
esp_err_t err = erase(key);
|
||||||
|
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
log_send_messaging(MESSAGING_ERROR, "%s", esp_err_to_name(err));
|
cmd_send_messaging(argv[0],MESSAGING_ERROR, "%s", esp_err_to_name(err));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -392,7 +392,7 @@ static int erase_namespace(int argc, char **argv)
|
|||||||
|
|
||||||
esp_err_t err = erase_all(name);
|
esp_err_t err = erase_all(name);
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
log_send_messaging(MESSAGING_ERROR, "%s", esp_err_to_name(err));
|
cmd_send_messaging(argv[0],MESSAGING_ERROR, "%s", esp_err_to_name(err));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,11 +411,11 @@ static int erase_wifi_manager(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
nvs_close(nvs);
|
nvs_close(nvs);
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
log_send_messaging(MESSAGING_ERROR, "wifi manager configuration was not erase. %s", esp_err_to_name(err));
|
cmd_send_messaging(argv[0],MESSAGING_ERROR, "wifi manager configuration was not erase. %s", esp_err_to_name(err));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log_send_messaging(MESSAGING_WARNING, "Wifi manager configuration was erased");
|
cmd_send_messaging(argv[0],MESSAGING_WARNING, "Wifi manager configuration was erased");
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* Console example — various system commands
|
/* Console example — various system commands
|
||||||
|
|
||||||
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, this
|
Unless required by applicable law or agreed to in writing, this
|
||||||
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||||
CONDITIONS OF ANY KIND, either express or implied.
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@@ -32,19 +32,30 @@
|
|||||||
#include "messaging.h"
|
#include "messaging.h"
|
||||||
#include "platform_console.h"
|
#include "platform_console.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
#ifdef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS
|
||||||
#ifdef CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS
|
|
||||||
#define WITH_TASKS_INFO 1
|
#define WITH_TASKS_INFO 1
|
||||||
#endif
|
#endif
|
||||||
|
static struct {
|
||||||
|
struct arg_str *scanmode;
|
||||||
|
//disable_ps struct arg_lit *disable_power_save;
|
||||||
|
struct arg_end *end;
|
||||||
|
} wifi_parms_arg;
|
||||||
static struct {
|
static struct {
|
||||||
struct arg_str *name;
|
struct arg_str *name;
|
||||||
struct arg_end *end;
|
struct arg_end *end;
|
||||||
} name_args;
|
} name_args;
|
||||||
|
static struct {
|
||||||
|
struct arg_lit *btspeaker;
|
||||||
|
struct arg_lit *airplay;
|
||||||
|
struct arg_str *telnet;
|
||||||
|
#if WITH_TASKS_INFO
|
||||||
|
struct arg_lit *stats;
|
||||||
|
#endif
|
||||||
|
struct arg_end *end;
|
||||||
|
} set_services_args;
|
||||||
static const char * TAG = "cmd_system";
|
static const char * TAG = "cmd_system";
|
||||||
|
|
||||||
static void register_setbtsource();
|
//static void register_setbtsource();
|
||||||
static void register_free();
|
static void register_free();
|
||||||
static void register_setdevicename();
|
static void register_setdevicename();
|
||||||
static void register_heap();
|
static void register_heap();
|
||||||
@@ -55,14 +66,18 @@ static void register_light_sleep();
|
|||||||
static void register_factory_boot();
|
static void register_factory_boot();
|
||||||
static void register_restart_ota();
|
static void register_restart_ota();
|
||||||
static void register_update_certs();
|
static void register_update_certs();
|
||||||
|
static void register_set_services();
|
||||||
|
static void register_set_wifi_parms();
|
||||||
#if WITH_TASKS_INFO
|
#if WITH_TASKS_INFO
|
||||||
static void register_tasks();
|
static void register_tasks();
|
||||||
#endif
|
#endif
|
||||||
extern BaseType_t wifi_manager_task;
|
extern BaseType_t wifi_manager_task;
|
||||||
void register_system()
|
void register_system()
|
||||||
{
|
{
|
||||||
register_setbtsource();
|
register_set_wifi_parms();
|
||||||
|
// register_setbtsource();
|
||||||
register_free();
|
register_free();
|
||||||
|
register_set_services();
|
||||||
register_heap();
|
register_heap();
|
||||||
register_setdevicename();
|
register_setdevicename();
|
||||||
register_version();
|
register_version();
|
||||||
@@ -82,7 +97,7 @@ static int get_version(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
esp_chip_info_t info;
|
esp_chip_info_t info;
|
||||||
esp_chip_info(&info);
|
esp_chip_info(&info);
|
||||||
log_send_messaging(MESSAGING_INFO,
|
cmd_send_messaging(argv[0],MESSAGING_INFO,
|
||||||
"IDF Version:%s\r\n"
|
"IDF Version:%s\r\n"
|
||||||
"Chip info:\r\n"
|
"Chip info:\r\n"
|
||||||
"\tmodel:%s\r\n"
|
"\tmodel:%s\r\n"
|
||||||
@@ -110,35 +125,32 @@ static void register_version()
|
|||||||
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 'restart' command restarts the program */
|
|
||||||
|
|
||||||
|
|
||||||
esp_err_t guided_boot(esp_partition_subtype_t partition_subtype)
|
esp_err_t guided_boot(esp_partition_subtype_t partition_subtype)
|
||||||
{
|
{
|
||||||
if(is_recovery_running){
|
if(is_recovery_running){
|
||||||
if(partition_subtype ==ESP_PARTITION_SUBTYPE_APP_FACTORY){
|
if(partition_subtype ==ESP_PARTITION_SUBTYPE_APP_FACTORY){
|
||||||
log_send_messaging(MESSAGING_WARNING,"RECOVERY application is already active");
|
log_send_messaging(MESSAGING_WARNING,"RECOVERY application is already active");
|
||||||
if(!wait_for_commit()){
|
if(!wait_for_commit()){
|
||||||
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||||
}
|
}
|
||||||
|
|
||||||
vTaskDelay(750/ portTICK_PERIOD_MS);
|
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||||
esp_restart();
|
esp_restart();
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(partition_subtype !=ESP_PARTITION_SUBTYPE_APP_FACTORY){
|
if(partition_subtype !=ESP_PARTITION_SUBTYPE_APP_FACTORY){
|
||||||
log_send_messaging(MESSAGING_WARNING,"SQUEEZELITE application is already active");
|
log_send_messaging(MESSAGING_WARNING,"SQUEEZELITE application is already active");
|
||||||
if(!wait_for_commit()){
|
if(!wait_for_commit()){
|
||||||
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||||
}
|
}
|
||||||
|
|
||||||
vTaskDelay(750/ portTICK_PERIOD_MS);
|
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||||
esp_restart();
|
esp_restart();
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
esp_err_t err = ESP_OK;
|
esp_err_t err = ESP_OK;
|
||||||
bool bFound=false;
|
bool bFound=false;
|
||||||
log_send_messaging(MESSAGING_INFO, "Looking for partition type %u",partition_subtype);
|
log_send_messaging(MESSAGING_INFO, "Looking for partition type %u",partition_subtype);
|
||||||
@@ -162,9 +174,7 @@ else {
|
|||||||
log_send_messaging(MESSAGING_ERROR,"Unable to select partition for reboot: %s",esp_err_to_name(err));
|
log_send_messaging(MESSAGING_ERROR,"Unable to select partition for reboot: %s",esp_err_to_name(err));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
log_send_messaging(MESSAGING_WARNING, "Application partition %s sub type %u is selected for boot", partition->label,partition_subtype);
|
bFound=true;
|
||||||
bFound=true;
|
|
||||||
messaging_post_message(MESSAGING_WARNING,MESSAGING_CLASS_SYSTEM,"Reboot failed. Cannot iterate through partitions");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -175,9 +185,8 @@ else {
|
|||||||
ESP_LOGD(TAG, "Yielding to other processes");
|
ESP_LOGD(TAG, "Yielding to other processes");
|
||||||
taskYIELD();
|
taskYIELD();
|
||||||
if(bFound) {
|
if(bFound) {
|
||||||
log_send_messaging(MESSAGING_WARNING,"Configuration %s changes. ",config_has_changes()?"has":"does not have");
|
|
||||||
if(!wait_for_commit()){
|
if(!wait_for_commit()){
|
||||||
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration changes. ");
|
||||||
}
|
}
|
||||||
vTaskDelay(750/ portTICK_PERIOD_MS);
|
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||||
esp_restart();
|
esp_restart();
|
||||||
@@ -191,7 +200,7 @@ static int restart(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
log_send_messaging(MESSAGING_WARNING, "\n\nPerforming a simple restart to the currently active partition.");
|
log_send_messaging(MESSAGING_WARNING, "\n\nPerforming a simple restart to the currently active partition.");
|
||||||
if(!wait_for_commit()){
|
if(!wait_for_commit()){
|
||||||
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
cmd_send_messaging(argv[0],MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||||
}
|
}
|
||||||
vTaskDelay(750/ portTICK_PERIOD_MS);
|
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||||
esp_restart();
|
esp_restart();
|
||||||
@@ -200,7 +209,7 @@ static int restart(int argc, char **argv)
|
|||||||
|
|
||||||
void simple_restart()
|
void simple_restart()
|
||||||
{
|
{
|
||||||
log_send_messaging(MESSAGING_WARNING,"\n\n Called to perform a simple system reboot.");
|
log_send_messaging(MESSAGING_WARNING,"System reboot requested.");
|
||||||
if(!wait_for_commit()){
|
if(!wait_for_commit()){
|
||||||
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||||
}
|
}
|
||||||
@@ -211,24 +220,24 @@ void simple_restart()
|
|||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t guided_restart_ota(){
|
esp_err_t guided_restart_ota(){
|
||||||
log_send_messaging(MESSAGING_WARNING,"\n\nCalled for a reboot to OTA Application");
|
log_send_messaging(MESSAGING_WARNING,"System reboot to Application requested");
|
||||||
guided_boot(ESP_PARTITION_SUBTYPE_APP_OTA_0);
|
guided_boot(ESP_PARTITION_SUBTYPE_APP_OTA_0);
|
||||||
return ESP_FAIL; // return fail. This should never return... we're rebooting!
|
return ESP_FAIL; // return fail. This should never return... we're rebooting!
|
||||||
}
|
}
|
||||||
esp_err_t guided_factory(){
|
esp_err_t guided_factory(){
|
||||||
log_send_messaging(MESSAGING_WARNING,"\n\nCalled for a reboot to recovery application");
|
log_send_messaging(MESSAGING_WARNING,"System reboot to recovery requested");
|
||||||
guided_boot(ESP_PARTITION_SUBTYPE_APP_FACTORY);
|
guided_boot(ESP_PARTITION_SUBTYPE_APP_FACTORY);
|
||||||
return ESP_FAIL; // return fail. This should never return... we're rebooting!
|
return ESP_FAIL; // return fail. This should never return... we're rebooting!
|
||||||
}
|
}
|
||||||
static int restart_factory(int argc, char **argv)
|
static int restart_factory(int argc, char **argv)
|
||||||
{
|
{
|
||||||
log_send_messaging(MESSAGING_WARNING, "Executing guided boot into recovery");
|
cmd_send_messaging(argv[0],MESSAGING_WARNING, "Executing guided boot into recovery");
|
||||||
guided_boot(ESP_PARTITION_SUBTYPE_APP_FACTORY);
|
guided_boot(ESP_PARTITION_SUBTYPE_APP_FACTORY);
|
||||||
return 0; // return fail. This should never return... we're rebooting!
|
return 0; // return fail. This should never return... we're rebooting!
|
||||||
}
|
}
|
||||||
static int restart_ota(int argc, char **argv)
|
static int restart_ota(int argc, char **argv)
|
||||||
{
|
{
|
||||||
log_send_messaging(MESSAGING_WARNING, "Executing guided boot into ota app 0");
|
cmd_send_messaging(argv[0],MESSAGING_WARNING, "Executing guided boot into ota app 0");
|
||||||
guided_boot(ESP_PARTITION_SUBTYPE_APP_OTA_0);
|
guided_boot(ESP_PARTITION_SUBTYPE_APP_OTA_0);
|
||||||
return 0; // return fail. This should never return... we're rebooting!
|
return 0; // return fail. This should never return... we're rebooting!
|
||||||
}
|
}
|
||||||
@@ -236,7 +245,7 @@ static void register_restart()
|
|||||||
{
|
{
|
||||||
const esp_console_cmd_t cmd = {
|
const esp_console_cmd_t cmd = {
|
||||||
.command = "restart",
|
.command = "restart",
|
||||||
.help = "Software reset of the chip",
|
.help = "Reboot system",
|
||||||
.hint = NULL,
|
.hint = NULL,
|
||||||
.func = &restart,
|
.func = &restart,
|
||||||
};
|
};
|
||||||
@@ -247,7 +256,7 @@ static void register_restart_ota()
|
|||||||
{
|
{
|
||||||
const esp_console_cmd_t cmd = {
|
const esp_console_cmd_t cmd = {
|
||||||
.command = "restart_ota",
|
.command = "restart_ota",
|
||||||
.help = "Selects the ota app partition to boot from and performa a software reset of the chip",
|
.help = "Reboot system to Squeezelite",
|
||||||
.hint = NULL,
|
.hint = NULL,
|
||||||
.func = &restart_ota,
|
.func = &restart_ota,
|
||||||
};
|
};
|
||||||
@@ -259,7 +268,7 @@ static void register_factory_boot()
|
|||||||
{
|
{
|
||||||
const esp_console_cmd_t cmd = {
|
const esp_console_cmd_t cmd = {
|
||||||
.command = "recovery",
|
.command = "recovery",
|
||||||
.help = "Resets and boot to recovery (if available)",
|
.help = "Reboot system to Recovery",
|
||||||
.hint = NULL,
|
.hint = NULL,
|
||||||
.func = &restart_factory,
|
.func = &restart_factory,
|
||||||
};
|
};
|
||||||
@@ -270,94 +279,10 @@ static void register_factory_boot()
|
|||||||
|
|
||||||
static int free_mem(int argc, char **argv)
|
static int free_mem(int argc, char **argv)
|
||||||
{
|
{
|
||||||
log_send_messaging(MESSAGING_INFO,"%d", esp_get_free_heap_size());
|
cmd_send_messaging(argv[0],MESSAGING_INFO,"%d", esp_get_free_heap_size());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
static struct {
|
|
||||||
struct arg_str *a2dp_dev_name;
|
|
||||||
struct arg_str *a2dp_sink_name;
|
|
||||||
struct arg_str *wakeup_gpio_level;
|
|
||||||
struct arg_str *bt_sink_pin;
|
|
||||||
struct arg_str *enable_bt_sink;
|
|
||||||
struct arg_end *end;
|
|
||||||
} set_btsource_args;
|
|
||||||
*/
|
|
||||||
|
|
||||||
//static int do_set_btsource(int argc, char **argv)
|
|
||||||
//{
|
|
||||||
// a2dp_dev_name;
|
|
||||||
// a2dp_sink_name;
|
|
||||||
// wakeup_gpio_level;
|
|
||||||
// bt_sink_pin;
|
|
||||||
// enable_bt_sink;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&deep_sleep_args);
|
|
||||||
// if (nerrors != 0) {
|
|
||||||
// return 1;
|
|
||||||
// }
|
|
||||||
// if (deep_sleep_args.wakeup_time->count) {
|
|
||||||
// uint64_t timeout = 1000ULL * deep_sleep_args.wakeup_time->ival[0];
|
|
||||||
// log_send_messaging(MESSAGING_INFO, "Enabling timer wakeup, timeout=%lluus", timeout);
|
|
||||||
// ESP_ERROR_CHECK( esp_sleep_enable_timer_wakeup(timeout) );
|
|
||||||
// }
|
|
||||||
// if (deep_sleep_args.wakeup_gpio_num->count) {
|
|
||||||
// int io_num = deep_sleep_args.wakeup_gpio_num->ival[0];
|
|
||||||
// if (!rtc_gpio_is_valid_gpio(io_num)) {
|
|
||||||
// log_send_messaging(MESSAGING_ERROR, "GPIO %d is not an RTC IO", io_num);
|
|
||||||
// return 1;
|
|
||||||
// }
|
|
||||||
// int level = 0;
|
|
||||||
// if (deep_sleep_args.wakeup_gpio_level->count) {
|
|
||||||
// level = deep_sleep_args.wakeup_gpio_level->ival[0];
|
|
||||||
// if (level != 0 && level != 1) {
|
|
||||||
// log_send_messaging(MESSAGING_ERROR, "Invalid wakeup level: %d", level);
|
|
||||||
// return 1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// log_send_messaging(MESSAGING_INFO, "Enabling wakeup on GPIO%d, wakeup on %s level",
|
|
||||||
// io_num, level ? "HIGH" : "LOW");
|
|
||||||
//
|
|
||||||
// ESP_ERROR_CHECK( esp_sleep_enable_ext1_wakeup(1ULL << io_num, level) );
|
|
||||||
// }
|
|
||||||
// rtc_gpio_isolate(GPIO_NUM_12);
|
|
||||||
// esp_deep_sleep_start();
|
|
||||||
//return 0;
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void register_setbtsource(){
|
|
||||||
|
|
||||||
// a2dp_dev_name;
|
|
||||||
// a2dp_sink_name;
|
|
||||||
// wakeup_gpio_level;
|
|
||||||
// bt_sink_pin;
|
|
||||||
// enable_bt_sink;
|
|
||||||
//
|
|
||||||
// set_btsource_args.wakeup_time =
|
|
||||||
// arg_int0("t", "time", "<t>", "Wake up time, ms");
|
|
||||||
// set_btsource_args.wakeup_gpio_num =
|
|
||||||
// arg_int0(NULL, "io", "<n>",
|
|
||||||
// "If specified, wakeup using GPIO with given number");
|
|
||||||
// set_btsource_args.wakeup_gpio_level =
|
|
||||||
// arg_int0(NULL, "io_level", "<0|1>", "GPIO level to trigger wakeup");
|
|
||||||
// set_btsource_args.end = arg_end(3);
|
|
||||||
//
|
|
||||||
// const esp_console_cmd_t cmd = {
|
|
||||||
// .command = "deep_sleep",
|
|
||||||
// .help = "Enter deep sleep mode. "
|
|
||||||
// "Two wakeup modes are supported: timer and GPIO. "
|
|
||||||
// "If no wakeup option is specified, will sleep indefinitely.",
|
|
||||||
// .hint = NULL,
|
|
||||||
// .func = &do_set_btsource,
|
|
||||||
// .argtable = &set_btsource_args
|
|
||||||
// };
|
|
||||||
// ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
|
||||||
}
|
|
||||||
|
|
||||||
static void register_free()
|
static void register_free()
|
||||||
{
|
{
|
||||||
@@ -375,7 +300,7 @@ static void register_free()
|
|||||||
static int heap_size(int argc, char **argv)
|
static int heap_size(int argc, char **argv)
|
||||||
{
|
{
|
||||||
uint32_t heap_size = heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT);
|
uint32_t heap_size = heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT);
|
||||||
log_send_messaging(MESSAGING_INFO, "min heap size: %u", heap_size);
|
cmd_send_messaging(argv[0],MESSAGING_INFO, "min heap size: %u", heap_size);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
cJSON * setdevicename_cb(){
|
cJSON * setdevicename_cb(){
|
||||||
@@ -392,12 +317,82 @@ static int setnamevar(char * nvsname, FILE *f, char * value){
|
|||||||
}
|
}
|
||||||
return err==ESP_OK?0:1;
|
return err==ESP_OK?0:1;
|
||||||
}
|
}
|
||||||
|
typedef enum {
|
||||||
|
SCANNING,
|
||||||
|
PROCESSING_NAME
|
||||||
|
} scanstate_t;
|
||||||
|
int set_squeezelite_player_name(FILE * f,const char * name){
|
||||||
|
char * nvs_config= config_alloc_get(NVS_TYPE_STR, "autoexec1");
|
||||||
|
char **argv = NULL;
|
||||||
|
esp_err_t err=ESP_OK;
|
||||||
|
int nerrors=0;
|
||||||
|
bool bFoundParm=false;
|
||||||
|
scanstate_t state=SCANNING;
|
||||||
|
char * newCommandLine = NULL;
|
||||||
|
char * parm = " -n ";
|
||||||
|
char * cleaned_name = strdup(name);
|
||||||
|
for(char * p=cleaned_name;*p!='\0';p++){
|
||||||
|
if(*p == ' '){
|
||||||
|
*p='_'; // no spaces allowed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(nvs_config && strlen(nvs_config)>0){
|
||||||
|
// allocate enough memory to hold the new command line
|
||||||
|
size_t cmdLength = strlen(nvs_config) + strlen(cleaned_name) + strlen(parm) +1 ;
|
||||||
|
newCommandLine = malloc(cmdLength);
|
||||||
|
memset(newCommandLine,0x00, cmdLength);
|
||||||
|
ESP_LOGD(TAG,"Parsing command %s",nvs_config);
|
||||||
|
argv = (char **) calloc(22, sizeof(char *));
|
||||||
|
if (argv == NULL) {
|
||||||
|
FREE_AND_NULL(nvs_config);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
size_t argc = esp_console_split_argv(nvs_config, argv,22);
|
||||||
|
for(int i=0;i<argc;i++) {
|
||||||
|
if(i>0){
|
||||||
|
strcat(newCommandLine," ");
|
||||||
|
}
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case SCANNING:
|
||||||
|
strcat(newCommandLine,argv[i]);
|
||||||
|
if(strcasecmp(argv[i],"--name")==0 || strcasecmp(argv[i],"-n")==0 ){
|
||||||
|
state = PROCESSING_NAME;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case PROCESSING_NAME:
|
||||||
|
bFoundParm=true;
|
||||||
|
strcat(newCommandLine,cleaned_name);
|
||||||
|
state = SCANNING;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!bFoundParm){
|
||||||
|
strcat(newCommandLine,parm);
|
||||||
|
strcat(newCommandLine,name);
|
||||||
|
}
|
||||||
|
fprintf(f,"Squeezelite player name changed to %s\n",newCommandLine);
|
||||||
|
if((err=config_set_value(NVS_TYPE_STR, "autoexec1",newCommandLine))!=ESP_OK){
|
||||||
|
nerrors++;
|
||||||
|
fprintf(f,"Failed updating squeezelite command. %s", esp_err_to_name(err));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
FREE_AND_NULL(nvs_config);
|
||||||
|
FREE_AND_NULL(argv);
|
||||||
|
return nerrors;
|
||||||
|
|
||||||
|
}
|
||||||
static int setdevicename(int argc, char **argv)
|
static int setdevicename(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char * name = NULL;
|
char * name = NULL;
|
||||||
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&name_args);
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&name_args);
|
||||||
if (nerrors != 0) {
|
if (nerrors != 0) {
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check "--name" option */
|
/* Check "--name" option */
|
||||||
@@ -405,32 +400,35 @@ static int setdevicename(int argc, char **argv)
|
|||||||
name=strdup(name_args.name->sval[0]);
|
name=strdup(name_args.name->sval[0]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log_send_messaging(MESSAGING_ERROR,"Name must be specified.");
|
cmd_send_messaging(argv[0],MESSAGING_ERROR,"Name must be specified.");
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
size_t buf_size = 0;
|
size_t buf_size = 0;
|
||||||
FILE *f = open_memstream(&buf, &buf_size);
|
FILE *f = open_memstream(&buf, &buf_size);
|
||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
log_send_messaging(MESSAGING_ERROR,"Unable to open memory stream.");
|
cmd_send_messaging(argv[0],MESSAGING_ERROR,"Unable to open memory stream.");
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
nerrors+=setnamevar("a2dp_dev_name", f, name);
|
nerrors+=setnamevar("a2dp_dev_name", f, name);
|
||||||
nerrors+=setnamevar("airplay_name", f, name);
|
nerrors+=setnamevar("airplay_name", f, name);
|
||||||
nerrors+=setnamevar("ap_ssid", f, name);
|
nerrors+=setnamevar("ap_ssid", f, name);
|
||||||
nerrors+=setnamevar("bt_name", f, name);
|
nerrors+=setnamevar("bt_name", f, name);
|
||||||
nerrors+=setnamevar("host_name", f, name);
|
nerrors+=setnamevar("host_name", f, name);
|
||||||
|
nerrors+=set_squeezelite_player_name(f, name);
|
||||||
if(nerrors==0){
|
if(nerrors==0){
|
||||||
fprintf(f,"Device name changed to %s\n",name);
|
fprintf(f,"Device name changed to %s\n",name);
|
||||||
}
|
}
|
||||||
|
if(!nerrors ){
|
||||||
|
fprintf(f,"Done.\n");
|
||||||
|
}
|
||||||
FREE_AND_NULL(name);
|
FREE_AND_NULL(name);
|
||||||
fflush (f);
|
fflush (f);
|
||||||
log_send_messaging(nerrors>0?MESSAGING_ERROR:MESSAGING_INFO,"%s", buf);
|
cmd_send_messaging(argv[0],nerrors>0?MESSAGING_ERROR:MESSAGING_INFO,"%s", buf);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
FREE_AND_NULL(buf);
|
FREE_AND_NULL(buf);
|
||||||
return nerrors==0;
|
return nerrors;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,7 +452,7 @@ static void register_setdevicename()
|
|||||||
name_args.name = arg_str0("n", "name", default_host_name, "New Name");
|
name_args.name = arg_str0("n", "name", default_host_name, "New Name");
|
||||||
name_args.end = arg_end(8);
|
name_args.end = arg_end(8);
|
||||||
const esp_console_cmd_t set_name= {
|
const esp_console_cmd_t set_name= {
|
||||||
.command = "setname",
|
.command = CFG_TYPE_SYST("name"),
|
||||||
.help="Device Name",
|
.help="Device Name",
|
||||||
.hint = NULL,
|
.hint = NULL,
|
||||||
.func = &setdevicename,
|
.func = &setdevicename,
|
||||||
@@ -471,16 +469,16 @@ static int tasks_info(int argc, char **argv)
|
|||||||
const size_t bytes_per_task = 40; /* see vTaskList description */
|
const size_t bytes_per_task = 40; /* see vTaskList description */
|
||||||
char *task_list_buffer = malloc(uxTaskGetNumberOfTasks() * bytes_per_task);
|
char *task_list_buffer = malloc(uxTaskGetNumberOfTasks() * bytes_per_task);
|
||||||
if (task_list_buffer == NULL) {
|
if (task_list_buffer == NULL) {
|
||||||
log_send_messaging(MESSAGING_ERROR, "failed to allocate buffer for vTaskList output");
|
cmd_send_messaging(argv[0],MESSAGING_ERROR, "failed to allocate buffer for vTaskList output");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
log_send_messaging(MESSAGING_INFO,"Task Name\tStatus\tPrio\tHWM\tTask#"
|
cmd_send_messaging(argv[0],MESSAGING_INFO,"Task Name\tStatus\tPrio\tHWM\tTask#"
|
||||||
#ifdef CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID
|
#ifdef CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID
|
||||||
"\tAffinity"
|
"\tAffinity"
|
||||||
#endif
|
#endif
|
||||||
"\n");
|
"\n");
|
||||||
vTaskList(task_list_buffer);
|
vTaskList(task_list_buffer);
|
||||||
log_send_messaging(MESSAGING_INFO,"%s", task_list_buffer);
|
cmd_send_messaging(argv[0],MESSAGING_INFO,"%s", task_list_buffer);
|
||||||
free(task_list_buffer);
|
free(task_list_buffer);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -500,7 +498,7 @@ static void register_tasks()
|
|||||||
|
|
||||||
extern esp_err_t update_certificates(bool force);
|
extern esp_err_t update_certificates(bool force);
|
||||||
static int force_update_cert(int argc, char **argv){
|
static int force_update_cert(int argc, char **argv){
|
||||||
return update_certificates(true)==ESP_OK;
|
return update_certificates(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void register_update_certs()
|
static void register_update_certs()
|
||||||
@@ -534,30 +532,31 @@ static int deep_sleep(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
if (deep_sleep_args.wakeup_time->count) {
|
if (deep_sleep_args.wakeup_time->count) {
|
||||||
uint64_t timeout = 1000ULL * deep_sleep_args.wakeup_time->ival[0];
|
uint64_t timeout = 1000ULL * deep_sleep_args.wakeup_time->ival[0];
|
||||||
log_send_messaging(MESSAGING_INFO, "Enabling timer wakeup, timeout=%lluus", timeout);
|
cmd_send_messaging(argv[0],MESSAGING_INFO, "Enabling timer wakeup, timeout=%lluus", timeout);
|
||||||
ESP_ERROR_CHECK( esp_sleep_enable_timer_wakeup(timeout) );
|
ESP_ERROR_CHECK( esp_sleep_enable_timer_wakeup(timeout) );
|
||||||
}
|
}
|
||||||
if (deep_sleep_args.wakeup_gpio_num->count) {
|
if (deep_sleep_args.wakeup_gpio_num->count) {
|
||||||
int io_num = deep_sleep_args.wakeup_gpio_num->ival[0];
|
int io_num = deep_sleep_args.wakeup_gpio_num->ival[0];
|
||||||
if (!rtc_gpio_is_valid_gpio(io_num)) {
|
if (!rtc_gpio_is_valid_gpio(io_num)) {
|
||||||
log_send_messaging(MESSAGING_ERROR, "GPIO %d is not an RTC IO", io_num);
|
cmd_send_messaging(argv[0],MESSAGING_ERROR, "GPIO %d is not an RTC IO", io_num);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int level = 0;
|
int level = 0;
|
||||||
if (deep_sleep_args.wakeup_gpio_level->count) {
|
if (deep_sleep_args.wakeup_gpio_level->count) {
|
||||||
level = deep_sleep_args.wakeup_gpio_level->ival[0];
|
level = deep_sleep_args.wakeup_gpio_level->ival[0];
|
||||||
if (level != 0 && level != 1) {
|
if (level != 0 && level != 1) {
|
||||||
log_send_messaging(MESSAGING_ERROR, "Invalid wakeup level: %d", level);
|
cmd_send_messaging(argv[0],MESSAGING_ERROR, "Invalid wakeup level: %d", level);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log_send_messaging(MESSAGING_INFO, "Enabling wakeup on GPIO%d, wakeup on %s level",
|
cmd_send_messaging(argv[0],MESSAGING_INFO, "Enabling wakeup on GPIO%d, wakeup on %s level",
|
||||||
io_num, level ? "HIGH" : "LOW");
|
io_num, level ? "HIGH" : "LOW");
|
||||||
|
|
||||||
ESP_ERROR_CHECK( esp_sleep_enable_ext1_wakeup(1ULL << io_num, level) );
|
ESP_ERROR_CHECK( esp_sleep_enable_ext1_wakeup(1ULL << io_num, level) );
|
||||||
}
|
}
|
||||||
rtc_gpio_isolate(GPIO_NUM_12);
|
rtc_gpio_isolate(GPIO_NUM_12);
|
||||||
esp_deep_sleep_start();
|
esp_deep_sleep_start();
|
||||||
|
return 0; // this code will never run. deep sleep will cause the system to restart
|
||||||
}
|
}
|
||||||
|
|
||||||
static void register_deep_sleep()
|
static void register_deep_sleep()
|
||||||
@@ -582,7 +581,190 @@ static void register_deep_sleep()
|
|||||||
};
|
};
|
||||||
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
}
|
}
|
||||||
|
static int enable_disable(FILE * f,char * nvs_name, struct arg_lit *arg){
|
||||||
|
esp_err_t err = config_set_value(NVS_TYPE_STR, nvs_name, arg->count>0?"Y":"N");
|
||||||
|
const char * name = arg->hdr.longopts?arg->hdr.longopts:arg->hdr.glossary;
|
||||||
|
|
||||||
|
if(err!=ESP_OK){
|
||||||
|
fprintf(f,"Error %s %s. %s\n",arg->count>0?"Enabling":"Disabling", name, esp_err_to_name(err));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fprintf(f,"%s %s\n",arg->count>0?"Enabled":"Disabled",name);
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
static int do_configure_wifi(int argc, char **argv){
|
||||||
|
esp_err_t err = ESP_OK;
|
||||||
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&wifi_parms_arg);
|
||||||
|
if (nerrors != 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
char *buf = NULL;
|
||||||
|
size_t buf_size = 0;
|
||||||
|
FILE *f = open_memstream(&buf, &buf_size);
|
||||||
|
if (f == NULL) {
|
||||||
|
cmd_send_messaging(argv[0],MESSAGING_ERROR,"Unable to open memory stream.");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
// disable_ps nerrors += enable_disable(f,"disable_ps",wifi_parms_arg.disable_power_save);
|
||||||
|
|
||||||
|
if(wifi_parms_arg.scanmode->count>0){
|
||||||
|
if(strcasecmp(wifi_parms_arg.scanmode->sval[0],"Comprehensive") == 0){
|
||||||
|
err = config_set_value(NVS_TYPE_STR, "wifi_smode", "A");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
err = config_set_value(NVS_TYPE_STR, "wifi_smode", "F");
|
||||||
|
}
|
||||||
|
if(err!=ESP_OK){
|
||||||
|
nerrors++;
|
||||||
|
fprintf(f,"Error setting wifi scan mode to %s. %s\n",wifi_parms_arg.scanmode->sval[0], esp_err_to_name(err));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fprintf(f,"Wifi Scan Mode changed to %s\n",wifi_parms_arg.scanmode->sval[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!nerrors ){
|
||||||
|
fprintf(f,"Done.\n");
|
||||||
|
}
|
||||||
|
fflush (f);
|
||||||
|
cmd_send_messaging(argv[0],nerrors>0?MESSAGING_ERROR:MESSAGING_INFO,"%s", buf);
|
||||||
|
fclose(f);
|
||||||
|
FREE_AND_NULL(buf);
|
||||||
|
return nerrors;
|
||||||
|
}
|
||||||
|
static int do_set_services(int argc, char **argv)
|
||||||
|
{
|
||||||
|
esp_err_t err = ESP_OK;
|
||||||
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&set_services_args);
|
||||||
|
if (nerrors != 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
char *buf = NULL;
|
||||||
|
size_t buf_size = 0;
|
||||||
|
FILE *f = open_memstream(&buf, &buf_size);
|
||||||
|
if (f == NULL) {
|
||||||
|
cmd_send_messaging(argv[0],MESSAGING_ERROR,"Unable to open memory stream.");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
nerrors += enable_disable(f,"enable_airplay",set_services_args.airplay);
|
||||||
|
nerrors += enable_disable(f,"enable_bt_sink",set_services_args.btspeaker);
|
||||||
|
|
||||||
|
if(set_services_args.telnet->count>0){
|
||||||
|
if(strcasecmp(set_services_args.telnet->sval[0],"Disabled") == 0){
|
||||||
|
err = config_set_value(NVS_TYPE_STR, "telnet_enable", "N");
|
||||||
|
}
|
||||||
|
else if(strcasecmp(set_services_args.telnet->sval[0],"Telnet Only") == 0){
|
||||||
|
err = config_set_value(NVS_TYPE_STR, "telnet_enable", "Y");
|
||||||
|
}
|
||||||
|
else if(strcasecmp(set_services_args.telnet->sval[0],"Telnet and Serial") == 0){
|
||||||
|
err = config_set_value(NVS_TYPE_STR, "telnet_enable", "D");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(err!=ESP_OK){
|
||||||
|
nerrors++;
|
||||||
|
fprintf(f,"Error setting telnet service to %s. %s\n",set_services_args.telnet->sval[0], esp_err_to_name(err));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fprintf(f,"Telnet service changed to %s\n",set_services_args.telnet->sval[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if WITH_TASKS_INFO
|
||||||
|
nerrors += enable_disable(f,"stats",set_services_args.stats);
|
||||||
|
#endif
|
||||||
|
if(!nerrors ){
|
||||||
|
fprintf(f,"Done.\n");
|
||||||
|
}
|
||||||
|
fflush (f);
|
||||||
|
cmd_send_messaging(argv[0],nerrors>0?MESSAGING_ERROR:MESSAGING_INFO,"%s", buf);
|
||||||
|
fclose(f);
|
||||||
|
FREE_AND_NULL(buf);
|
||||||
|
return nerrors;
|
||||||
|
}
|
||||||
|
|
||||||
|
cJSON * configure_wifi_cb(){
|
||||||
|
cJSON * values = cJSON_CreateObject();
|
||||||
|
char * p=NULL;
|
||||||
|
// disable_ps
|
||||||
|
// if ((p = config_alloc_get(NVS_TYPE_STR, "disable_ps")) != NULL) {
|
||||||
|
// cJSON_AddBoolToObject(values,"disable_power_save",strcmp(p,"1") == 0 || strcasecmp(p,"y") == 0);
|
||||||
|
// FREE_AND_NULL(p);
|
||||||
|
// }
|
||||||
|
if ((p = config_alloc_get(NVS_TYPE_STR, "wifi_smode")) != NULL) {
|
||||||
|
cJSON_AddStringToObject(values,"scanmode",strcasecmp(p,"a") == 0 ?"Comprehensive":"Fast");
|
||||||
|
FREE_AND_NULL(p);
|
||||||
|
}
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cJSON * set_services_cb(){
|
||||||
|
cJSON * values = cJSON_CreateObject();
|
||||||
|
char * p=NULL;
|
||||||
|
if ((p = config_alloc_get(NVS_TYPE_STR, "enable_bt_sink")) != NULL) {
|
||||||
|
cJSON_AddBoolToObject(values,"BT_Speaker",strcmp(p,"1") == 0 || strcasecmp(p,"y") == 0);
|
||||||
|
FREE_AND_NULL(p);
|
||||||
|
}
|
||||||
|
if ((p = config_alloc_get(NVS_TYPE_STR, "enable_airplay")) != NULL) {
|
||||||
|
cJSON_AddBoolToObject(values,"AirPlay",strcmp(p,"1") == 0 || strcasecmp(p,"y") == 0);
|
||||||
|
FREE_AND_NULL(p);
|
||||||
|
}
|
||||||
|
if ((p = config_alloc_get(NVS_TYPE_STR, "telnet_enable")) != NULL) {
|
||||||
|
if(strcasestr("YX",p)!=NULL){
|
||||||
|
cJSON_AddStringToObject(values,"telnet","Telnet Only");
|
||||||
|
}
|
||||||
|
else if(strcasestr("D",p)!=NULL){
|
||||||
|
cJSON_AddStringToObject(values,"telnet","Telnet and Serial");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cJSON_AddStringToObject(values,"telnet","Disabled");
|
||||||
|
}
|
||||||
|
|
||||||
|
FREE_AND_NULL(p);
|
||||||
|
}
|
||||||
|
#if WITH_TASKS_INFO
|
||||||
|
if((p = config_alloc_get_default(NVS_TYPE_STR, "stats", "n", 0))!=NULL){
|
||||||
|
cJSON_AddBoolToObject(values,"stats",(*p == '1' || *p == 'Y' || *p == 'y')) ;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void register_set_services(){
|
||||||
|
set_services_args.airplay = arg_lit0(NULL, "AirPlay", "AirPlay");
|
||||||
|
set_services_args.btspeaker = arg_lit0(NULL, "BT_Speaker", "Bluetooth Speaker");
|
||||||
|
set_services_args.telnet= arg_str0("t", "telnet","Disabled|Telnet Only|Telnet and Serial","Telnet server. Use only for troubleshooting");
|
||||||
|
#if WITH_TASKS_INFO
|
||||||
|
set_services_args.stats= arg_lit0(NULL, "stats", "System Statistics. Use only for troubleshooting");
|
||||||
|
#endif
|
||||||
|
set_services_args.end=arg_end(2);
|
||||||
|
const esp_console_cmd_t cmd = {
|
||||||
|
.command = CFG_TYPE_SYST("services"),
|
||||||
|
.help = "Services",
|
||||||
|
.argtable = &set_services_args,
|
||||||
|
.hint = NULL,
|
||||||
|
.func = &do_set_services,
|
||||||
|
};
|
||||||
|
cmd_to_json_with_cb(&cmd,&set_services_cb);
|
||||||
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
|
}
|
||||||
|
|
||||||
|
static void register_set_wifi_parms(){
|
||||||
|
wifi_parms_arg.scanmode = arg_str0(NULL, "scanmode", "Fast|Comprehensive","Sets the WiFi Scan Mode. Use Comprehensive where more than one AP has the same name on different channels. This will ensure that the AP with the strongest signal is chosen.");
|
||||||
|
//disable_ps wifi_parms_arg.disable_power_save = arg_lit0(NULL, "disable_power_save", "Disable Power Saving. This may help if the wifi connection is unstable.");
|
||||||
|
wifi_parms_arg.end=arg_end(2);
|
||||||
|
const esp_console_cmd_t cmd = {
|
||||||
|
.command = CFG_TYPE_SYST("wifi"),
|
||||||
|
.help = "WiFi",
|
||||||
|
.argtable = &wifi_parms_arg,
|
||||||
|
.hint = NULL,
|
||||||
|
.func = &do_configure_wifi,
|
||||||
|
};
|
||||||
|
cmd_to_json_with_cb(&cmd,&configure_wifi_cb);
|
||||||
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
|
}
|
||||||
/** 'light_sleep' command puts the chip into light sleep mode */
|
/** 'light_sleep' command puts the chip into light sleep mode */
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
@@ -601,22 +783,22 @@ static int light_sleep(int argc, char **argv)
|
|||||||
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
|
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
|
||||||
if (light_sleep_args.wakeup_time->count) {
|
if (light_sleep_args.wakeup_time->count) {
|
||||||
uint64_t timeout = 1000ULL * light_sleep_args.wakeup_time->ival[0];
|
uint64_t timeout = 1000ULL * light_sleep_args.wakeup_time->ival[0];
|
||||||
log_send_messaging(MESSAGING_INFO, "Enabling timer wakeup, timeout=%lluus", timeout);
|
cmd_send_messaging(argv[0],MESSAGING_INFO, "Enabling timer wakeup, timeout=%lluus", timeout);
|
||||||
ESP_ERROR_CHECK( esp_sleep_enable_timer_wakeup(timeout) );
|
ESP_ERROR_CHECK( esp_sleep_enable_timer_wakeup(timeout) );
|
||||||
}
|
}
|
||||||
int io_count = light_sleep_args.wakeup_gpio_num->count;
|
int io_count = light_sleep_args.wakeup_gpio_num->count;
|
||||||
if (io_count != light_sleep_args.wakeup_gpio_level->count) {
|
if (io_count != light_sleep_args.wakeup_gpio_level->count) {
|
||||||
log_send_messaging(MESSAGING_INFO, "Should have same number of 'io' and 'io_level' arguments");
|
cmd_send_messaging(argv[0],MESSAGING_INFO, "Should have same number of 'io' and 'io_level' arguments");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < io_count; ++i) {
|
for (int i = 0; i < io_count; ++i) {
|
||||||
int io_num = light_sleep_args.wakeup_gpio_num->ival[i];
|
int io_num = light_sleep_args.wakeup_gpio_num->ival[i];
|
||||||
int level = light_sleep_args.wakeup_gpio_level->ival[i];
|
int level = light_sleep_args.wakeup_gpio_level->ival[i];
|
||||||
if (level != 0 && level != 1) {
|
if (level != 0 && level != 1) {
|
||||||
log_send_messaging(MESSAGING_ERROR, "Invalid wakeup level: %d", level);
|
cmd_send_messaging(argv[0],MESSAGING_ERROR, "Invalid wakeup level: %d", level);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
log_send_messaging(MESSAGING_INFO, "Enabling wakeup on GPIO%d, wakeup on %s level",
|
cmd_send_messaging(argv[0],MESSAGING_INFO, "Enabling wakeup on GPIO%d, wakeup on %s level",
|
||||||
io_num, level ? "HIGH" : "LOW");
|
io_num, level ? "HIGH" : "LOW");
|
||||||
|
|
||||||
ESP_ERROR_CHECK( gpio_wakeup_enable(io_num, level ? GPIO_INTR_HIGH_LEVEL : GPIO_INTR_LOW_LEVEL) );
|
ESP_ERROR_CHECK( gpio_wakeup_enable(io_num, level ? GPIO_INTR_HIGH_LEVEL : GPIO_INTR_LOW_LEVEL) );
|
||||||
@@ -625,7 +807,7 @@ static int light_sleep(int argc, char **argv)
|
|||||||
ESP_ERROR_CHECK( esp_sleep_enable_gpio_wakeup() );
|
ESP_ERROR_CHECK( esp_sleep_enable_gpio_wakeup() );
|
||||||
}
|
}
|
||||||
if (CONFIG_ESP_CONSOLE_UART_NUM <= UART_NUM_1) {
|
if (CONFIG_ESP_CONSOLE_UART_NUM <= UART_NUM_1) {
|
||||||
log_send_messaging(MESSAGING_INFO, "Enabling UART wakeup (press ENTER to exit light sleep)");
|
cmd_send_messaging(argv[0],MESSAGING_INFO, "Enabling UART wakeup (press ENTER to exit light sleep)");
|
||||||
ESP_ERROR_CHECK( uart_set_wakeup_threshold(CONFIG_ESP_CONSOLE_UART_NUM, 3) );
|
ESP_ERROR_CHECK( uart_set_wakeup_threshold(CONFIG_ESP_CONSOLE_UART_NUM, 3) );
|
||||||
ESP_ERROR_CHECK( esp_sleep_enable_uart_wakeup(CONFIG_ESP_CONSOLE_UART_NUM) );
|
ESP_ERROR_CHECK( esp_sleep_enable_uart_wakeup(CONFIG_ESP_CONSOLE_UART_NUM) );
|
||||||
}
|
}
|
||||||
@@ -648,7 +830,7 @@ static int light_sleep(int argc, char **argv)
|
|||||||
cause_str = "unknown";
|
cause_str = "unknown";
|
||||||
printf("%d\n", cause);
|
printf("%d\n", cause);
|
||||||
}
|
}
|
||||||
log_send_messaging(MESSAGING_INFO, "Woke up from: %s", cause_str);
|
cmd_send_messaging(argv[0],MESSAGING_INFO, "Woke up from: %s", cause_str);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const char* recovery_prompt = LOG_COLOR_E "recovery-squeezelite-esp32> " LOG_RES
|
|||||||
|
|
||||||
#define MOUNT_PATH "/data"
|
#define MOUNT_PATH "/data"
|
||||||
#define HISTORY_PATH MOUNT_PATH "/history.txt"
|
#define HISTORY_PATH MOUNT_PATH "/history.txt"
|
||||||
void run_command(char * line);
|
esp_err_t run_command(char * line);
|
||||||
#define ADD_TO_JSON(o,t,n) if (t->n) cJSON_AddStringToObject(o,QUOTE(n),t->n);
|
#define ADD_TO_JSON(o,t,n) if (t->n) cJSON_AddStringToObject(o,QUOTE(n),t->n);
|
||||||
#define ADD_PARMS_TO_CMD(o,t,n) { cJSON * parms = ParmsToJSON(&t.n->hdr); if(parms) cJSON_AddItemToObject(o,QUOTE(n),parms); }
|
#define ADD_PARMS_TO_CMD(o,t,n) { cJSON * parms = ParmsToJSON(&t.n->hdr); if(parms) cJSON_AddItemToObject(o,QUOTE(n),parms); }
|
||||||
cJSON * cmdList;
|
cJSON * cmdList;
|
||||||
@@ -99,6 +99,8 @@ cJSON * ParmsToJSON(struct arg_hdr * * argtable){
|
|||||||
ADD_TO_JSON(entry,table[tabindex],shortopts);
|
ADD_TO_JSON(entry,table[tabindex],shortopts);
|
||||||
cJSON_AddBoolToObject(entry, "checkbox", (table[tabindex]->flag & ARG_HASOPTVALUE)==0 && (table[tabindex]->flag & ARG_HASVALUE)==0);
|
cJSON_AddBoolToObject(entry, "checkbox", (table[tabindex]->flag & ARG_HASOPTVALUE)==0 && (table[tabindex]->flag & ARG_HASVALUE)==0);
|
||||||
cJSON_AddBoolToObject(entry, "hasvalue", table[tabindex]->flag & ARG_HASVALUE);
|
cJSON_AddBoolToObject(entry, "hasvalue", table[tabindex]->flag & ARG_HASVALUE);
|
||||||
|
cJSON_AddNumberToObject(entry,"mincount",table[tabindex]->mincount);
|
||||||
|
cJSON_AddNumberToObject(entry,"maxcount",table[tabindex]->maxcount);
|
||||||
cJSON_AddItemToArray(arg_list, entry);
|
cJSON_AddItemToArray(arg_list, entry);
|
||||||
tabindex++;
|
tabindex++;
|
||||||
}
|
}
|
||||||
@@ -171,7 +173,7 @@ int arg_parse_msg(int argc, char **argv, struct arg_hdr ** args){
|
|||||||
if (f != NULL) {
|
if (f != NULL) {
|
||||||
arg_print_errors(f, getParmsEnd(args), argv[0]);
|
arg_print_errors(f, getParmsEnd(args), argv[0]);
|
||||||
fflush (f);
|
fflush (f);
|
||||||
log_send_messaging(MESSAGING_ERROR,"%s", buf);
|
cmd_send_messaging(argv[0],MESSAGING_ERROR,"%s", buf);
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
FREE_AND_NULL(buf);
|
FREE_AND_NULL(buf);
|
||||||
@@ -254,7 +256,7 @@ void initialize_console() {
|
|||||||
esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM);
|
esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM);
|
||||||
|
|
||||||
/* Initialize the console */
|
/* Initialize the console */
|
||||||
esp_console_config_t console_config = { .max_cmdline_args = 22,
|
esp_console_config_t console_config = { .max_cmdline_args = 28,
|
||||||
.max_cmdline_length = 600,
|
.max_cmdline_length = 600,
|
||||||
#if CONFIG_LOG_COLORS
|
#if CONFIG_LOG_COLORS
|
||||||
.hint_color = atoi(LOG_COLOR_CYAN)
|
.hint_color = atoi(LOG_COLOR_CYAN)
|
||||||
@@ -285,7 +287,7 @@ void console_start() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Initialize the console */
|
/* Initialize the console */
|
||||||
esp_console_config_t console_config = { .max_cmdline_args = 22,
|
esp_console_config_t console_config = { .max_cmdline_args = 28,
|
||||||
.max_cmdline_length = 600,
|
.max_cmdline_length = 600,
|
||||||
#if CONFIG_LOG_COLORS
|
#if CONFIG_LOG_COLORS
|
||||||
.hint_color = atoi(LOG_COLOR_CYAN)
|
.hint_color = atoi(LOG_COLOR_CYAN)
|
||||||
@@ -296,8 +298,10 @@ void console_start() {
|
|||||||
/* Register commands */
|
/* Register commands */
|
||||||
esp_console_register_help_command();
|
esp_console_register_help_command();
|
||||||
register_system();
|
register_system();
|
||||||
|
register_config_cmd();
|
||||||
register_nvs();
|
register_nvs();
|
||||||
register_wifi();
|
register_wifi();
|
||||||
|
|
||||||
if(!is_recovery_running){
|
if(!is_recovery_running){
|
||||||
register_squeezelite();
|
register_squeezelite();
|
||||||
}
|
}
|
||||||
@@ -364,7 +368,7 @@ void console_start() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
void run_command(char * line){
|
esp_err_t run_command(char * line){
|
||||||
/* Try to run the command */
|
/* Try to run the command */
|
||||||
int ret;
|
int ret;
|
||||||
esp_err_t err = esp_console_run(line, &ret);
|
esp_err_t err = esp_console_run(line, &ret);
|
||||||
@@ -373,13 +377,16 @@ void run_command(char * line){
|
|||||||
ESP_LOGE(TAG,"Unrecognized command: %s", line);
|
ESP_LOGE(TAG,"Unrecognized command: %s", line);
|
||||||
} else if (err == ESP_ERR_INVALID_ARG) {
|
} else if (err == ESP_ERR_INVALID_ARG) {
|
||||||
// command was empty
|
// command was empty
|
||||||
} else if (err == ESP_OK && ret != ESP_OK) {
|
} else if (err != ESP_OK && ret != ESP_OK) {
|
||||||
ESP_LOGW(TAG,"Command returned non-zero error code: 0x%x (%s)", ret,
|
ESP_LOGW(TAG,"Command returned non-zero error code: 0x%x (%s)", ret,
|
||||||
esp_err_to_name(err));
|
esp_err_to_name(err));
|
||||||
|
} else if (err == ESP_OK && ret != ESP_OK) {
|
||||||
|
ESP_LOGW(TAG,"Command returned in error");
|
||||||
|
err = ESP_FAIL;
|
||||||
} else if (err != ESP_OK) {
|
} else if (err != ESP_OK) {
|
||||||
ESP_LOGE(TAG,"Internal error: %s", esp_err_to_name(err));
|
ESP_LOGE(TAG,"Internal error: %s", esp_err_to_name(err));
|
||||||
}
|
}
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
static void * console_thread() {
|
static void * console_thread() {
|
||||||
if(!is_recovery_running){
|
if(!is_recovery_running){
|
||||||
|
|||||||
@@ -13,6 +13,11 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
#define CFG_TYPE_HW(a) "cfg-hw-" a
|
||||||
|
#define CFG_TYPE_AUDIO(a) "cfg-audio-" a
|
||||||
|
#define CFG_TYPE_SYST(a) "cfg-syst-" a
|
||||||
|
#define CFG_TYPE_FW(a) "cfg-fw-" a
|
||||||
|
#define CFG_TYPE_GEN(a) "cfg-gen-" a
|
||||||
typedef cJSON * parm_values_fn_t(void);
|
typedef cJSON * parm_values_fn_t(void);
|
||||||
esp_err_t cmd_to_json(const esp_console_cmd_t *cmd);
|
esp_err_t cmd_to_json(const esp_console_cmd_t *cmd);
|
||||||
esp_err_t cmd_to_json_with_cb(const esp_console_cmd_t *cmd, parm_values_fn_t parm_values_fn);
|
esp_err_t cmd_to_json_with_cb(const esp_console_cmd_t *cmd, parm_values_fn_t parm_values_fn);
|
||||||
|
|||||||
3
components/platform_console/test/CMakeLists.txt
Normal file
3
components/platform_console/test/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
idf_component_register(SRCS "test_system.c"
|
||||||
|
INCLUDE_DIRS "."
|
||||||
|
REQUIRES unity tools console json platform_console platform_config )
|
||||||
189
components/platform_console/test/test_system.c
Normal file
189
components/platform_console/test/test_system.c
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
/* test_mean.c: Implementation of a testable component.
|
||||||
|
|
||||||
|
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, this
|
||||||
|
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||||
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
#include "unity.h"
|
||||||
|
#include "platform_console.h"
|
||||||
|
#include "platform_esp32.h"
|
||||||
|
#include "platform_config.h"
|
||||||
|
#include "string.h"
|
||||||
|
struct arg_lit *arglit;
|
||||||
|
struct arg_int *argint;
|
||||||
|
struct arg_str *argstr;
|
||||||
|
struct arg_end *end;
|
||||||
|
|
||||||
|
extern int is_output_gpio(struct arg_int * gpio, FILE * f, int * gpio_out, bool mandatory);
|
||||||
|
extern void initialize_console();
|
||||||
|
extern esp_err_t run_command(char * line);
|
||||||
|
static char *buf = NULL;
|
||||||
|
static char * s_tmp_line_buf=NULL;
|
||||||
|
static size_t buf_size = 0;
|
||||||
|
static FILE * f;
|
||||||
|
static size_t argc=1;
|
||||||
|
static char ** argv=NULL;
|
||||||
|
static bool config_initialized=false;
|
||||||
|
void init_console(){
|
||||||
|
if(config_initialized) return;
|
||||||
|
initialize_console();
|
||||||
|
config_initialized=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void open_mem_stream_file(){
|
||||||
|
f = open_memstream(&buf, &buf_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void close_flush_all(void * argtable, int count,bool print){
|
||||||
|
fflush (f);
|
||||||
|
if(print){
|
||||||
|
printf("%s", buf);
|
||||||
|
}
|
||||||
|
fclose(f);
|
||||||
|
free(buf);
|
||||||
|
arg_freetable(argtable,count);
|
||||||
|
free(argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int alloc_split_command_line(char * cmdline){
|
||||||
|
argv = (char **) calloc(22, sizeof(char *));
|
||||||
|
if(!s_tmp_line_buf){
|
||||||
|
s_tmp_line_buf= calloc(strlen(cmdline), 1);
|
||||||
|
}
|
||||||
|
strlcpy(s_tmp_line_buf, cmdline, 22);
|
||||||
|
argc = esp_console_split_argv(s_tmp_line_buf, argv,22);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int alloc_split_parse_command_line(char * cmdline, void ** args){
|
||||||
|
alloc_split_command_line(cmdline);
|
||||||
|
return arg_parse(argc, argv,args);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
TEST_CASE("Invalid GPIO detected", "[config][ui]")
|
||||||
|
{
|
||||||
|
char * cmdline = "test -i 55\n";
|
||||||
|
void *argtable[] = {
|
||||||
|
argint = arg_int1("i","int","<gpio>","GPIO number"),
|
||||||
|
end = arg_end(6)
|
||||||
|
};
|
||||||
|
open_mem_stream_file();
|
||||||
|
alloc_split_parse_command_line(cmdline, &argtable);
|
||||||
|
int out_val = 0;
|
||||||
|
TEST_ASSERT_EQUAL_INT_MESSAGE(1,is_output_gpio(argtable[0], f, &out_val, true),"Invalid GPIO not detected");
|
||||||
|
TEST_ASSERT_EQUAL_INT_MESSAGE(-1,out_val,"GPIO Should be set to -1");
|
||||||
|
fflush (f);
|
||||||
|
TEST_ASSERT_EQUAL_STRING_MESSAGE("Invalid int gpio: [55] is not a GPIO\n",buf,"Invalid GPIO message wrong");
|
||||||
|
close_flush_all(argtable,sizeof(argtable)/sizeof(argtable[0]),false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
TEST_CASE("Input Only GPIO detected", "[config][ui]")
|
||||||
|
{
|
||||||
|
char * cmdline = "test -i 35\n";
|
||||||
|
void *argtable[] = {
|
||||||
|
argint = arg_int1("i","int","<gpio>","GPIO number"),
|
||||||
|
end = arg_end(6)
|
||||||
|
};
|
||||||
|
open_mem_stream_file();
|
||||||
|
alloc_split_parse_command_line(cmdline, &argtable);
|
||||||
|
int out_val = 0;
|
||||||
|
TEST_ASSERT_EQUAL_INT_MESSAGE(1,is_output_gpio(argtable[0], f, &out_val, true),"Input only GPIO not detected");
|
||||||
|
TEST_ASSERT_EQUAL_INT_MESSAGE(-1,out_val,"GPIO Should be set to -1");
|
||||||
|
fflush (f);
|
||||||
|
TEST_ASSERT_EQUAL_STRING_MESSAGE("Invalid int gpio: [35] has input capabilities only\n",buf,"Missing GPIO message wrong");
|
||||||
|
close_flush_all(argtable,sizeof(argtable)/sizeof(argtable[0]),false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
TEST_CASE("Valid GPIO Processed", "[config][ui]")
|
||||||
|
{
|
||||||
|
char * cmdline = "test -i 33\n";
|
||||||
|
void *argtable[] = {
|
||||||
|
argint = arg_int1("i","int","<gpio>","GPIO number"),
|
||||||
|
end = arg_end(6)
|
||||||
|
};
|
||||||
|
open_mem_stream_file();
|
||||||
|
alloc_split_parse_command_line(cmdline, &argtable);
|
||||||
|
int out_val = 0;
|
||||||
|
TEST_ASSERT_EQUAL_INT_MESSAGE(0,is_output_gpio(argtable[0], f, &out_val, true),"Valid GPIO not recognized");
|
||||||
|
TEST_ASSERT_EQUAL_INT_MESSAGE(33,out_val,"GPIO Should be set to 33");
|
||||||
|
fflush (f);
|
||||||
|
TEST_ASSERT_EQUAL_STRING_MESSAGE("",buf,"Valid GPIO shouldn't produce a message");
|
||||||
|
close_flush_all(argtable,sizeof(argtable)/sizeof(argtable[0]),false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
TEST_CASE("Missing mandatory GPIO detected", "[config][ui]")
|
||||||
|
{
|
||||||
|
char * cmdline = "test \n";
|
||||||
|
void *argtable[] = {
|
||||||
|
argint = arg_int1("i","int","<gpio>","GPIO number"),
|
||||||
|
end = arg_end(6)
|
||||||
|
};
|
||||||
|
open_mem_stream_file();
|
||||||
|
alloc_split_parse_command_line(cmdline, &argtable);
|
||||||
|
int out_val = 0;
|
||||||
|
TEST_ASSERT_EQUAL_INT_MESSAGE(1,is_output_gpio(argtable[0], f, &out_val, true),"Missing GPIO not detected");
|
||||||
|
fflush (f);
|
||||||
|
TEST_ASSERT_EQUAL_STRING_MESSAGE("Missing: int\n",buf,"Missing GPIO parameter message wrong");
|
||||||
|
TEST_ASSERT_EQUAL_INT_MESSAGE(-1,out_val,"GPIO Should be set to -1");
|
||||||
|
close_flush_all(argtable,sizeof(argtable)/sizeof(argtable[0]),false);
|
||||||
|
}
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
TEST_CASE("Missing mandatory parameter detected", "[config][ui]")
|
||||||
|
{
|
||||||
|
char * cmdline = "test \n";
|
||||||
|
void *argtable[] = {
|
||||||
|
argint = arg_int1("i","int","<gpio>","GPIO number"),
|
||||||
|
end = arg_end(6)
|
||||||
|
};
|
||||||
|
open_mem_stream_file();
|
||||||
|
alloc_split_parse_command_line(cmdline, &argtable);
|
||||||
|
int out_val = 0;
|
||||||
|
TEST_ASSERT_EQUAL_INT_MESSAGE(1,is_output_gpio(argtable[0], f, &out_val, true),"Missing parameter not detected");
|
||||||
|
fflush (f);
|
||||||
|
TEST_ASSERT_EQUAL_STRING_MESSAGE("Missing: int\n",buf,"Missing parameter message wrong");
|
||||||
|
TEST_ASSERT_EQUAL_INT_MESSAGE(-1,out_val,"GPIO Should be set to -1");
|
||||||
|
close_flush_all(argtable,sizeof(argtable)/sizeof(argtable[0]),false);
|
||||||
|
}
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
TEST_CASE("dac config command", "[config_cmd]")
|
||||||
|
{
|
||||||
|
config_set_value(NVS_TYPE_STR, "dac_config", "");
|
||||||
|
esp_err_t err=run_command("cfg-hw-dac\n");
|
||||||
|
char * nvs_value = config_alloc_get_str("dac_config", NULL,NULL);
|
||||||
|
TEST_ASSERT_NOT_NULL(nvs_value);
|
||||||
|
TEST_ASSERT_EQUAL_MESSAGE(ESP_OK,err,"Running command failed");
|
||||||
|
free(nvs_value);
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
idf_component_register(SRC_DIRS .
|
idf_component_register(SRC_DIRS .
|
||||||
INCLUDE_DIRS . ${IDF_PATH}/components/driver
|
INCLUDE_DIRS . ${IDF_PATH}/components/driver
|
||||||
REQUIRES json tools platform_config display
|
REQUIRES json tools platform_config display
|
||||||
|
PRIV_REQUIRES soc esp32 squeezelite
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,24 @@
|
|||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "stdbool.h"
|
#include "stdbool.h"
|
||||||
#include "driver/adc.h"
|
#include "driver/adc.h"
|
||||||
|
#include "esp_attr.h"
|
||||||
|
#include "soc/spi_periph.h"
|
||||||
|
#include "esp_err.h"
|
||||||
|
#include "soc/rtc.h"
|
||||||
|
#include "sdkconfig.h"
|
||||||
|
#include "soc/efuse_periph.h"
|
||||||
|
#include "driver/gpio.h"
|
||||||
|
#include "driver/spi_common_internal.h"
|
||||||
|
#include "esp32/rom/efuse.h"
|
||||||
|
#include "adac.h"
|
||||||
|
#include "trace.h"
|
||||||
|
#include "monitor.h"
|
||||||
|
#include "messaging.h"
|
||||||
|
|
||||||
|
|
||||||
static const char *TAG = "services";
|
static const char *TAG = "services";
|
||||||
static const char *i2c_name="I2C";
|
const char *i2c_name_type="I2C";
|
||||||
static const char *spi_name="SPI";
|
const char *spi_name_type="SPI";
|
||||||
static cJSON * gpio_list=NULL;
|
static cJSON * gpio_list=NULL;
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
#ifndef QUOTE
|
#ifndef QUOTE
|
||||||
@@ -33,40 +47,290 @@ static cJSON * gpio_list=NULL;
|
|||||||
#define STR(macro) QUOTE(macro)
|
#define STR(macro) QUOTE(macro)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool are_statistics_enabled(){
|
||||||
|
#if defined(CONFIG_FREERTOS_USE_TRACE_FACILITY) && defined (CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS)
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static char * config_spdif_get_string(){
|
||||||
|
return config_alloc_get_str("spdif_config", CONFIG_SPDIF_CONFIG, "bck=" STR(CONFIG_SPDIF_BCK_IO)
|
||||||
|
",ws=" STR(CONFIG_SPDIF_WS_IO) ",do=" STR(CONFIG_SPDIF_DO_IO));
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static char * get_dac_config_string(){
|
||||||
|
return config_alloc_get_str("dac_config", CONFIG_DAC_CONFIG, "model=i2s,bck=" STR(CONFIG_I2S_BCK_IO)
|
||||||
|
",ws=" STR(CONFIG_I2S_WS_IO) ",do=" STR(CONFIG_I2S_DO_IO)
|
||||||
|
",sda=" STR(CONFIG_I2C_SDA) ",scl=" STR(CONFIG_I2C_SCL)
|
||||||
|
",mute=" STR(CONFIG_MUTE_GPIO));
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool is_dac_config_locked(){
|
||||||
|
#if ( defined CONFIG_DAC_CONFIG )
|
||||||
|
if(strlen(CONFIG_DAC_CONFIG) > 0){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(CONFIG_I2S_BCK_IO) && CONFIG_I2S_BCK_IO>0
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool is_spdif_config_locked(){
|
||||||
|
#if ( defined CONFIG_SPDIF_CONFIG )
|
||||||
|
if(strlen(CONFIG_SPDIF_CONFIG) > 0){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(CONFIG_SPDIF_BCK_IO) && CONFIG_SPDIF_BCK_IO>0
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
* Set pin from config string
|
||||||
|
*/
|
||||||
|
static void set_i2s_pin(char *config, i2s_pin_config_t *pin_config) {
|
||||||
|
char *p;
|
||||||
|
pin_config->bck_io_num = pin_config->ws_io_num = pin_config->data_out_num = pin_config->data_in_num = -1;
|
||||||
|
if ((p = strcasestr(config, "bck")) != NULL) pin_config->bck_io_num = atoi(strchr(p, '=') + 1);
|
||||||
|
if ((p = strcasestr(config, "ws")) != NULL) pin_config->ws_io_num = atoi(strchr(p, '=') + 1);
|
||||||
|
if ((p = strcasestr(config, "do")) != NULL) pin_config->data_out_num = atoi(strchr(p, '=') + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
* Get i2s config structure from config string
|
||||||
|
*/
|
||||||
|
const i2s_platform_config_t * config_get_i2s_from_str(char * dac_config ){
|
||||||
|
static i2s_platform_config_t i2s_dac_pin = {
|
||||||
|
.i2c_addr = -1,
|
||||||
|
.sda= -1,
|
||||||
|
.scl = -1,
|
||||||
|
.mute_gpio = -1,
|
||||||
|
.mute_level = -1
|
||||||
|
};
|
||||||
|
set_i2s_pin(dac_config, &i2s_dac_pin.pin);
|
||||||
|
strcpy(i2s_dac_pin.model, "i2s");
|
||||||
|
char * p=NULL;
|
||||||
|
|
||||||
|
if ((p = strcasestr(dac_config, "i2c")) != NULL) i2s_dac_pin.i2c_addr = atoi(strchr(p, '=') + 1);
|
||||||
|
if ((p = strcasestr(dac_config, "sda")) != NULL) i2s_dac_pin.sda = atoi(strchr(p, '=') + 1);
|
||||||
|
if ((p = strcasestr(dac_config, "scl")) != NULL) i2s_dac_pin.scl = atoi(strchr(p, '=') + 1);
|
||||||
|
if ((p = strcasestr(dac_config, "model")) != NULL) sscanf(p, "%*[^=]=%31[^,]", i2s_dac_pin.model);
|
||||||
|
if ((p = strcasestr(dac_config, "mute")) != NULL) {
|
||||||
|
char mute[8] = "";
|
||||||
|
sscanf(p, "%*[^=]=%7[^,]", mute);
|
||||||
|
i2s_dac_pin.mute_gpio = atoi(mute);
|
||||||
|
if ((p = strchr(mute, ':')) != NULL) i2s_dac_pin.mute_level = atoi(p + 1);
|
||||||
|
}
|
||||||
|
return &i2s_dac_pin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
* Get spdif config structure
|
||||||
|
*/
|
||||||
|
const i2s_platform_config_t * config_spdif_get( ){
|
||||||
|
char * spdif_config = config_spdif_get_string();
|
||||||
|
static i2s_platform_config_t i2s_dac_config;
|
||||||
|
memcpy(&i2s_dac_config, config_get_i2s_from_str(spdif_config), sizeof(i2s_dac_config));
|
||||||
|
free(spdif_config);
|
||||||
|
return &i2s_dac_config;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
* Get dac config structure
|
||||||
|
*/
|
||||||
|
const i2s_platform_config_t * config_dac_get(){
|
||||||
|
char * spdif_config = get_dac_config_string();
|
||||||
|
static i2s_platform_config_t i2s_dac_config;
|
||||||
|
memcpy(&i2s_dac_config, config_get_i2s_from_str(spdif_config), sizeof(i2s_dac_config));
|
||||||
|
free(spdif_config);
|
||||||
|
return &i2s_dac_config;
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
esp_err_t config_i2c_set(const i2c_config_t * config, int port){
|
esp_err_t config_i2c_set(const i2c_config_t * config, int port){
|
||||||
int buffer_size=255;
|
int buffer_size=255;
|
||||||
|
esp_err_t err=ESP_OK;
|
||||||
char * config_buffer=calloc(buffer_size,1);
|
char * config_buffer=calloc(buffer_size,1);
|
||||||
if(config_buffer) {
|
if(config_buffer) {
|
||||||
snprintf(config_buffer,buffer_size,"scl=%u sda=%u speed=%u port=%u",config->scl_io_num,config->sda_io_num,config->master.clk_speed,port);
|
snprintf(config_buffer,buffer_size,"scl=%u,sda=%u,speed=%u,port=%u",config->scl_io_num,config->sda_io_num,config->master.clk_speed,port);
|
||||||
ESP_LOGI(TAG,"Updating i2c configuration to %s",config_buffer);
|
log_send_messaging(MESSAGING_INFO,"Updating I2C configuration to %s",config_buffer);
|
||||||
config_set_value(NVS_TYPE_STR, "i2c_config", config_buffer);
|
err = config_set_value(NVS_TYPE_STR, "i2c_config", config_buffer);
|
||||||
|
if(err!=ESP_OK){
|
||||||
|
log_send_messaging(MESSAGING_ERROR,"Error: %s",esp_err_to_name(err));
|
||||||
|
}
|
||||||
free(config_buffer);
|
free(config_buffer);
|
||||||
}
|
}
|
||||||
return ESP_OK;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t config_display_set(const display_config_t * config){
|
||||||
|
int buffer_size=512;
|
||||||
|
esp_err_t err=ESP_OK;
|
||||||
|
char * config_buffer=calloc(buffer_size,1);
|
||||||
|
char * config_buffer2=calloc(buffer_size,1);
|
||||||
|
if(config_buffer && config_buffer2) {
|
||||||
|
snprintf(config_buffer,buffer_size,"%s:width=%i,height=%i",config->type,config->width,config->height);
|
||||||
|
if(strcasecmp("I2C",config->type)==0){
|
||||||
|
if(config->address>0 ){
|
||||||
|
snprintf(config_buffer2,buffer_size,"%s,address=%i",config_buffer,config->address);
|
||||||
|
strcpy(config_buffer,config_buffer2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(config->CS_pin >=0 ){
|
||||||
|
snprintf(config_buffer2,buffer_size,"%s,cs=%i",config_buffer,config->CS_pin);
|
||||||
|
strcpy(config_buffer,config_buffer2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(config->RST_pin >=0 ){
|
||||||
|
snprintf(config_buffer2,buffer_size,"%s,reset=%i",config_buffer,config->RST_pin);
|
||||||
|
strcpy(config_buffer,config_buffer2);
|
||||||
|
}
|
||||||
|
// I2C,width=<pixels>,height=<pixels>[address=<i2c_address>][,reset=<gpio>][,HFlip][,VFlip][driver=SSD1306|SSD1326[:1|4]|SSD1327|SH1106]
|
||||||
|
// SPI,width=<pixels>,height=<pixels>,cs=<gpio>[,back=<gpio>][,reset=<gpio>][,speed=<speed>][,HFlip][,VFlip][driver=SSD1306|SSD1322|SSD1326[:1|4]|SSD1327|SH1106|SSD1675|ST7735|ST7789[,rotate]]
|
||||||
|
if(config->back >=0 ){
|
||||||
|
snprintf(config_buffer2,buffer_size,"%s,back=%i",config_buffer,config->back);
|
||||||
|
strcpy(config_buffer,config_buffer2);
|
||||||
|
}
|
||||||
|
if(config->speed >0 && strcasecmp("SPI",config->type)==0){
|
||||||
|
snprintf(config_buffer2,buffer_size,"%s,speed=%i",config_buffer,config->speed);
|
||||||
|
strcpy(config_buffer,config_buffer2);
|
||||||
|
}
|
||||||
|
snprintf(config_buffer2,buffer_size,"%s,driver=%s%s%s%s",config_buffer,config->drivername,config->hflip?",HFlip":"",config->vflip?",VFlip":"",config->rotate?",rotate":"");
|
||||||
|
strcpy(config_buffer,config_buffer2);
|
||||||
|
log_send_messaging(MESSAGING_INFO,"Updating display configuration to %s",config_buffer);
|
||||||
|
err = config_set_value(NVS_TYPE_STR, "display_config", config_buffer);
|
||||||
|
if(err!=ESP_OK){
|
||||||
|
log_send_messaging(MESSAGING_ERROR,"Error: %s",esp_err_to_name(err));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
err = ESP_ERR_NO_MEM;
|
||||||
|
}
|
||||||
|
FREE_AND_NULL(config_buffer);
|
||||||
|
FREE_AND_NULL(config_buffer2);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t config_i2s_set(const i2s_platform_config_t * config, const char * nvs_name){
|
||||||
|
int buffer_size=255;
|
||||||
|
esp_err_t err=ESP_OK;
|
||||||
|
char * config_buffer=calloc(buffer_size,1);
|
||||||
|
char * config_buffer2=calloc(buffer_size,1);
|
||||||
|
if(config_buffer && config_buffer2) {
|
||||||
|
snprintf(config_buffer,buffer_size,"model=%s,bck=%u,ws=%u,do=%u",config->model,config->pin.bck_io_num,config->pin.ws_io_num,config->pin.data_out_num);
|
||||||
|
if(config->mute_gpio>=0){
|
||||||
|
snprintf(config_buffer2,buffer_size,"%s,mute=%u:%u",config_buffer,config->mute_gpio,config->mute_level);
|
||||||
|
strcpy(config_buffer,config_buffer2);
|
||||||
|
}
|
||||||
|
if(config->sda>=0){
|
||||||
|
snprintf(config_buffer2,buffer_size,"%s,sda=%u,scl=%u",config_buffer,config->sda,config->scl);
|
||||||
|
strcpy(config_buffer,config_buffer2);
|
||||||
|
}
|
||||||
|
if(config->i2c_addr>0){
|
||||||
|
snprintf(config_buffer2,buffer_size,"%s,i2c=%u",config_buffer,config->i2c_addr);
|
||||||
|
strcpy(config_buffer,config_buffer2);
|
||||||
|
}
|
||||||
|
log_send_messaging(MESSAGING_INFO,"Updating dac configuration to %s",config_buffer);
|
||||||
|
err = config_set_value(NVS_TYPE_STR, nvs_name, config_buffer);
|
||||||
|
if(err!=ESP_OK){
|
||||||
|
log_send_messaging(MESSAGING_ERROR,"Error: %s",esp_err_to_name(err));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
err = ESP_ERR_NO_MEM;
|
||||||
|
}
|
||||||
|
FREE_AND_NULL(config_buffer);
|
||||||
|
FREE_AND_NULL(config_buffer2);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t config_spdif_set(const i2s_platform_config_t * config){
|
||||||
|
int buffer_size=255;
|
||||||
|
esp_err_t err=ESP_OK;
|
||||||
|
char * config_buffer=calloc(buffer_size,1);
|
||||||
|
if(config_buffer ) {
|
||||||
|
snprintf(config_buffer,buffer_size,"bck=%u,ws=%u,do=%u",config->pin.bck_io_num,config->pin.ws_io_num,config->pin.data_out_num);
|
||||||
|
log_send_messaging(MESSAGING_INFO,"Updating SPDIF configuration to %s",config_buffer);
|
||||||
|
err = config_set_value(NVS_TYPE_STR, "spdif_config", config_buffer);
|
||||||
|
if(err!=ESP_OK){
|
||||||
|
log_send_messaging(MESSAGING_ERROR,"Error: %s",esp_err_to_name(err));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
err = ESP_ERR_NO_MEM;
|
||||||
|
}
|
||||||
|
FREE_AND_NULL(config_buffer);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
esp_err_t config_spi_set(const spi_bus_config_t * config, int host, int dc){
|
esp_err_t config_spi_set(const spi_bus_config_t * config, int host, int dc){
|
||||||
int buffer_size=255;
|
int buffer_size=255;
|
||||||
|
esp_err_t err = ESP_OK;
|
||||||
char * config_buffer=calloc(buffer_size,1);
|
char * config_buffer=calloc(buffer_size,1);
|
||||||
if(config_buffer) {
|
if(config_buffer) {
|
||||||
snprintf(config_buffer,buffer_size,"data=%u,clk=%u,dc=%u,host=%u",config->mosi_io_num,config->sclk_io_num,dc,host);
|
snprintf(config_buffer,buffer_size,"data=%u,clk=%u,dc=%u,host=%u",config->mosi_io_num,config->sclk_io_num,dc,host);
|
||||||
ESP_LOGI(TAG,"Updating SPI configuration to %s",config_buffer);
|
log_send_messaging(MESSAGING_INFO,"Updating SPI configuration to %s",config_buffer);
|
||||||
config_set_value(NVS_TYPE_STR, "spi_config", config_buffer);
|
err = config_set_value(NVS_TYPE_STR, "spi_config", config_buffer);
|
||||||
|
if(err!=ESP_OK){
|
||||||
|
log_send_messaging(MESSAGING_ERROR,"Error: %s",esp_err_to_name(err));
|
||||||
|
}
|
||||||
free(config_buffer);
|
free(config_buffer);
|
||||||
}
|
}
|
||||||
return ESP_OK;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const display_config_t * config_display_get(){
|
const display_config_t * config_display_get(){
|
||||||
static display_config_t dstruct;
|
static display_config_t dstruct = {
|
||||||
|
.back = -1,
|
||||||
|
.CS_pin = -1,
|
||||||
|
.RST_pin = -1,
|
||||||
|
.depth = -1,
|
||||||
|
.address = 0,
|
||||||
|
.drivername = NULL,
|
||||||
|
.height = 0,
|
||||||
|
.width = 0,
|
||||||
|
.vflip = false,
|
||||||
|
.hflip = false,
|
||||||
|
.type = NULL,
|
||||||
|
.speed = 0,
|
||||||
|
.rotate = false
|
||||||
|
};
|
||||||
char *config = config_alloc_get(NVS_TYPE_STR, "display_config");
|
char *config = config_alloc_get(NVS_TYPE_STR, "display_config");
|
||||||
if (!config) {
|
if (!config) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -75,19 +339,19 @@ const display_config_t * config_display_get(){
|
|||||||
char * p=NULL;
|
char * p=NULL;
|
||||||
|
|
||||||
if ((p = strcasestr(config, "driver")) != NULL){
|
if ((p = strcasestr(config, "driver")) != NULL){
|
||||||
|
sscanf(p, "%*[^:]:%u", &dstruct.depth);
|
||||||
dstruct.drivername = display_conf_get_driver_name(strchr(p, '=') + 1);
|
dstruct.drivername = display_conf_get_driver_name(strchr(p, '=') + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
dstruct.drivername=dstruct.drivername?dstruct.drivername:"SSD1306";
|
|
||||||
if ((p = strcasestr(config, "width")) != NULL) dstruct.width = atoi(strchr(p, '=') + 1);
|
if ((p = strcasestr(config, "width")) != NULL) dstruct.width = atoi(strchr(p, '=') + 1);
|
||||||
if ((p = strcasestr(config, "height")) != NULL) dstruct.height = atoi(strchr(p, '=') + 1);
|
if ((p = strcasestr(config, "height")) != NULL) dstruct.height = atoi(strchr(p, '=') + 1);
|
||||||
if ((p = strcasestr(config, "reset")) != NULL) dstruct.RST_pin = atoi(strchr(p, '=') + 1);
|
if ((p = strcasestr(config, "reset")) != NULL) dstruct.RST_pin = atoi(strchr(p, '=') + 1);
|
||||||
dstruct.i2c_system_port=i2c_system_port;
|
if (strstr(config, "I2C") ) dstruct.type=i2c_name_type;
|
||||||
if (strstr(config, "I2C") ) dstruct.type=i2c_name;
|
|
||||||
if ((p = strcasestr(config, "address")) != NULL) dstruct.address = atoi(strchr(p, '=') + 1);
|
if ((p = strcasestr(config, "address")) != NULL) dstruct.address = atoi(strchr(p, '=') + 1);
|
||||||
if (strstr(config, "SPI") ) dstruct.type=spi_name;
|
if (strstr(config, "SPI") ) dstruct.type=spi_name_type;
|
||||||
if ((p = strcasestr(config, "cs")) != NULL) dstruct.CS_pin = atoi(strchr(p, '=') + 1);
|
if ((p = strcasestr(config, "cs")) != NULL) dstruct.CS_pin = atoi(strchr(p, '=') + 1);
|
||||||
if ((p = strcasestr(config, "speed")) != NULL) dstruct.speed = atoi(strchr(p, '=') + 1);
|
if ((p = strcasestr(config, "speed")) != NULL) dstruct.speed = atoi(strchr(p, '=') + 1);
|
||||||
|
if ((p = strcasestr(config, "back")) != NULL) dstruct.back = atoi(strchr(p, '=') + 1);
|
||||||
dstruct.hflip= strcasestr(config, "HFlip") ? true : false;
|
dstruct.hflip= strcasestr(config, "HFlip") ? true : false;
|
||||||
dstruct.vflip= strcasestr(config, "VFlip") ? true : false;
|
dstruct.vflip= strcasestr(config, "VFlip") ? true : false;
|
||||||
dstruct.rotate= strcasestr(config, "rotate") ? true : false;
|
dstruct.rotate= strcasestr(config, "rotate") ? true : false;
|
||||||
@@ -118,7 +382,13 @@ const i2c_config_t * config_i2c_get(int * i2c_port) {
|
|||||||
if ((p = strcasestr(nvs_item, "port")) != NULL) i2c_system_port = atoi(strchr(p, '=') + 1);
|
if ((p = strcasestr(nvs_item, "port")) != NULL) i2c_system_port = atoi(strchr(p, '=') + 1);
|
||||||
free(nvs_item);
|
free(nvs_item);
|
||||||
}
|
}
|
||||||
if(i2c_port) *i2c_port=i2c_system_port;
|
if(i2c_port) {
|
||||||
|
#ifdef CONFIG_I2C_LOCKED
|
||||||
|
*i2c_port= I2C_NUM_1;
|
||||||
|
#else
|
||||||
|
*i2c_port=i2c_system_port;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
return &i2c;
|
return &i2c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,25 +451,135 @@ cJSON * get_gpio_entry(const char * name, const char * prefix, int gpio, bool fi
|
|||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
cJSON * get_GPIO_list() {
|
cJSON * get_GPIO_nvs_list(cJSON * list) {
|
||||||
cJSON * list = cJSON_CreateArray();
|
cJSON * ilist = list?list:cJSON_CreateArray();
|
||||||
char *nvs_item, *p, type[16];
|
char *nvs_item, *p, type[16];
|
||||||
int gpio;
|
int gpio;
|
||||||
|
bool fixed=false;
|
||||||
if ((nvs_item = config_alloc_get(NVS_TYPE_STR, "set_GPIO")) == NULL) return list;
|
#ifdef CONFIG_JACK_LOCKED
|
||||||
|
bool bFoundJack=false;
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_SPKFAULT_LOCKED
|
||||||
|
bool bFoundSpkFault = false;
|
||||||
|
#endif
|
||||||
|
if ((nvs_item = config_alloc_get(NVS_TYPE_STR, "set_GPIO")) == NULL) return ilist;
|
||||||
p = nvs_item;
|
p = nvs_item;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
fixed=false;
|
||||||
if (sscanf(p, "%d=%15[^,]", &gpio, type) > 0 && (GPIO_IS_VALID_GPIO(gpio) || gpio==GPIO_NUM_NC)){
|
if (sscanf(p, "%d=%15[^,]", &gpio, type) > 0 && (GPIO_IS_VALID_GPIO(gpio) || gpio==GPIO_NUM_NC)){
|
||||||
cJSON_AddItemToArray(list,get_gpio_entry(type,"gpio", gpio, false));
|
#ifdef CONFIG_JACK_LOCKED
|
||||||
|
if(strcasecmp(type,"jack")==0){
|
||||||
|
fixed=true;
|
||||||
|
bFoundJack=true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_SPKFAULT_LOCKED
|
||||||
|
if(strcasecmp(type,"spkfault")==0){
|
||||||
|
fixed=true;
|
||||||
|
bFoundSpkFault=true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
cJSON_AddItemToArray(ilist,get_gpio_entry(type,"gpio", gpio, fixed));
|
||||||
}
|
}
|
||||||
p = strchr(p, ',');
|
p = strchr(p, ',');
|
||||||
} while (p++);
|
} while (p++);
|
||||||
|
#ifdef CONFIG_JACK_LOCKED
|
||||||
|
if(!bFoundJack){
|
||||||
|
monitor_gpio_t *jack= get_jack_insertion_gpio();
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry("jack", "other", jack->gpio, true));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_SPKFAULT_LOCKED
|
||||||
|
if(!bFoundSpkFault){
|
||||||
|
monitor_gpio_t *jack= get_spkfault_gpio();
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry("spkfault", "other", jack->gpio, true));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
free(nvs_item);
|
free(nvs_item);
|
||||||
|
return ilist;
|
||||||
|
}
|
||||||
|
|
||||||
return list;
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
cJSON * get_DAC_GPIO(cJSON * list){
|
||||||
|
cJSON * llist = list;
|
||||||
|
if(!llist){
|
||||||
|
llist = cJSON_CreateArray();
|
||||||
|
}
|
||||||
|
const i2s_platform_config_t * i2s_config= config_dac_get();
|
||||||
|
if(i2s_config->pin.bck_io_num>=0){
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("bck","dac",i2s_config->pin.bck_io_num,is_dac_config_locked()));
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("ws","dac",i2s_config->pin.ws_io_num,is_dac_config_locked()));
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("do","dac",i2s_config->pin.data_out_num,is_dac_config_locked()));
|
||||||
|
if(i2s_config->sda>=0){
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("sda","dac",i2s_config->sda,is_dac_config_locked()));
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("scl","dac",i2s_config->scl,is_dac_config_locked()));
|
||||||
|
}
|
||||||
|
if(i2s_config->mute_gpio>=0){
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("mute","dac",i2s_config->mute_gpio,is_dac_config_locked()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return llist;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
cJSON * get_Display_GPIO(cJSON * list){
|
||||||
|
cJSON * llist = list;
|
||||||
|
if(!llist){
|
||||||
|
llist = cJSON_CreateArray();
|
||||||
|
}
|
||||||
|
const display_config_t * config= config_display_get();
|
||||||
|
if(config->back >=0){
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("backlight","display",config->back,false));
|
||||||
|
}
|
||||||
|
if(config->CS_pin >=0){
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("CS","display",config->CS_pin,false));
|
||||||
|
}
|
||||||
|
if(config->RST_pin >=0){
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("reset","display",config->RST_pin,false));
|
||||||
|
}
|
||||||
|
return llist;
|
||||||
|
}
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
cJSON * get_I2C_GPIO(cJSON * list){
|
||||||
|
cJSON * llist = list;
|
||||||
|
if(!llist){
|
||||||
|
llist = cJSON_CreateArray();
|
||||||
|
}
|
||||||
|
int port=0;
|
||||||
|
const i2c_config_t * i2c_config = config_i2c_get(&port);
|
||||||
|
if(i2c_config->scl_io_num>=0){
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("scl","i2c",i2c_config->scl_io_num,false));
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("sda","i2c",i2c_config->sda_io_num,false));
|
||||||
|
}
|
||||||
|
return llist;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
cJSON * get_SPI_GPIO(cJSON * list){
|
||||||
|
cJSON * llist = list;
|
||||||
|
if(!llist){
|
||||||
|
llist = cJSON_CreateArray();
|
||||||
|
}
|
||||||
|
spi_host_device_t spi_host;
|
||||||
|
const spi_bus_config_t * spi_config = config_spi_get(&spi_host);
|
||||||
|
|
||||||
|
if(spi_config->miso_io_num>=0){
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("data","spi",spi_config->miso_io_num,false));
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("data","clk",spi_config->sclk_io_num,false));
|
||||||
|
}
|
||||||
|
if(spi_system_dc_gpio>0){
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry("data","dc",spi_system_dc_gpio,false));
|
||||||
|
}
|
||||||
|
return llist;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
@@ -222,19 +602,19 @@ cJSON * get_GPIO_from_string(const char * nvs_item, const char * prefix, cJSON *
|
|||||||
p=p?p+1:nvs_item;
|
p=p?p+1:nvs_item;
|
||||||
while((((ret1=sscanf(p, "%[^=]=%d%n", type,&gpio,&offset)) ==2) || ((sret=sscanf(p, "%[^=]=%[^, ],%n", buf1,buf2,&soffset)) > 0 )) && (offset || soffset)){
|
while((((ret1=sscanf(p, "%[^=]=%d%n", type,&gpio,&offset)) ==2) || ((sret=sscanf(p, "%[^=]=%[^, ],%n", buf1,buf2,&soffset)) > 0 )) && (offset || soffset)){
|
||||||
if(ret1==2 && (GPIO_IS_VALID_GPIO(gpio) || gpio==GPIO_NUM_NC)){
|
if(ret1==2 && (GPIO_IS_VALID_GPIO(gpio) || gpio==GPIO_NUM_NC)){
|
||||||
cJSON_AddItemToArray(list,get_gpio_entry(type,prefix,gpio,fixed));
|
if(gpio>0){
|
||||||
|
cJSON_AddItemToArray(llist,get_gpio_entry(type,prefix,gpio,fixed));
|
||||||
|
}
|
||||||
p+=offset;
|
p+=offset;
|
||||||
} else {
|
} else {
|
||||||
p+=soffset;
|
p+=soffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(*p==' ' || *p==',') p++;
|
while(*p==' ' || *p==',') p++;
|
||||||
gpio=-1;
|
gpio=-1;
|
||||||
}
|
}
|
||||||
free(buf1);
|
free(buf1);
|
||||||
free(buf2);
|
free(buf2);
|
||||||
return llist;
|
return llist;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
@@ -255,36 +635,31 @@ cJSON * get_GPIO_from_nvs(const char * item, const char * prefix, cJSON * list,
|
|||||||
esp_err_t get_gpio_structure(cJSON * gpio_entry, gpio_entry_t ** gpio){
|
esp_err_t get_gpio_structure(cJSON * gpio_entry, gpio_entry_t ** gpio){
|
||||||
esp_err_t err = ESP_OK;
|
esp_err_t err = ESP_OK;
|
||||||
*gpio = malloc(sizeof(gpio_entry_t));
|
*gpio = malloc(sizeof(gpio_entry_t));
|
||||||
//gpio,name,fixed
|
|
||||||
cJSON * val = cJSON_GetObjectItem(gpio_entry,"gpio");
|
cJSON * val = cJSON_GetObjectItem(gpio_entry,"gpio");
|
||||||
if(val){
|
if(val){
|
||||||
(*gpio)->gpio= (int)val->valuedouble;
|
(*gpio)->gpio= (int)val->valuedouble;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ESP_LOGE(TAG,"gpio pin not found");
|
ESP_LOGE(TAG,"gpio pin not found");
|
||||||
err=ESP_FAIL;
|
err=ESP_FAIL;
|
||||||
}
|
}
|
||||||
val = cJSON_GetObjectItem(gpio_entry,"name");
|
val = cJSON_GetObjectItem(gpio_entry,"name");
|
||||||
if(val){
|
if(val){
|
||||||
(*gpio)->name= strdup(cJSON_GetStringValue(val));
|
(*gpio)->name= strdup(cJSON_GetStringValue(val));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ESP_LOGE(TAG,"gpio name value not found");
|
ESP_LOGE(TAG,"gpio name value not found");
|
||||||
err=ESP_FAIL;
|
err=ESP_FAIL;
|
||||||
}
|
}
|
||||||
val = cJSON_GetObjectItem(gpio_entry,"group");
|
val = cJSON_GetObjectItem(gpio_entry,"group");
|
||||||
if(val){
|
if(val){
|
||||||
(*gpio)->group= strdup(cJSON_GetStringValue(val));
|
(*gpio)->group= strdup(cJSON_GetStringValue(val));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ESP_LOGE(TAG,"gpio group value not found");
|
ESP_LOGE(TAG,"gpio group value not found");
|
||||||
err=ESP_FAIL;
|
err=ESP_FAIL;
|
||||||
}
|
}
|
||||||
val = cJSON_GetObjectItem(gpio_entry,"fixed");
|
val = cJSON_GetObjectItem(gpio_entry,"fixed");
|
||||||
if(val){
|
if(val){
|
||||||
(*gpio)->fixed= cJSON_IsTrue(val);
|
(*gpio)->fixed= cJSON_IsTrue(val);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ESP_LOGE(TAG,"gpio fixed indicator not found");
|
ESP_LOGE(TAG,"gpio fixed indicator not found");
|
||||||
err=ESP_FAIL;
|
err=ESP_FAIL;
|
||||||
}
|
}
|
||||||
@@ -342,27 +717,114 @@ gpio_entry_t * get_gpio_by_name(char * name,char * group, bool refresh){
|
|||||||
return gpio;
|
return gpio;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef PICO_PSRAM_CLK_IO
|
||||||
|
#define PICO_PSRAM_CLK_IO 6
|
||||||
|
#endif
|
||||||
|
#ifndef PSRAM_SPIQ_SD0_IO
|
||||||
|
#define PSRAM_SPIQ_SD0_IO 7
|
||||||
|
#define PSRAM_SPID_SD1_IO 8
|
||||||
|
#define PSRAM_SPIWP_SD3_IO 10
|
||||||
|
#define PSRAM_SPIHD_SD2_IO 9
|
||||||
|
#define FLASH_HSPI_CLK_IO 14
|
||||||
|
#define FLASH_HSPI_CS_IO 15
|
||||||
|
#define PSRAM_HSPI_SPIQ_SD0_IO 12
|
||||||
|
#define PSRAM_HSPI_SPID_SD1_IO 13
|
||||||
|
#define PSRAM_HSPI_SPIWP_SD3_IO 2
|
||||||
|
#define PSRAM_HSPI_SPIHD_SD2_IO 4
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
cJSON * get_psram_gpio_list(cJSON * list){
|
||||||
|
const char * psram_dev = "psram";
|
||||||
|
const char * flash_dev = "flash";
|
||||||
|
const char * clk = "clk";
|
||||||
|
const char * cs = "cs";
|
||||||
|
const char * spiq_sd0_io="spiq_sd0_io";
|
||||||
|
const char * spid_sd1_io = "spid_sd1_io";
|
||||||
|
const char * spiwp_sd3_io = "spiwp_sd3_io";
|
||||||
|
const char * spihd_sd2_io = "spihd_sd2_io";
|
||||||
|
cJSON * llist=list;
|
||||||
|
|
||||||
|
uint32_t chip_ver = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG);
|
||||||
|
uint32_t pkg_ver = chip_ver & 0x7;
|
||||||
|
if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5) {
|
||||||
|
rtc_vddsdio_config_t cfg = rtc_vddsdio_get_config();
|
||||||
|
if (cfg.tieh != RTC_VDDSDIO_TIEH_1_8V) {
|
||||||
|
return llist;
|
||||||
|
}
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(clk,psram_dev,CONFIG_D2WD_PSRAM_CLK_IO,true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(cs,psram_dev,CONFIG_D2WD_PSRAM_CS_IO,true));
|
||||||
|
} else if ((pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2) || (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4)) {
|
||||||
|
rtc_vddsdio_config_t cfg = rtc_vddsdio_get_config();
|
||||||
|
if (cfg.tieh != RTC_VDDSDIO_TIEH_3_3V) {
|
||||||
|
return llist;
|
||||||
|
}
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(clk,psram_dev,PICO_PSRAM_CLK_IO,true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(cs,psram_dev,CONFIG_PICO_PSRAM_CS_IO,true));
|
||||||
|
} else if ((pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ6) || (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ5)){
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(clk,psram_dev,CONFIG_D0WD_PSRAM_CLK_IO,true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(cs,psram_dev,CONFIG_D0WD_PSRAM_CS_IO,true));
|
||||||
|
} else {
|
||||||
|
ESP_LOGW(TAG, "Cant' determine GPIOs for PSRAM chip id: %d", pkg_ver);
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(clk,psram_dev,-1,true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(cs,psram_dev,-1,true));
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint32_t spiconfig = ets_efuse_get_spiconfig();
|
||||||
|
if (spiconfig == EFUSE_SPICONFIG_SPI_DEFAULTS) {
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spiq_sd0_io,psram_dev,PSRAM_SPIQ_SD0_IO,true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spid_sd1_io,psram_dev,PSRAM_SPID_SD1_IO,true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spiwp_sd3_io,psram_dev,PSRAM_SPIWP_SD3_IO,true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spihd_sd2_io,psram_dev,PSRAM_SPIHD_SD2_IO,true));
|
||||||
|
} else if (spiconfig == EFUSE_SPICONFIG_HSPI_DEFAULTS) {
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spiq_sd0_io,psram_dev,PSRAM_HSPI_SPIQ_SD0_IO,true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spid_sd1_io,psram_dev,PSRAM_HSPI_SPID_SD1_IO,true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spiwp_sd3_io,psram_dev,PSRAM_HSPI_SPIWP_SD3_IO,true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spihd_sd2_io,psram_dev,PSRAM_HSPI_SPIHD_SD2_IO,true));
|
||||||
|
} else {
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spiq_sd0_io,psram_dev,EFUSE_SPICONFIG_RET_SPIQ(spiconfig),true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spid_sd1_io,psram_dev,EFUSE_SPICONFIG_RET_SPID(spiconfig),true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spihd_sd2_io,psram_dev,EFUSE_SPICONFIG_RET_SPIHD(spiconfig),true));
|
||||||
|
// If flash mode is set to QIO or QOUT, the WP pin is equal the value configured in bootloader.
|
||||||
|
// If flash mode is set to DIO or DOUT, the WP pin should config it via menuconfig.
|
||||||
|
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_FLASHMODE_QOUT
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spiwp_sd3_io,psram_dev,CONFIG_BOOTLOADER_SPI_WP_PIN,true));
|
||||||
|
#else
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(spiwp_sd3_io,psram_dev,CONFIG_SPIRAM_SPIWP_SD3_PIN,true));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if (spiconfig == EFUSE_SPICONFIG_SPI_DEFAULTS) {
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(clk,flash_dev,SPI_IOMUX_PIN_NUM_CLK,true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(cs,flash_dev,SPI_IOMUX_PIN_NUM_CS,true));
|
||||||
|
} else if (spiconfig == EFUSE_SPICONFIG_HSPI_DEFAULTS) {
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(clk,flash_dev,FLASH_HSPI_CLK_IO,true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(cs,flash_dev,FLASH_HSPI_CS_IO,true));
|
||||||
|
} else {
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(clk,flash_dev,EFUSE_SPICONFIG_RET_SPICLK(spiconfig),true));
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(cs,flash_dev,EFUSE_SPICONFIG_RET_SPICS0(spiconfig),true));
|
||||||
|
}
|
||||||
|
return llist;
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
cJSON * get_gpio_list() {
|
cJSON * get_gpio_list() {
|
||||||
gpio_num_t gpio_num;
|
gpio_num_t gpio_num;
|
||||||
if(gpio_list){
|
if(gpio_list){
|
||||||
cJSON_free(gpio_list);
|
cJSON_Delete(gpio_list);
|
||||||
}
|
}
|
||||||
gpio_list = get_GPIO_list();
|
gpio_list = cJSON_CreateArray();
|
||||||
|
|
||||||
#ifndef CONFIG_BAT_LOCKED
|
#ifndef CONFIG_BAT_LOCKED
|
||||||
char *bat_config = config_alloc_get_default(NVS_TYPE_STR, "bat_config", NULL, 0);
|
char *bat_config = config_alloc_get_default(NVS_TYPE_STR, "bat_config", NULL, 0);
|
||||||
if (bat_config) {
|
if (bat_config) {
|
||||||
char *p;
|
char *p;
|
||||||
int channel;
|
int channel;
|
||||||
if ((p = strcasestr(bat_config, "channel") ) != NULL)
|
if ((p = strcasestr(bat_config, "channel") ) != NULL) {
|
||||||
{
|
|
||||||
channel = atoi(strchr(p, '=') + 1);
|
channel = atoi(strchr(p, '=') + 1);
|
||||||
if(channel != -1){
|
if(channel != -1){
|
||||||
if(adc1_pad_get_io_num(channel,&gpio_num )==ESP_OK){
|
if(adc1_pad_get_io_num(channel,&gpio_num )==ESP_OK){
|
||||||
cJSON_AddItemToArray(gpio_list,get_gpio_entry("bat","",gpio_num,false));
|
cJSON_AddItemToArray(gpio_list,get_gpio_entry("bat","other",gpio_num,false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -370,23 +832,17 @@ cJSON * get_gpio_list() {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if(adc1_pad_get_io_num(CONFIG_BAT_CHANNEL,&gpio_num )==ESP_OK){
|
if(adc1_pad_get_io_num(CONFIG_BAT_CHANNEL,&gpio_num )==ESP_OK){
|
||||||
cJSON_AddItemToArray(gpio_list,get_gpio_entry("bat","",gpio_num,true));
|
cJSON_AddItemToArray(gpio_list,get_gpio_entry("bat","other",gpio_num,true));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
gpio_list = get_GPIO_from_nvs("i2c_config","i2c", gpio_list, false);
|
gpio_list = get_GPIO_nvs_list(gpio_list);
|
||||||
gpio_list = get_GPIO_from_nvs("spi_config","spi", gpio_list, false);
|
char * spdif_config = config_spdif_get_string();
|
||||||
|
gpio_list=get_GPIO_from_string(spdif_config,"spdif", gpio_list, is_spdif_config_locked());
|
||||||
char *spdif_config = config_alloc_get_str("spdif_config", CONFIG_SPDIF_CONFIG, "bck=" STR(CONFIG_SPDIF_BCK_IO)
|
|
||||||
",ws=" STR(CONFIG_SPDIF_WS_IO) ",do=" STR(CONFIG_SPDIF_DO_IO));
|
|
||||||
|
|
||||||
gpio_list=get_GPIO_from_string(spdif_config,"spdif", gpio_list, (strlen(CONFIG_SPDIF_CONFIG)>0 || CONFIG_SPDIF_DO_IO>0 ));
|
|
||||||
char *dac_config = config_alloc_get_str("dac_config", CONFIG_DAC_CONFIG, "model=i2s,bck=" STR(CONFIG_I2S_BCK_IO)
|
|
||||||
",ws=" STR(CONFIG_I2S_WS_IO) ",do=" STR(CONFIG_I2S_DO_IO)
|
|
||||||
",sda=" STR(CONFIG_I2C_SDA) ",scl=" STR(CONFIG_I2C_SCL)
|
|
||||||
",mute=" STR(CONFIG_MUTE_GPIO));
|
|
||||||
|
|
||||||
gpio_list=get_GPIO_from_string(dac_config,"dac", gpio_list, (strlen(CONFIG_DAC_CONFIG)>0 || CONFIG_I2S_DO_IO>0 ));
|
|
||||||
free(spdif_config);
|
free(spdif_config);
|
||||||
free(dac_config);
|
gpio_list=get_Display_GPIO(gpio_list);
|
||||||
|
gpio_list=get_SPI_GPIO(gpio_list);
|
||||||
|
gpio_list=get_I2C_GPIO(gpio_list);
|
||||||
|
gpio_list=get_DAC_GPIO(gpio_list);
|
||||||
|
gpio_list=get_psram_gpio_list(gpio_list);
|
||||||
return gpio_list;
|
return gpio_list;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,35 +10,57 @@
|
|||||||
|
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include "driver/i2c.h"
|
#include "driver/i2c.h"
|
||||||
|
#include "driver/i2s.h"
|
||||||
#include "driver/spi_master.h"
|
#include "driver/spi_master.h"
|
||||||
|
extern const char *i2c_name_type;
|
||||||
|
extern const char *spi_name_type;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
int RST_pin;
|
|
||||||
int i2c_system_port;
|
|
||||||
int address;
|
int address;
|
||||||
int CS_pin;
|
int RST_pin;
|
||||||
int speed;
|
|
||||||
const char *drivername;
|
|
||||||
const char *type;
|
|
||||||
bool hflip;
|
bool hflip;
|
||||||
bool vflip;
|
bool vflip;
|
||||||
|
const char *drivername;
|
||||||
|
int CS_pin;
|
||||||
|
int speed;
|
||||||
|
int back;
|
||||||
|
int depth;
|
||||||
|
const char *type;
|
||||||
bool rotate;
|
bool rotate;
|
||||||
} display_config_t;
|
} display_config_t;
|
||||||
const display_config_t * config_display_get();
|
|
||||||
esp_err_t config_i2c_set(const i2c_config_t * config, int port);
|
|
||||||
esp_err_t config_spi_set(const spi_bus_config_t * config, int host, int dc);
|
|
||||||
const i2c_config_t * config_i2c_get(int * i2c_port);
|
|
||||||
const spi_bus_config_t * config_spi_get(spi_host_device_t * spi_host);
|
|
||||||
void parse_set_GPIO(void (*cb)(int gpio, char *value));
|
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
i2s_pin_config_t pin;
|
||||||
|
char model[32];
|
||||||
|
int mute_gpio;
|
||||||
|
int mute_level;
|
||||||
|
int i2c_addr;
|
||||||
|
int sda;
|
||||||
|
int scl;
|
||||||
|
} i2s_platform_config_t;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool fixed;
|
bool fixed;
|
||||||
char * name;
|
char * name;
|
||||||
char * group;
|
char * group;
|
||||||
int gpio;
|
int gpio;
|
||||||
} gpio_entry_t;
|
} gpio_entry_t;
|
||||||
|
|
||||||
|
const display_config_t * config_display_get();
|
||||||
|
esp_err_t config_display_set(const display_config_t * config);
|
||||||
|
esp_err_t config_i2c_set(const i2c_config_t * config, int port);
|
||||||
|
esp_err_t config_i2s_set(const i2s_platform_config_t * config, const char * nvs_name);
|
||||||
|
esp_err_t config_spi_set(const spi_bus_config_t * config, int host, int dc);
|
||||||
|
const i2c_config_t * config_i2c_get(int * i2c_port);
|
||||||
|
const spi_bus_config_t * config_spi_get(spi_host_device_t * spi_host);
|
||||||
|
void parse_set_GPIO(void (*cb)(int gpio, char *value));
|
||||||
|
const i2s_platform_config_t * config_dac_get();
|
||||||
|
const i2s_platform_config_t * config_spdif_get( );
|
||||||
|
esp_err_t config_spdif_set(const i2s_platform_config_t * config);
|
||||||
|
bool is_spdif_config_locked();
|
||||||
esp_err_t free_gpio_entry( gpio_entry_t ** gpio);
|
esp_err_t free_gpio_entry( gpio_entry_t ** gpio);
|
||||||
gpio_entry_t * get_gpio_by_name(char * name,char * group, bool refresh);
|
gpio_entry_t * get_gpio_by_name(char * name,char * group, bool refresh);
|
||||||
gpio_entry_t * get_gpio_by_no(int gpionum, bool refresh);
|
gpio_entry_t * get_gpio_by_no(int gpionum, bool refresh);
|
||||||
cJSON * get_gpio_list();
|
cJSON * get_gpio_list();
|
||||||
|
bool is_dac_config_locked();
|
||||||
|
bool are_statistics_enabled();
|
||||||
@@ -119,6 +119,7 @@ const char * messaging_get_class_desc(messaging_classes msg_class){
|
|||||||
CASE_TO_STR(MESSAGING_CLASS_OTA);
|
CASE_TO_STR(MESSAGING_CLASS_OTA);
|
||||||
CASE_TO_STR(MESSAGING_CLASS_SYSTEM);
|
CASE_TO_STR(MESSAGING_CLASS_SYSTEM);
|
||||||
CASE_TO_STR(MESSAGING_CLASS_STATS);
|
CASE_TO_STR(MESSAGING_CLASS_STATS);
|
||||||
|
CASE_TO_STR(MESSAGING_CLASS_CFGCMD);
|
||||||
default:
|
default:
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
break;
|
break;
|
||||||
@@ -141,12 +142,12 @@ cJSON * messaging_retrieve_messages(RingbufHandle_t buf_handle){
|
|||||||
else {
|
else {
|
||||||
json_message = cJSON_CreateObject();
|
json_message = cJSON_CreateObject();
|
||||||
cJSON_AddStringToObject(json_message, "message", message->message);
|
cJSON_AddStringToObject(json_message, "message", message->message);
|
||||||
vRingbufferReturnItem(buf_handle, (void *)message);
|
|
||||||
cJSON_AddStringToObject(json_message, "type", messaging_get_type_desc(message->type));
|
cJSON_AddStringToObject(json_message, "type", messaging_get_type_desc(message->type));
|
||||||
cJSON_AddStringToObject(json_message, "class", messaging_get_class_desc(message->msg_class));
|
cJSON_AddStringToObject(json_message, "class", messaging_get_class_desc(message->msg_class));
|
||||||
cJSON_AddNumberToObject(json_message,"sent_time",message->sent_time);
|
cJSON_AddNumberToObject(json_message,"sent_time",message->sent_time);
|
||||||
cJSON_AddNumberToObject(json_message,"current_time",esp_timer_get_time() / 1000);
|
cJSON_AddNumberToObject(json_message,"current_time",esp_timer_get_time() / 1000);
|
||||||
cJSON_AddItemToArray(json_messages,json_message);
|
cJSON_AddItemToArray(json_messages,json_message);
|
||||||
|
vRingbufferReturnItem(buf_handle, (void *)message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return json_messages;
|
return json_messages;
|
||||||
@@ -260,5 +261,23 @@ void log_send_messaging(messaging_types msgtype,const char *fmt, ...) {
|
|||||||
else{
|
else{
|
||||||
ESP_LOGE(tag, "Memory allocation failed while sending message");
|
ESP_LOGE(tag, "Memory allocation failed while sending message");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
void cmd_send_messaging(const char * cmdname,messaging_types msgtype, const char *fmt, ...){
|
||||||
|
va_list va;
|
||||||
|
va_start(va, fmt);
|
||||||
|
size_t cmd_len = strlen(cmdname)+1;
|
||||||
|
size_t ln = vsnprintf(NULL, 0, fmt, va)+1;
|
||||||
|
char * message_txt = malloc(ln+cmd_len);
|
||||||
|
if(message_txt){
|
||||||
|
strcpy(message_txt,cmdname);
|
||||||
|
strcat(message_txt,"\n");
|
||||||
|
vsprintf((message_txt+cmd_len), fmt, va);
|
||||||
|
va_end(va);
|
||||||
|
ESP_LOG_LEVEL_LOCAL(messaging_type_to_err_type(msgtype),tag, "%s",message_txt);
|
||||||
|
messaging_post_message(msgtype, MESSAGING_CLASS_CFGCMD, message_txt );
|
||||||
|
free(message_txt);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ESP_LOGE(tag, "Memory allocation failed while sending message");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/ringbuf.h"
|
#include "freertos/ringbuf.h"
|
||||||
#include "cJSON.h"
|
#include "cJSON.h"
|
||||||
#pragma once
|
#pragma once
|
||||||
@@ -10,7 +11,8 @@ typedef enum {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
MESSAGING_CLASS_OTA,
|
MESSAGING_CLASS_OTA,
|
||||||
MESSAGING_CLASS_SYSTEM,
|
MESSAGING_CLASS_SYSTEM,
|
||||||
MESSAGING_CLASS_STATS
|
MESSAGING_CLASS_STATS,
|
||||||
|
MESSAGING_CLASS_CFGCMD
|
||||||
} messaging_classes;
|
} messaging_classes;
|
||||||
|
|
||||||
typedef struct messaging_list_t *messaging_handle_t;
|
typedef struct messaging_list_t *messaging_handle_t;
|
||||||
@@ -30,6 +32,7 @@ void messaging_post_message(messaging_types type,messaging_classes msg_class, co
|
|||||||
cJSON * messaging_retrieve_messages(RingbufHandle_t buf_handle);
|
cJSON * messaging_retrieve_messages(RingbufHandle_t buf_handle);
|
||||||
single_message_t * messaging_retrieve_message(RingbufHandle_t buf_handle);
|
single_message_t * messaging_retrieve_message(RingbufHandle_t buf_handle);
|
||||||
void log_send_messaging(messaging_types msgtype,const char *fmt, ...);
|
void log_send_messaging(messaging_types msgtype,const char *fmt, ...);
|
||||||
|
void cmd_send_messaging(const char * cmdname,messaging_types msgtype, const char *fmt, ...);
|
||||||
esp_err_t messaging_type_to_err_type(messaging_types type);
|
esp_err_t messaging_type_to_err_type(messaging_types type);
|
||||||
void messaging_service_init();
|
void messaging_service_init();
|
||||||
|
|
||||||
|
|||||||
@@ -32,11 +32,8 @@ static const char *TAG = "monitor";
|
|||||||
|
|
||||||
static TimerHandle_t monitor_timer;
|
static TimerHandle_t monitor_timer;
|
||||||
|
|
||||||
static struct {
|
static monitor_gpio_t jack = { CONFIG_JACK_GPIO, 0 };
|
||||||
int gpio;
|
static monitor_gpio_t spkfault = { CONFIG_SPKFAULT_GPIO, 0 };
|
||||||
int active;
|
|
||||||
} jack = { CONFIG_JACK_GPIO, 0 },
|
|
||||||
spkfault = { CONFIG_SPKFAULT_GPIO, 0 };
|
|
||||||
|
|
||||||
void (*jack_handler_svc)(bool inserted);
|
void (*jack_handler_svc)(bool inserted);
|
||||||
bool jack_inserted_svc(void);
|
bool jack_inserted_svc(void);
|
||||||
@@ -181,6 +178,9 @@ static void set_jack_gpio(int gpio, char *value) {
|
|||||||
jack.gpio = gpio;
|
jack.gpio = gpio;
|
||||||
if ((p = strchr(value, ':')) != NULL) jack.active = atoi(p + 1);
|
if ((p = strchr(value, ':')) != NULL) jack.active = atoi(p + 1);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
jack.gpio = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -194,6 +194,9 @@ static void set_spkfault_gpio(int gpio, char *value) {
|
|||||||
spkfault.gpio = gpio;
|
spkfault.gpio = gpio;
|
||||||
if ((p = strchr(value, ':')) != NULL) spkfault.active = atoi(p + 1);
|
if ((p = strchr(value, ':')) != NULL) spkfault.active = atoi(p + 1);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
spkfault.gpio = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -245,3 +248,17 @@ void monitor_svc_init(void) {
|
|||||||
heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
|
heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
|
||||||
heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
|
heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
monitor_gpio_t * get_spkfault_gpio(){
|
||||||
|
return &spkfault ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
monitor_gpio_t * get_jack_insertion_gpio(){
|
||||||
|
return &jack;
|
||||||
|
}
|
||||||
@@ -9,6 +9,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
typedef struct {
|
||||||
|
int gpio;
|
||||||
|
int active;
|
||||||
|
} monitor_gpio_t;
|
||||||
|
|
||||||
extern void (*jack_handler_svc)(bool inserted);
|
extern void (*jack_handler_svc)(bool inserted);
|
||||||
extern bool jack_inserted_svc(void);
|
extern bool jack_inserted_svc(void);
|
||||||
@@ -19,3 +23,6 @@ extern bool spkfault_svc(void);
|
|||||||
extern float battery_value_svc(void);
|
extern float battery_value_svc(void);
|
||||||
extern uint8_t battery_level_svc(void);
|
extern uint8_t battery_level_svc(void);
|
||||||
|
|
||||||
|
extern monitor_gpio_t * get_spkfault_gpio();
|
||||||
|
extern monitor_gpio_t * get_jack_insertion_gpio();
|
||||||
|
|
||||||
|
|||||||
@@ -327,12 +327,12 @@ void register_external(void) {
|
|||||||
|
|
||||||
void deregister_external(void) {
|
void deregister_external(void) {
|
||||||
if (!strcasestr(output.device, "BT ") && enable_bt_sink) {
|
if (!strcasestr(output.device, "BT ") && enable_bt_sink) {
|
||||||
bt_sink_deinit();
|
|
||||||
LOG_INFO("Stopping BT sink");
|
LOG_INFO("Stopping BT sink");
|
||||||
|
bt_sink_deinit();
|
||||||
}
|
}
|
||||||
if (enable_airplay){
|
if (enable_airplay){
|
||||||
|
LOG_INFO("Stopping AirPlay sink");
|
||||||
raop_sink_deinit();
|
raop_sink_deinit();
|
||||||
LOG_INFO("Stopping AirPlay sink");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ u8_t custom_player_id = 12;
|
|||||||
void embedded_init(void) {
|
void embedded_init(void) {
|
||||||
mutex_create(slimp_mutex);
|
mutex_create(slimp_mutex);
|
||||||
sb_controls_init();
|
sb_controls_init();
|
||||||
if (sb_display_init()) custom_player_id = 100;
|
custom_player_id = sb_display_init() ? 100 : 101;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16_t get_RSSI(void) {
|
u16_t get_RSSI(void) {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ typedef unsigned long long u64_t;
|
|||||||
#define OUTPUT_THREAD_STACK_SIZE 6 * 1024
|
#define OUTPUT_THREAD_STACK_SIZE 6 * 1024
|
||||||
#define IR_THREAD_STACK_SIZE 6 * 1024
|
#define IR_THREAD_STACK_SIZE 6 * 1024
|
||||||
|
|
||||||
// number of 5s times search for a server will happen beforee slimproto exits (0 = no limit)
|
// number of times the 5s search for a server will happen before slimproto exits (0 = no limit)
|
||||||
#define MAX_SERVER_RETRIES 5
|
#define MAX_SERVER_RETRIES 5
|
||||||
|
|
||||||
// or can be as simple as #define PLAYER_ID 100
|
// or can be as simple as #define PLAYER_ID 100
|
||||||
|
|||||||
@@ -962,7 +962,7 @@ void slimproto(log_level level, char *server, u8_t mac[6], const char *name, con
|
|||||||
if (++failed_connect > 5 && !server) {
|
if (++failed_connect > 5 && !server) {
|
||||||
slimproto_ip = serv_addr.sin_addr.s_addr = discover_server(NULL, MAX_SERVER_RETRIES);
|
slimproto_ip = serv_addr.sin_addr.s_addr = discover_server(NULL, MAX_SERVER_RETRIES);
|
||||||
if (!slimproto_ip) return;
|
if (!slimproto_ip) return;
|
||||||
} else if (MAX_SERVER_RETRIES && failed_connect > 5 * MAX_SERVER_RETRIES) return;
|
} else if (reconnect && MAX_SERVER_RETRIES && failed_connect > 5 * MAX_SERVER_RETRIES) return;
|
||||||
#else
|
#else
|
||||||
// rediscover server if it was not set at startup or exit
|
// rediscover server if it was not set at startup or exit
|
||||||
if (!server && ++failed_connect > 5) {
|
if (!server && ++failed_connect > 5) {
|
||||||
|
|||||||
@@ -22,11 +22,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "esp_pthread.h"
|
#include "esp_pthread.h"
|
||||||
|
#include "esp_log.h"
|
||||||
#ifndef SQUEEZELITE_ESP32_RELEASE_URL
|
#ifndef SQUEEZELITE_ESP32_RELEASE_URL
|
||||||
#define SQUEEZELITE_ESP32_RELEASE_URL "https://github.com/sle118/squeezelite-esp32/releases"
|
#define SQUEEZELITE_ESP32_RELEASE_URL "https://github.com/sle118/squeezelite-esp32/releases"
|
||||||
#endif
|
#endif
|
||||||
extern bool is_recovery_running;
|
extern bool is_recovery_running;
|
||||||
extern void run_command(char * line);
|
extern esp_err_t run_command(char * line);
|
||||||
extern bool wait_for_wifi();
|
extern bool wait_for_wifi();
|
||||||
extern void console_start();
|
extern void console_start();
|
||||||
extern pthread_cond_t wifi_connect_suspend_cond;
|
extern pthread_cond_t wifi_connect_suspend_cond;
|
||||||
|
|||||||
@@ -33,6 +33,3 @@ extern const char * str_or_null(const char * str);
|
|||||||
#ifndef CASE_TO_STR
|
#ifndef CASE_TO_STR
|
||||||
#define CASE_TO_STR(x) case x: return STR(x); break;
|
#define CASE_TO_STR(x) case x: return STR(x); break;
|
||||||
#endif
|
#endif
|
||||||
#define START_FREE_MEM_CHECK(a) size_t a=heap_caps_get_free_size(MALLOC_CAP_INTERNAL);
|
|
||||||
#define CHECK_RESET_FREE_MEM_CHECK(a,b) ESP_LOGV(__FUNCTION__ ,b "Mem used: %i",a-heap_caps_get_free_size(MALLOC_CAP_INTERNAL)); a=heap_caps_get_free_size(MALLOC_CAP_INTERNAL)
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ idf_component_register( SRC_DIRS .
|
|||||||
INCLUDE_DIRS . ${IDF_PATH}/components/esp_http_server/src ${IDF_PATH}/components/esp_http_server/src/port/esp32 ${IDF_PATH}/components/esp_http_server/src/util ${IDF_PATH}/components/esp_http_server/src/
|
INCLUDE_DIRS . ${IDF_PATH}/components/esp_http_server/src ${IDF_PATH}/components/esp_http_server/src/port/esp32 ${IDF_PATH}/components/esp_http_server/src/util ${IDF_PATH}/components/esp_http_server/src/
|
||||||
REQUIRES squeezelite-ota json mdns
|
REQUIRES squeezelite-ota json mdns
|
||||||
PRIV_REQUIRES tools services platform_config esp_common json newlib freertos spi_flash nvs_flash mdns pthread wpa_supplicant platform_console esp_http_server console
|
PRIV_REQUIRES tools services platform_config esp_common json newlib freertos spi_flash nvs_flash mdns pthread wpa_supplicant platform_console esp_http_server console
|
||||||
EMBED_FILES style.css code.js index.html bootstrap.min.css.gz jquery.min.js.gz popper.min.js.gz bootstrap.min.js.gz favicon.ico
|
EMBED_FILES res/style.css.gz res/code.js.gz index.html res/bootstrap.css.gz res/yeti/bootstrap.css.gz res/jquery.js.gz res/bootstrap.js.gz res/favicon.ico
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
650
components/wifi-manager/commands.json
Normal file
650
components/wifi-manager/commands.json
Normal file
@@ -0,0 +1,650 @@
|
|||||||
|
{
|
||||||
|
"commands": [{
|
||||||
|
"help": "Squeezelite Options",
|
||||||
|
"hascb": true,
|
||||||
|
"argtable": [{
|
||||||
|
"datatype": "<server>[:<port>]",
|
||||||
|
"glossary": "Connect to specified server, otherwise uses autodiscovery to find server",
|
||||||
|
"longopts": "server",
|
||||||
|
"shortopts": "s",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<stream>:<output>",
|
||||||
|
"glossary": "Internal Stream and Output buffer sizes in Kbytes",
|
||||||
|
"longopts": "buffers",
|
||||||
|
"shortopts": "b",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<codec1>,<codec2>",
|
||||||
|
"glossary": "Restrict codecs to those specified, otherwise load all available codecs; known codecs",
|
||||||
|
"longopts": "codecs",
|
||||||
|
"shortopts": "c",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 20
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Close output device when idle after timeout seconds, default is to keep it open while player is 'on",
|
||||||
|
"longopts": "timeout",
|
||||||
|
"shortopts": "C",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "log=level",
|
||||||
|
"glossary": "Set logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug",
|
||||||
|
"longopts": "loglevel",
|
||||||
|
"shortopts": "d",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<string>",
|
||||||
|
"glossary": "Output device",
|
||||||
|
"longopts": "output_device",
|
||||||
|
"shortopts": "o",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<string>",
|
||||||
|
"glossary": "Mac address, format: ab:cd:ef:12:34:56",
|
||||||
|
"longopts": "mac_addr",
|
||||||
|
"shortopts": "m",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<string>",
|
||||||
|
"glossary": "Squeezelite player model name sent to the server",
|
||||||
|
"longopts": "modelname",
|
||||||
|
"shortopts": "M",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<string>",
|
||||||
|
"glossary": "Player name",
|
||||||
|
"longopts": "name",
|
||||||
|
"shortopts": "n",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"glossary": "Read wave and aiff format from header, ignore server parameters",
|
||||||
|
"longopts": "header_format",
|
||||||
|
"shortopts": "W",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<rates>[:<delay>]",
|
||||||
|
"glossary": "Sample rates supported, allows output to be off when squeezelite is started; rates = <maxrate>|<minrate>-<maxrate>|<rate1>,<rate2>,<rate3>; delay = optional delay switching rates in ms\n",
|
||||||
|
"longopts": "rates",
|
||||||
|
"shortopts": "r",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Report rate to server in helo as the maximum sample rate we can support",
|
||||||
|
"longopts": "max_rate",
|
||||||
|
"shortopts": "Z",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}],
|
||||||
|
"hint": " [-W] [-s <server>[:<port>]] [-b <stream>:<output>] [-c <codec1>,<codec2>]... [-C <n>] [-d log=level] [-o <string>] [-m <string>] [-M <string>] [-n <string>] [-r <rates>[:<delay>]] [-Z <n>]",
|
||||||
|
"name": "cfg-syst-squeezelite"
|
||||||
|
}, {
|
||||||
|
"help": "DAC Options",
|
||||||
|
"hascb": true,
|
||||||
|
"argtable": [{
|
||||||
|
"datatype": "TAS57xx|TAS5713|AC101|I2S",
|
||||||
|
"glossary": "DAC Model Name",
|
||||||
|
"longopts": "model_name",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 1,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Clock GPIO. e.g. 33",
|
||||||
|
"longopts": "clock",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 1,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Word Select GPIO. e.g. 25",
|
||||||
|
"longopts": "wordselect",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 1,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Data GPIO. e.g. 32",
|
||||||
|
"longopts": "data",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 1,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Mute GPIO. e.g. 14",
|
||||||
|
"longopts": "mute_gpio",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"glossary": "Mute active GPIO level",
|
||||||
|
"longopts": "mute_level",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "SDA GPIO. e.g. 27",
|
||||||
|
"longopts": "dac_sda",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "SCL GPIO. e.g. 26",
|
||||||
|
"longopts": "dac_scl",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "I2C device address. e.g. 106",
|
||||||
|
"longopts": "dac_i2c",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"glossary": "Clear configuration",
|
||||||
|
"longopts": "clear",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}],
|
||||||
|
"hint": " --model_name=TAS57xx|TAS5713|AC101|I2S --clock=<n> --wordselect=<n> --data=<n> [--mute_gpio=<n>] [--mute_level] [--dac_sda=<n>] [--dac_scl=<n>] [--dac_i2c=<n>] [--clear]",
|
||||||
|
"name": "cfg-hw-dac"
|
||||||
|
}, {
|
||||||
|
"help": "Get the current size of free heap memory",
|
||||||
|
"hascb": false,
|
||||||
|
"name": "free"
|
||||||
|
}, {
|
||||||
|
"help": "Services",
|
||||||
|
"hascb": true,
|
||||||
|
"argtable": [{
|
||||||
|
"glossary": "Bluetooth Speaker",
|
||||||
|
"longopts": "BT_Speaker",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"glossary": "AirPlay",
|
||||||
|
"longopts": "AirPlay",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "Disabled|Telnet Only|Telnet and Serial",
|
||||||
|
"glossary": "Telnet server. Use only for troubleshooting",
|
||||||
|
"longopts": "telnet",
|
||||||
|
"shortopts": "t",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"glossary": "System Statistics. Use only for troubleshooting",
|
||||||
|
"longopts": "stats",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}],
|
||||||
|
"hint": " [--BT_Speaker] [--AirPlay] [-t Disabled|Telnet Only|Telnet and Serial] [--stats]",
|
||||||
|
"name": "cfg-syst-services"
|
||||||
|
}, {
|
||||||
|
"help": "Get minimum size of free heap memory found during execution",
|
||||||
|
"hascb": false,
|
||||||
|
"name": "heap"
|
||||||
|
}, {
|
||||||
|
"help": "Device Name",
|
||||||
|
"hascb": true,
|
||||||
|
"argtable": [{
|
||||||
|
"datatype": "\"squeezelite-test3\"",
|
||||||
|
"glossary": "New Name",
|
||||||
|
"longopts": "name",
|
||||||
|
"shortopts": "n",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}],
|
||||||
|
"hint": " [-n \"squeezelite-test3\"]",
|
||||||
|
"name": "cfg-syst-name"
|
||||||
|
}, {
|
||||||
|
"help": "Get version of chip and SDK",
|
||||||
|
"hascb": false,
|
||||||
|
"name": "version"
|
||||||
|
}, {
|
||||||
|
"help": "Software reset of the chip",
|
||||||
|
"hascb": false,
|
||||||
|
"name": "restart"
|
||||||
|
}, {
|
||||||
|
"help": "Resets and boot to recovery (if available)",
|
||||||
|
"hascb": false,
|
||||||
|
"name": "recovery"
|
||||||
|
}, {
|
||||||
|
"help": "Selects the ota app partition to boot from and performa a software reset of the chip",
|
||||||
|
"hascb": false,
|
||||||
|
"name": "restart_ota"
|
||||||
|
}, {
|
||||||
|
"help": "I2C Bus Parameters",
|
||||||
|
"hascb": true,
|
||||||
|
"argtable": [{
|
||||||
|
"datatype": "0|1",
|
||||||
|
"glossary": "Port",
|
||||||
|
"longopts": "port",
|
||||||
|
"shortopts": "p",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "int",
|
||||||
|
"glossary": "Frequency (Hz) e.g. 100000",
|
||||||
|
"longopts": "speed",
|
||||||
|
"shortopts": "f",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "SDA GPIO. e.g. 19",
|
||||||
|
"longopts": "sda",
|
||||||
|
"shortopts": "d",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "SCL GPIO. e.g. 18",
|
||||||
|
"longopts": "scl",
|
||||||
|
"shortopts": "c",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"glossary": "Load Existing Configuration",
|
||||||
|
"longopts": "load",
|
||||||
|
"shortopts": "l",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"glossary": "Clear configuration",
|
||||||
|
"longopts": "clear",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}],
|
||||||
|
"hint": " [-l] [-p 0|1] [-f int] [-d <n>] [-c <n>] [--clear]",
|
||||||
|
"name": "cfg-hw-i2c"
|
||||||
|
}, {
|
||||||
|
"help": "SPI Bus Parameters",
|
||||||
|
"hascb": true,
|
||||||
|
"argtable": [{
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Data GPIO",
|
||||||
|
"longopts": "data",
|
||||||
|
"shortopts": "d",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Clock GPIO",
|
||||||
|
"longopts": "clk",
|
||||||
|
"shortopts": "k",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "DC GPIO",
|
||||||
|
"longopts": "dc",
|
||||||
|
"shortopts": "c",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "int",
|
||||||
|
"glossary": "SPI Host Number",
|
||||||
|
"longopts": "host",
|
||||||
|
"shortopts": "h",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"glossary": "Clear configuration",
|
||||||
|
"longopts": "clear",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}],
|
||||||
|
"hint": " [-d <n>] [-k <n>] [-c <n>] [-h int] [--clear]",
|
||||||
|
"name": "cfg-hw-spi"
|
||||||
|
}, {
|
||||||
|
"help": "Scan I2C bus for devices",
|
||||||
|
"hascb": false,
|
||||||
|
"name": "i2cdetect"
|
||||||
|
}, {
|
||||||
|
"help": "Read registers visible through the I2C bus",
|
||||||
|
"hascb": false,
|
||||||
|
"argtable": [{
|
||||||
|
"datatype": "<chip_addr>",
|
||||||
|
"glossary": "Specify the address of the chip on that bus",
|
||||||
|
"longopts": "chip",
|
||||||
|
"shortopts": "c",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 1,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<register_addr>",
|
||||||
|
"glossary": "Specify the address on that chip to read from",
|
||||||
|
"longopts": "register",
|
||||||
|
"shortopts": "r",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<length>",
|
||||||
|
"glossary": "Specify the length to read from that data address",
|
||||||
|
"longopts": "length",
|
||||||
|
"shortopts": "l",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}],
|
||||||
|
"hint": " -c <chip_addr> [-r <register_addr>] [-l <length>]",
|
||||||
|
"name": "i2cget"
|
||||||
|
}, {
|
||||||
|
"help": "Set registers visible through the I2C bus",
|
||||||
|
"hascb": false,
|
||||||
|
"argtable": [{
|
||||||
|
"datatype": "<chip_addr>",
|
||||||
|
"glossary": "Specify the address of the chip on that bus",
|
||||||
|
"longopts": "chip",
|
||||||
|
"shortopts": "c",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 1,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Specify the i2c port (0|2)",
|
||||||
|
"longopts": "port",
|
||||||
|
"shortopts": "p",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<register_addr>",
|
||||||
|
"glossary": "Specify the address on that chip to read from",
|
||||||
|
"longopts": "register",
|
||||||
|
"shortopts": "r",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<data>",
|
||||||
|
"glossary": "Specify the data to write to that data address",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 256
|
||||||
|
}],
|
||||||
|
"hint": " -c <chip_addr> [-p <n>] [-r <register_addr>] [<data>]...",
|
||||||
|
"name": "i2cset"
|
||||||
|
}, {
|
||||||
|
"help": "Examine registers visible through the I2C bus",
|
||||||
|
"hascb": false,
|
||||||
|
"argtable": [{
|
||||||
|
"datatype": "<chip_addr>",
|
||||||
|
"glossary": "Specify the address of the chip on that bus",
|
||||||
|
"longopts": "chip",
|
||||||
|
"shortopts": "c",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 1,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<size>",
|
||||||
|
"glossary": "Specify the size of each read",
|
||||||
|
"longopts": "size",
|
||||||
|
"shortopts": "s",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}],
|
||||||
|
"hint": " -c <chip_addr> [-s <size>]",
|
||||||
|
"name": "i2cdump"
|
||||||
|
}, {
|
||||||
|
"help": "Display",
|
||||||
|
"hascb": true,
|
||||||
|
"argtable": [{
|
||||||
|
"datatype": "<I2C|SPI>",
|
||||||
|
"glossary": "Interface (default I2C)",
|
||||||
|
"longopts": "type",
|
||||||
|
"shortopts": "t",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<SH1106|SSD1306|SSD1322|SSD1326|SSD1327|SSD1675|SSD1351|ST77xx|ILI9341|>",
|
||||||
|
"glossary": "Driver (default SSD1306)",
|
||||||
|
"longopts": "driver",
|
||||||
|
"shortopts": "d",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "I2C address (default 60)",
|
||||||
|
"longopts": "address",
|
||||||
|
"shortopts": "a",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Width",
|
||||||
|
"longopts": "width",
|
||||||
|
"shortopts": "w",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Height",
|
||||||
|
"longopts": "height",
|
||||||
|
"shortopts": "h",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"glossary": "Rotate 180 degrees",
|
||||||
|
"longopts": "rotate",
|
||||||
|
"shortopts": "r",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"glossary": "Flip horizontally",
|
||||||
|
"longopts": "hf",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"glossary": "Flip vertically",
|
||||||
|
"longopts": "vf",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Bus Speed (Default 8000000 for SPI, 250000 for I2C). SPI interface can work up to 26MHz~40MHz",
|
||||||
|
"longopts": "speed",
|
||||||
|
"shortopts": "s",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"datatype": "<n>",
|
||||||
|
"glossary": "Backlight GPIO (if applicable)",
|
||||||
|
"longopts": "back",
|
||||||
|
"shortopts": "b",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}, {
|
||||||
|
"glossary": "clear configuration and return",
|
||||||
|
"longopts": "clear",
|
||||||
|
"checkbox": true,
|
||||||
|
"hasvalue": false,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}],
|
||||||
|
"hint": " [-r] [-t <I2C|SPI>] [-d <SH1106|SSD1306|SSD1322|SSD1326|SSD1327|SSD1675|SSD1351|ST77xx|ILI9341|>] [-a <n>] [-w <n>] [-h <n>] [--hf] [--vf] [-s <n>] [-b <n>] [--clear]",
|
||||||
|
"name": "cfg-hw-display"
|
||||||
|
}, {
|
||||||
|
"help": "Shows display options and global i2c configuration",
|
||||||
|
"hascb": false,
|
||||||
|
"name": "getdisplay"
|
||||||
|
}, {
|
||||||
|
"help": "Stop the I2C bus",
|
||||||
|
"hascb": false,
|
||||||
|
"argtable": [{
|
||||||
|
"datatype": "<0|1>",
|
||||||
|
"glossary": "I2C bus port number",
|
||||||
|
"longopts": "port",
|
||||||
|
"shortopts": "p",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}],
|
||||||
|
"hint": " [-p <0|1>]",
|
||||||
|
"name": "i2cstop"
|
||||||
|
}, {
|
||||||
|
"help": "Check if the I2C bus is installed",
|
||||||
|
"hascb": false,
|
||||||
|
"argtable": [{
|
||||||
|
"datatype": "<0|1>",
|
||||||
|
"glossary": "Set the I2C bus port number",
|
||||||
|
"longopts": "port",
|
||||||
|
"shortopts": "p",
|
||||||
|
"checkbox": false,
|
||||||
|
"hasvalue": true,
|
||||||
|
"mincount": 0,
|
||||||
|
"maxcount": 1
|
||||||
|
}],
|
||||||
|
"hint": " [-p <0|1>]",
|
||||||
|
"name": "i2ccheck"
|
||||||
|
}],
|
||||||
|
"values": {
|
||||||
|
"cfg-syst-squeezelite": {
|
||||||
|
"buffers": "500:2000",
|
||||||
|
"header_format": true,
|
||||||
|
"loglevel": "all=info",
|
||||||
|
"output_device": "I2S",
|
||||||
|
"name": "squeezelite",
|
||||||
|
"timeout": 30
|
||||||
|
},
|
||||||
|
"cfg-hw-dac": {
|
||||||
|
"model_name": "i2s"
|
||||||
|
},
|
||||||
|
"cfg-syst-services": {
|
||||||
|
"BT_Speaker": false,
|
||||||
|
"AirPlay": false,
|
||||||
|
"telnet": "Telnet and Serial",
|
||||||
|
"stats": true
|
||||||
|
},
|
||||||
|
"cfg-syst-name": {
|
||||||
|
"name": "\"squeezelite-test3\""
|
||||||
|
},
|
||||||
|
"cfg-hw-i2c": {
|
||||||
|
"freq": 400000
|
||||||
|
},
|
||||||
|
"cfg-hw-spi": {
|
||||||
|
},
|
||||||
|
"cfg-hw-display": {
|
||||||
|
"address": 0,
|
||||||
|
"width": 0,
|
||||||
|
"height": 0,
|
||||||
|
"driver": "SSD1306",
|
||||||
|
"hf": false,
|
||||||
|
"vf": false,
|
||||||
|
"rotate": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
343
components/wifi-manager/config.json
Normal file
343
components/wifi-manager/config.json
Normal file
@@ -0,0 +1,343 @@
|
|||||||
|
{
|
||||||
|
"gpio": [
|
||||||
|
{
|
||||||
|
"gpio": 33,
|
||||||
|
"name": "bck",
|
||||||
|
"group": "spdif",
|
||||||
|
"fixed": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": 25,
|
||||||
|
"name": "ws",
|
||||||
|
"group": "spdif",
|
||||||
|
"fixed": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": 15,
|
||||||
|
"name": "do",
|
||||||
|
"group": "spdif",
|
||||||
|
"fixed": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": -1,
|
||||||
|
"name": "bck",
|
||||||
|
"group": "dac",
|
||||||
|
"fixed": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": -1,
|
||||||
|
"name": "ws",
|
||||||
|
"group": "dac",
|
||||||
|
"fixed": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": -1,
|
||||||
|
"name": "do",
|
||||||
|
"group": "dac",
|
||||||
|
"fixed": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": -1,
|
||||||
|
"name": "sda",
|
||||||
|
"group": "dac",
|
||||||
|
"fixed": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": -1,
|
||||||
|
"name": "scl",
|
||||||
|
"group": "dac",
|
||||||
|
"fixed": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": -1,
|
||||||
|
"name": "mute",
|
||||||
|
"group": "dac",
|
||||||
|
"fixed": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": 17,
|
||||||
|
"name": "clk",
|
||||||
|
"group": "psram",
|
||||||
|
"fixed": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": 16,
|
||||||
|
"name": "cs",
|
||||||
|
"group": "psram",
|
||||||
|
"fixed": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": 7,
|
||||||
|
"name": "spiq_sd0_io",
|
||||||
|
"group": "psram",
|
||||||
|
"fixed": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": 8,
|
||||||
|
"name": "spid_sd1_io",
|
||||||
|
"group": "psram",
|
||||||
|
"fixed": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": 10,
|
||||||
|
"name": "spiwp_sd3_io",
|
||||||
|
"group": "psram",
|
||||||
|
"fixed": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": 9,
|
||||||
|
"name": "spihd_sd2_io",
|
||||||
|
"group": "psram",
|
||||||
|
"fixed": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": 6,
|
||||||
|
"name": "clk",
|
||||||
|
"group": "flash",
|
||||||
|
"fixed": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gpio": 11,
|
||||||
|
"name": "cs",
|
||||||
|
"group": "flash",
|
||||||
|
"fixed": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"config": {
|
||||||
|
"a2dp_sink_name": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "SMSL BT4.2",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"a2dp_ctmt": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "1000",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"a2dp_ctrld": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "500",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"bt_sink_pin": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "1234",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"release_url": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "https://github.com/sle118/squeezelite-esp32/releases",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"ap_ip_address": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "192.168.4.1",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"ap_ip_gateway": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "192.168.4.1",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"ap_ip_netmask": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "255.255.255.0",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"ap_channel": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "1",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"ap_pwd": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "squeezelite",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"airplay_port": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "5000",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"bypass_wm": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "0",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"actrls_config": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"lms_ctrls_raw": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "n",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"rotary_config": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"ota_erase_blk": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "249856",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"ota_stack": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "10240",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"ota_prio": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "6",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"display_config": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"i2c_config": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"spi_config": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"set_GPIO": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"led_brightness": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"dac_config": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"dac_controlset": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"jack_mutes_amp": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "n",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"bat_config": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"metadata_config": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"telnet_buffer": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "40000",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"telnet_block": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "500",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"spdif_config": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "bck=33,ws=25,do=15",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"enable_bt_sink": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "N",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"enable_airplay": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "N",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"wifi_smode": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "a",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"disable_ps": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "n",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"stats": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "Y",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"autoexec": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "1",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"autoexec1_spdif": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "squeezelite -b 500:2000 -d all=info -C 30 -W -n \"squeezelite-test3\" -o SPDIF -Z 192000",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"autoexec1_i2s": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "squeezelite -b 500:2000 -d all=info -C 30 -W -n \"squeezelite-test3\" -o I2S",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"autoexec1_bt": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "squeezelite -b 500:2000 -d all=info -C 30 -W -n \"squeezelite-test3\" -o \"BT -n 'test'\" -Z 192000",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"autoexec1": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "squeezelite -b 500:2000 -d all=info -C 30 -W -n \"squeezelite-test3\" -o \"BT -n 'test'\" -Z 192000",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"bt_name": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "squeezelite-test3",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"host_name": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "squeezelite-test3",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"airplay_name": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "squeezelite-test3",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"ap_ssid": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "squeezelite-test3",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"a2dp_dev_name": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "squeezelite-test3",
|
||||||
|
"chg": false
|
||||||
|
},
|
||||||
|
"telnet_enable": {
|
||||||
|
"type": 33,
|
||||||
|
"value": "D",
|
||||||
|
"chg": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -89,18 +89,18 @@ static const char redirect_payload3[]="'>here</a> to login.</p></body></html>";
|
|||||||
* @see file "component.mk"
|
* @see file "component.mk"
|
||||||
* @see https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html#embedding-binary-data
|
* @see https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html#embedding-binary-data
|
||||||
*/
|
*/
|
||||||
extern const uint8_t style_css_start[] asm("_binary_style_css_start");
|
extern const uint8_t style_css_start[] asm("_binary_style_css_gz_start");
|
||||||
extern const uint8_t style_css_end[] asm("_binary_style_css_end");
|
extern const uint8_t style_css_end[] asm("_binary_style_css_gz_end");
|
||||||
extern const uint8_t jquery_gz_start[] asm("_binary_jquery_min_js_gz_start");
|
extern const uint8_t jquery_gz_start[] asm("_binary_jquery_js_gz_start");
|
||||||
extern const uint8_t jquery_gz_end[] asm("_binary_jquery_min_js_gz_end");
|
extern const uint8_t jquery_gz_end[] asm("_binary_jquery_js_gz_end");
|
||||||
extern const uint8_t popper_gz_start[] asm("_binary_popper_min_js_gz_start");
|
// extern const uint8_t popper_gz_start[] asm("_binary_popper_min_js_gz_start");
|
||||||
extern const uint8_t popper_gz_end[] asm("_binary_popper_min_js_gz_end");
|
// extern const uint8_t popper_gz_end[] asm("_binary_popper_min_js_gz_end");
|
||||||
extern const uint8_t bootstrap_js_gz_start[] asm("_binary_bootstrap_min_js_gz_start");
|
extern const uint8_t bootstrap_js_gz_start[] asm("_binary_bootstrap_js_gz_start");
|
||||||
extern const uint8_t bootstrap_js_gz_end[] asm("_binary_bootstrap_min_js_gz_end");
|
extern const uint8_t bootstrap_js_gz_end[] asm("_binary_bootstrap_js_gz_end");
|
||||||
extern const uint8_t bootstrap_css_gz_start[] asm("_binary_bootstrap_min_css_gz_start");
|
extern const uint8_t bootstrap_css_gz_start[] asm("_binary_bootstrap_css_gz_start");
|
||||||
extern const uint8_t bootstrap_css_gz_end[] asm("_binary_bootstrap_min_css_gz_end");
|
extern const uint8_t bootstrap_css_gz_end[] asm("_binary_bootstrap_css_gz_end");
|
||||||
extern const uint8_t code_js_start[] asm("_binary_code_js_start");
|
extern const uint8_t code_js_start[] asm("_binary_code_js_gz_start");
|
||||||
extern const uint8_t code_js_end[] asm("_binary_code_js_end");
|
extern const uint8_t code_js_end[] asm("_binary_code_js_gz_end");
|
||||||
extern const uint8_t index_html_start[] asm("_binary_index_html_start");
|
extern const uint8_t index_html_start[] asm("_binary_index_html_start");
|
||||||
extern const uint8_t index_html_end[] asm("_binary_index_html_end");
|
extern const uint8_t index_html_end[] asm("_binary_index_html_end");
|
||||||
extern const uint8_t favicon_ico_start[] asm("_binary_favicon_ico_start");
|
extern const uint8_t favicon_ico_start[] asm("_binary_favicon_ico_start");
|
||||||
@@ -232,31 +232,31 @@ bool is_captive_portal_host_name(httpd_req_t *req){
|
|||||||
/* Custom function to free context */
|
/* Custom function to free context */
|
||||||
void free_ctx_func(void *ctx)
|
void free_ctx_func(void *ctx)
|
||||||
{
|
{
|
||||||
START_FREE_MEM_CHECK(ff);
|
|
||||||
session_context_t * context = (session_context_t *)ctx;
|
session_context_t * context = (session_context_t *)ctx;
|
||||||
if(context){
|
if(context){
|
||||||
ESP_LOGD(TAG, "Freeing up socket context");
|
ESP_LOGD(TAG, "Freeing up socket context");
|
||||||
FREE_AND_NULL(context->auth_token);
|
FREE_AND_NULL(context->auth_token);
|
||||||
FREE_AND_NULL(context->sess_ip_address);
|
FREE_AND_NULL(context->sess_ip_address);
|
||||||
free(context);
|
free(context);
|
||||||
CHECK_RESET_FREE_MEM_CHECK(ff,"free_ctx");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
session_context_t* get_session_context(httpd_req_t *req){
|
session_context_t* get_session_context(httpd_req_t *req){
|
||||||
START_FREE_MEM_CHECK(ff);
|
bool newConnection=false;
|
||||||
if (! req->sess_ctx) {
|
if (! req->sess_ctx) {
|
||||||
ESP_LOGD(TAG,"New connection context. Allocating session buffer");
|
ESP_LOGD(TAG,"New connection context. Allocating session buffer");
|
||||||
req->sess_ctx = malloc(sizeof(session_context_t));
|
req->sess_ctx = malloc(sizeof(session_context_t));
|
||||||
memset(req->sess_ctx,0x00,sizeof(session_context_t));
|
memset(req->sess_ctx,0x00,sizeof(session_context_t));
|
||||||
req->free_ctx = free_ctx_func;
|
req->free_ctx = free_ctx_func;
|
||||||
|
newConnection = true;
|
||||||
// get the remote IP address only once per session
|
// get the remote IP address only once per session
|
||||||
}
|
}
|
||||||
session_context_t *ctx_data = (session_context_t*)req->sess_ctx;
|
session_context_t *ctx_data = (session_context_t*)req->sess_ctx;
|
||||||
FREE_AND_NULL(ctx_data->sess_ip_address);
|
FREE_AND_NULL(ctx_data->sess_ip_address);
|
||||||
ctx_data->sess_ip_address = http_alloc_get_socket_address(req, 0, &ctx_data->port);
|
ctx_data->sess_ip_address = http_alloc_get_socket_address(req, 0, &ctx_data->port);
|
||||||
ESP_LOGD_LOC(TAG, "serving %s to peer %s port %u", req->uri, ctx_data->sess_ip_address , ctx_data->port);
|
if(newConnection){
|
||||||
CHECK_RESET_FREE_MEM_CHECK(ff,"get sess context");
|
ESP_LOGI(TAG, "serving %s to peer %s port %u", req->uri, ctx_data->sess_ip_address , ctx_data->port);
|
||||||
|
}
|
||||||
return (session_context_t *)req->sess_ctx;
|
return (session_context_t *)req->sess_ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,11 +408,13 @@ esp_err_t resource_filehandler(httpd_req_t *req){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(strstr(filename, "code.js")) {
|
if(strstr(filename, "code.js")) {
|
||||||
const size_t file_size = (code_js_end - code_js_start);
|
|
||||||
set_content_type_from_file(req, filename);
|
set_content_type_from_file(req, filename);
|
||||||
|
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||||
|
const size_t file_size = (code_js_end - code_js_start);
|
||||||
httpd_resp_send(req, (const char *)code_js_start, file_size);
|
httpd_resp_send(req, (const char *)code_js_start, file_size);
|
||||||
} else if(strstr(filename, "style.css")) {
|
} else if(strstr(filename, "style.css")) {
|
||||||
set_content_type_from_file(req, filename);
|
set_content_type_from_file(req, filename);
|
||||||
|
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||||
const size_t file_size = (style_css_end - style_css_start);
|
const size_t file_size = (style_css_end - style_css_start);
|
||||||
httpd_resp_send(req, (const char *)style_css_start, file_size);
|
httpd_resp_send(req, (const char *)style_css_start, file_size);
|
||||||
} else if(strstr(filename, "favicon.ico")) {
|
} else if(strstr(filename, "favicon.ico")) {
|
||||||
@@ -424,11 +426,11 @@ esp_err_t resource_filehandler(httpd_req_t *req){
|
|||||||
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||||
const size_t file_size = (jquery_gz_end - jquery_gz_start);
|
const size_t file_size = (jquery_gz_end - jquery_gz_start);
|
||||||
httpd_resp_send(req, (const char *)jquery_gz_start, file_size);
|
httpd_resp_send(req, (const char *)jquery_gz_start, file_size);
|
||||||
} else if(strstr(filename, "popper.js")) {
|
// } else if(strstr(filename, "popper.js")) {
|
||||||
set_content_type_from_file(req, filename);
|
// set_content_type_from_file(req, filename);
|
||||||
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
// httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||||
const size_t file_size = (popper_gz_end - popper_gz_start);
|
// const size_t file_size = (popper_gz_end - popper_gz_start);
|
||||||
httpd_resp_send(req, (const char *)popper_gz_start, file_size);
|
// httpd_resp_send(req, (const char *)popper_gz_start, file_size);
|
||||||
} else if(strstr(filename, "bootstrap.js")) {
|
} else if(strstr(filename, "bootstrap.js")) {
|
||||||
set_content_type_from_file(req, filename);
|
set_content_type_from_file(req, filename);
|
||||||
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||||
@@ -487,7 +489,8 @@ esp_err_t console_cmd_get_handler(httpd_req_t *req){
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
esp_err_t console_cmd_post_handler(httpd_req_t *req){
|
esp_err_t console_cmd_post_handler(httpd_req_t *req){
|
||||||
char success[]="{}";
|
char success[]="{\"Result\" : \"Success\" }";
|
||||||
|
char failed[]="{\"Result\" : \"Failed\" }";
|
||||||
ESP_LOGD_LOC(TAG, "serving [%s]", req->uri);
|
ESP_LOGD_LOC(TAG, "serving [%s]", req->uri);
|
||||||
//bool bOTA=false;
|
//bool bOTA=false;
|
||||||
//char * otaURL=NULL;
|
//char * otaURL=NULL;
|
||||||
@@ -522,14 +525,18 @@ esp_err_t console_cmd_post_handler(httpd_req_t *req){
|
|||||||
ESP_LOGE_LOC(TAG, "Command not found. Received content was: %s",command);
|
ESP_LOGE_LOC(TAG, "Command not found. Received content was: %s",command);
|
||||||
httpd_resp_send_err(req, HTTPD_400_BAD_REQUEST, "Malformed command json. Unable to parse content.");
|
httpd_resp_send_err(req, HTTPD_400_BAD_REQUEST, "Malformed command json. Unable to parse content.");
|
||||||
err = ESP_FAIL;
|
err = ESP_FAIL;
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// navigate to the first child of the config structure
|
// navigate to the first child of the config structure
|
||||||
run_command(cJSON_GetStringValue(item));
|
if(run_command(cJSON_GetStringValue(item))!=ESP_OK){
|
||||||
|
httpd_resp_send(req, (const char *)failed, strlen(failed));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
httpd_resp_send(req, (const char *)success, strlen(success));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
httpd_resp_send(req, (const char *)success, strlen(success));
|
|
||||||
|
|
||||||
ESP_LOGD_LOC(TAG, "done serving [%s]", req->uri);
|
ESP_LOGD_LOC(TAG, "done serving [%s]", req->uri);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@@ -1041,7 +1048,11 @@ esp_err_t redirect_processor(httpd_req_t *req, httpd_err_code_t error){
|
|||||||
bool connected_to_sta_ip_interface = false;
|
bool connected_to_sta_ip_interface = false;
|
||||||
bool useragentiscaptivenetwork = false;
|
bool useragentiscaptivenetwork = false;
|
||||||
|
|
||||||
ESP_LOGW_LOC(TAG, "Invalid URL requested: [%s]", req->uri);
|
in_port_t port=0;
|
||||||
|
ESP_LOGV_LOC(TAG, "Getting remote socket address");
|
||||||
|
remote_ip = http_alloc_get_socket_address(req,0, &port);
|
||||||
|
|
||||||
|
ESP_LOGW_LOC(TAG, "%s requested invalid URL: [%s]",remote_ip, req->uri);
|
||||||
if(wifi_manager_lock_sta_ip_string(portMAX_DELAY)){
|
if(wifi_manager_lock_sta_ip_string(portMAX_DELAY)){
|
||||||
sta_ip_address = strdup(wifi_manager_get_sta_ip_string());
|
sta_ip_address = strdup(wifi_manager_get_sta_ip_string());
|
||||||
wifi_manager_unlock_sta_ip_string();
|
wifi_manager_unlock_sta_ip_string();
|
||||||
@@ -1051,9 +1062,6 @@ esp_err_t redirect_processor(httpd_req_t *req, httpd_err_code_t error){
|
|||||||
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR , NULL);
|
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR , NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
in_port_t port=0;
|
|
||||||
ESP_LOGV_LOC(TAG, "Getting remote socket address");
|
|
||||||
remote_ip = http_alloc_get_socket_address(req,0, &port);
|
|
||||||
|
|
||||||
ESP_LOGV_LOC(TAG, "Getting host name from request");
|
ESP_LOGV_LOC(TAG, "Getting host name from request");
|
||||||
char *req_host = alloc_get_http_header(req, "Host");
|
char *req_host = alloc_get_http_header(req, "Host");
|
||||||
@@ -1128,34 +1136,24 @@ esp_err_t redirect_ev_handler(httpd_req_t *req){
|
|||||||
|
|
||||||
esp_err_t messages_get_handler(httpd_req_t *req){
|
esp_err_t messages_get_handler(httpd_req_t *req){
|
||||||
ESP_LOGD_LOC(TAG, "serving [%s]", req->uri);
|
ESP_LOGD_LOC(TAG, "serving [%s]", req->uri);
|
||||||
START_FREE_MEM_CHECK(before);
|
|
||||||
START_FREE_MEM_CHECK(all);
|
|
||||||
if(!is_user_authenticated(req)){
|
if(!is_user_authenticated(req)){
|
||||||
// todo: redirect to login page
|
// todo: redirect to login page
|
||||||
// return ESP_OK;
|
// return ESP_OK;
|
||||||
}
|
}
|
||||||
CHECK_RESET_FREE_MEM_CHECK(before, "after user auth");
|
|
||||||
esp_err_t err = set_content_type_from_req(req);
|
esp_err_t err = set_content_type_from_req(req);
|
||||||
if(err != ESP_OK){
|
if(err != ESP_OK){
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
CHECK_RESET_FREE_MEM_CHECK(before, "after set_content_type");
|
|
||||||
cJSON * json_messages= messaging_retrieve_messages(messaging);
|
cJSON * json_messages= messaging_retrieve_messages(messaging);
|
||||||
CHECK_RESET_FREE_MEM_CHECK(before, "after receiving messages");
|
|
||||||
if(json_messages!=NULL){
|
if(json_messages!=NULL){
|
||||||
char * json_text= cJSON_Print(json_messages);
|
char * json_text= cJSON_Print(json_messages);
|
||||||
CHECK_RESET_FREE_MEM_CHECK(before, "after json print");
|
|
||||||
httpd_resp_send(req, (const char *)json_text, strlen(json_text));
|
httpd_resp_send(req, (const char *)json_text, strlen(json_text));
|
||||||
CHECK_RESET_FREE_MEM_CHECK(before, "after http send");
|
|
||||||
free(json_text);
|
free(json_text);
|
||||||
CHECK_RESET_FREE_MEM_CHECK(before, "after free json message");
|
|
||||||
cJSON_Delete(json_messages);
|
cJSON_Delete(json_messages);
|
||||||
CHECK_RESET_FREE_MEM_CHECK(before, "after free json");
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR , "Unable to retrieve messages");
|
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR , "Unable to retrieve messages");
|
||||||
}
|
}
|
||||||
CHECK_RESET_FREE_MEM_CHECK(all, "before returning");
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="/res/favicon.ico">
|
|
||||||
<link rel="stylesheet" href="/res/bootstrap.css">
|
<link rel="stylesheet" href="/res/bootstrap.css">
|
||||||
<link rel="stylesheet" href="/res/style.css">
|
|
||||||
<script src="/res/jquery.js"></script>
|
<script src="/res/jquery.js"></script>
|
||||||
<script src="/res/popper.js"></script>
|
<link rel="shortcut icon" type="image/x-icon" href="/res/favicon.ico">
|
||||||
|
<link rel="stylesheet" href="/res/style.css">
|
||||||
|
<!-- <script src="/res/popper.js"></script> -->
|
||||||
<script src="/res/bootstrap.js"></script>
|
<script src="/res/bootstrap.js"></script>
|
||||||
<script src="/res/code.js"></script>
|
<script src="/res/code.js"></script>
|
||||||
<title>esp32-wifi-manager</title>
|
<title>esp32-wifi-manager</title>
|
||||||
@@ -52,36 +52,28 @@
|
|||||||
<path d="M19 8v8h-17v-8h17zm2-2h-21v12h21v-12zm1 9h.75c.69 0 1.25-.56 1.25-1.25v-3.5c0-.69-.56-1.25-1.25-1.25h-.75v6zm-16-6h-3v6h3v-6zm4 0h-3v6h3v-6zm4 0h-3v6h3v-6zm4 0h-3v6h3v-6z"/>
|
<path d="M19 8v8h-17v-8h17zm2-2h-21v12h21v-12zm1 9h.75c.69 0 1.25-.56 1.25-1.25v-3.5c0-.69-.56-1.25-1.25-1.25h-.75v6zm-16-6h-3v6h3v-6zm4 0h-3v6h3v-6zm4 0h-3v6h3v-6zm4 0h-3v6h3v-6z"/>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<ul id="navbar" class="nav nav-tabs">
|
<ul class="nav nav-tabs bg-primary" id="mainnav">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" data-toggle="tab" href="#tab-wifi">WiFi</a>
|
<a class="nav-link active" data-toggle="tab" href="#tab-wifi">WiFi</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="tab" href="#tab-audio">Audio + LMS</a>
|
<a class="nav-link" data-toggle="tab" href="#tab-configuration">Configuration</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="tab" href="#tab-firmware">Firmware</a>
|
<a class="nav-link" data-toggle="tab" href="#tab-syslog">Status<span class="badge badge-success badge-pill" id="msgcnt"></span></a>
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" data-toggle="tab" href="#tab-setdisplay">Configuration</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" data-toggle="tab" href="#tab-syslog">Status</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="tab" href="#tab-commands">Advanced</a>
|
<a class="nav-link" data-toggle="tab" href="#tab-commands">Advanced</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" data-toggle="tab" href="#tab-nvs">NVS editor</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="tab" href="#tab-credits">Credits</a>
|
<a class="nav-link" data-toggle="tab" href="#tab-credits">Credits</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="message"></div>
|
<div id="message"></div>
|
||||||
<div id="content">
|
<div id="content" >
|
||||||
<div id="myTabContent" class="tab-content">
|
<div id="myTabContent" class="tab-content mt-3">
|
||||||
<div class="tab-pane fade active show" id="tab-wifi">
|
<div class="tab-pane fade active show" id="tab-wifi">
|
||||||
<div id="wifi">
|
<div id="wifi">
|
||||||
<div id="wifi-status">
|
<div id="wifi-status">
|
||||||
@@ -205,119 +197,154 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- wifi -->
|
<!-- Config -->
|
||||||
<div class="tab-pane fade" id="tab-setdisplay">
|
<div class="tab-pane fade mt-2" id="tab-configuration">
|
||||||
<div id="set_services-list"></div>
|
<ul class="nav nav-tabs bg-info" name="secnav">
|
||||||
<div id="setname-list"></div>
|
<li class="nav-link" style="padding: inherit; border: none;">
|
||||||
<div id="setdisplay-list"></div>
|
<a class="nav-link active" data-toggle="tab" href="#tab-cfg-audio">Audio</a>
|
||||||
<div id="i2cconfig-list"></div>
|
</li>
|
||||||
<div id="spiconfig-list"></div>
|
<li class="nav-item">
|
||||||
</div>
|
<a class="nav-link" data-toggle="tab" href="#tab-cfg-syst">System</a>
|
||||||
<!-- display -->
|
</li>
|
||||||
<div class="tab-pane fade" id="tab-audio">
|
<li class="nav-item">
|
||||||
<div id="audioout">
|
<a class="nav-link" data-toggle="tab" href="#tab-cfg-hw" >Hardware</a>
|
||||||
<h1>Audio output</h1>
|
</li>
|
||||||
<div class="form-group">
|
<li class="nav-item">
|
||||||
<div class="custom-control custom-radio">
|
<a class="nav-link" data-toggle="tab" href="#tab-cfg-fw" >Updates</a>
|
||||||
<input type="radio" id="i2s" name="audio" class="custom-control-input" checked='checked' />
|
</li>
|
||||||
<label for="i2s" class="custom-control-label">I2S</label>
|
<li class="nav-item">
|
||||||
</div>
|
<a class="nav-link" data-toggle="tab" href="#tab-nvs">NVS editor</a>
|
||||||
<div class="custom-control custom-radio">
|
</li>
|
||||||
<input type="radio" id="spdif" name="audio" class="custom-control-input" />
|
</ul>
|
||||||
<label for="spdif" class="custom-control-label">SPDIF</label>
|
|
||||||
</div>
|
<div id="myTabContent2" class="tab-content mt-3">
|
||||||
<div class="custom-control custom-radio">
|
<div class="tab-pane fade" id="tab-cfg-hw"></div>
|
||||||
<input type="radio" id="bt" name="audio" class="custom-control-input" />
|
<div class="tab-pane fade" id="tab-cfg-syst"></div>
|
||||||
<label for="bt" class="custom-control-label">Bluetooth</label>
|
<div class="tab-pane fade" id="tab-cfg-gen"></div>
|
||||||
</div>
|
<div class="tab-pane fade" id="tab-cfg-fw">
|
||||||
|
<div id="boot-div">
|
||||||
|
<form id="boot-form" action="/recovery.json" method="post" target="dummyframe">
|
||||||
|
<button id="boot-button" type="submit" class="btn btn-primary">Recovery</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<h1>Check for firmware upgrade</h1>
|
||||||
|
<div class="buttons">
|
||||||
|
<input type="button" id="fwcheck" class="btn btn-info" value="Check for updates" />
|
||||||
|
</div>
|
||||||
|
<div id="searchfw" class="form-group">
|
||||||
|
<select class="custom-select" id="fwbranch">
|
||||||
|
<option selected="">Choose FW branch</option>
|
||||||
|
</select>
|
||||||
|
<input class="form-control form-control-sm" id="searchinput" type="text" placeholder="search releases" id="inputSmall">
|
||||||
|
</div>
|
||||||
|
<table class="table table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Firmware version</th>
|
||||||
|
<th scope="col">Release date</th>
|
||||||
|
<th scope="col">HW platform</th>
|
||||||
|
<th scope="col">IDF version</th>
|
||||||
|
<th scope="col">Branch</th>
|
||||||
|
<th scope="col">Flash this FW</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="releaseTable">
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h2>Firmware URL:</h2>
|
||||||
|
<textarea id="fwurl" maxlength="1000"></textarea>
|
||||||
|
<div class="buttons">
|
||||||
|
<input type="button" id="flash" class="btn btn-danger" value="Flash!" /><span id="flash-status"></span>
|
||||||
|
</div>
|
||||||
|
<p>OR</p>
|
||||||
|
<div class="form-group">
|
||||||
|
<input type="file" class="form-control-file" id="flashfilename" aria-describedby="fileHelp">
|
||||||
|
<div class="buttons">
|
||||||
|
<button type="button" class="btn btn-danger" id="fwUpload">Upload!</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="otadiv">
|
||||||
|
<div class="progress" id="progress">
|
||||||
|
<div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width:0%">
|
||||||
|
0%
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane fade" id="tab-nvs">
|
||||||
|
<table class="table table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Key</th>
|
||||||
|
<th scope="col">Value</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="nvsTable">
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="buttons">
|
||||||
|
<div id="boot-div">
|
||||||
|
<form id="reboot-form" action="/reboot.json" method="post" target="dummyframe">
|
||||||
|
<button id="reboot-button" type="submit" class="btn btn-primary">Reboot</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<input id="save-nvs" type="button" class="btn btn-success" value="Commit">
|
||||||
|
<input id="save-as-nvs" type="button" class="btn btn-success" value="Download config">
|
||||||
|
<input id="load-nvs" type="button" class="btn btn-success" value="Load File">
|
||||||
|
<input aria-describedby="fileHelp" onchange="onChooseFile(event, onFileLoad.bind(this))" id="nvsfilename" type="file" style="display:none">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div id="btsinkdiv">
|
<div class="tab-pane fade active show" id="tab-cfg-audio">
|
||||||
<input id="btsink" type="text" value="BT sink name" />
|
<div class="card text-white bg-primary mb-3">
|
||||||
</div>
|
<div class="card-header">Usage Templates</div>
|
||||||
<div>
|
<div class="card-body">
|
||||||
<h1>Player name</h1>
|
<fieldset >
|
||||||
<input id="player" type="text" value="squeezelite" />
|
<fieldset class="form-group" id="output-tmpl">
|
||||||
</div>
|
<legend>Output</legend>
|
||||||
<div>
|
<div class="form-check">
|
||||||
<h1>Optional setting (e.g. for LMS IP address)</h1>
|
<label class="form-check-label">
|
||||||
<input id="optional" type="text" value="" placeholder="-s 192.168.0.1" />
|
<input type="radio" class="form-check-input" name="output-tmpl" id="i2s" >
|
||||||
</div>
|
I2S Dac
|
||||||
<div class="buttons">
|
</label>
|
||||||
<input id="generate-command" type="button" class="btn btn-success" value="Generate" />
|
</div>
|
||||||
</div>
|
<div class="form-check">
|
||||||
<h1>Squeezelite command to run</h1>
|
<label class="form-check-label">
|
||||||
<section id="command-list">
|
<input type="radio" class="form-check-input" name="output-tmpl" id="spdif" >
|
||||||
<textarea id="autoexec1" maxlength="120">squeezelite -o I2S -b 500:2000 -d all=info -C 30 - W</textarea>
|
SPDIF
|
||||||
</section>
|
</label>
|
||||||
<div class="buttons">
|
</div>
|
||||||
<input id="save-autoexec1" type="button" class="btn btn-success" value="Save" />
|
<div class="form-check">
|
||||||
</div>
|
<label class="form-check-label">
|
||||||
<h1>Start Squeezelite (toggle to activate changes)</h1>
|
<input type="radio" class="form-check-input" name="output-tmpl" id="bt" >
|
||||||
<div class="custom-control custom-switch">
|
Bluetooth
|
||||||
<input type="checkbox" class="custom-control-input" id="autoexec-cb" checked="checked">
|
</label>
|
||||||
<label class="custom-control-label" for="autoexec-cb"></label>
|
</div>
|
||||||
</div>
|
</fieldset>
|
||||||
<br />
|
<div class="form-group"><label for="player">Player Name</label><input type="text" class="form-control " placeholder="Squeezelite" id="player" ></div>
|
||||||
</div>
|
<div class="form-group" style="display: none;"><label for="btsinkdiv">Bluetooth Speaker Name To Connect To</label><input type="text" class="form-control" id="btsinkdiv" ></div>
|
||||||
<!-- audio -->
|
<div class="form-group"><label for="optional">Optional setting (e.g. for LMS IP address)</label><input type="text" class="form-control" id="optional" ></div>
|
||||||
<div class="tab-pane fade" id="tab-firmware">
|
<div class="form-group"><div class="form-check">
|
||||||
<div id="boot-div">
|
<label class="form-check-label">
|
||||||
<form id="boot-form" action="/recovery.json" method="post" target="dummyframe">
|
<input class="form-check-input" type="checkbox" id="disable-squeezelite" value="" checked="" >
|
||||||
<button id="boot-button" type="submit" class="btn btn-primary">Recovery</button>
|
Disable Squeezelite
|
||||||
</form>
|
</label>
|
||||||
</div>
|
</div></div>
|
||||||
<h1>Check for firmware upgrade</h1>
|
<div class="toast show" role="alert" aria-live="assertive" aria-atomic="true" style="display: none;" id="toast_cfg-audio-tmpl"><div class="toast-header"><strong class="mr-auto">Result</strong><button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close" onclick="$(this).parent().parent().hide()"><span aria-hidden="true">×</span></button></div><div class="toast-body" id="msg_cfg-audio-tmpl"></div></div>
|
||||||
<div class="buttons">
|
<button id="save-autoexec1" type="submit" class="btn btn-info" cmdname="cfg-audio-tmpl" onclick="save_autoexec1(false)">Save</button>
|
||||||
<input type="button" id="fwcheck" class="btn btn-info" value="Check for updates" />
|
<button id="commit-autoexec1" type="submit" class="btn btn-warning" cmdname="cfg-audio-tmpl" onclick="save_autoexec1(true)">Apply</button>
|
||||||
</div>
|
</fieldset>
|
||||||
<div id="searchfw" class="form-group">
|
</div>
|
||||||
<select class="custom-select" id="fwbranch">
|
|
||||||
<option selected="">Choose FW branch</option>
|
|
||||||
</select>
|
|
||||||
<input class="form-control form-control-sm" id="searchinput" type="text" placeholder="search releases" id="inputSmall">
|
|
||||||
</div>
|
|
||||||
<table class="table table-hover">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">Firmware version</th>
|
|
||||||
<th scope="col">Release date</th>
|
|
||||||
<th scope="col">HW platform</th>
|
|
||||||
<th scope="col">IDF version</th>
|
|
||||||
<th scope="col">Branch</th>
|
|
||||||
<th scope="col">Flash this FW</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody id="releaseTable">
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<h2>Firmware URL:</h2>
|
|
||||||
<textarea id="fwurl" maxlength="1000"></textarea>
|
|
||||||
<div class="buttons">
|
|
||||||
<input type="button" id="flash" class="btn btn-danger" value="Flash!" /><span id="flash-status"></span>
|
|
||||||
</div>
|
|
||||||
<p>OR</p>
|
|
||||||
<div class="form-group">
|
|
||||||
<input type="file" class="form-control-file" id="flashfilename" aria-describedby="fileHelp">
|
|
||||||
<div class="buttons">
|
|
||||||
<button type="button" class="btn btn-danger" id="fwUpload">Upload!</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="otadiv">
|
|
||||||
<div class="progress" id="progress">
|
|
||||||
<div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width:0%">
|
|
||||||
0%
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- firmware -->
|
<div class="tab-pane fade " id="tab-commands">
|
||||||
<div class="tab-pane fade" id="tab-commands">
|
|
||||||
<fieldset id="commands-list"></fieldset>
|
<fieldset id="commands-list"></fieldset>
|
||||||
</div>
|
</div>
|
||||||
<!-- Status -->
|
<!-- Status -->
|
||||||
<div class="tab-pane fade" id="tab-syslog">
|
<div class="tab-pane fade " id="tab-syslog">
|
||||||
<div class="card border-primary mb-3" style="">
|
<div class="card border-primary mb-3" >
|
||||||
<div class="card-header">Logs</div>
|
<div class="card-header">Logs</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
@@ -333,40 +360,24 @@
|
|||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<input id="clear-syslog" type="button" class="btn btn-danger btn-sm" value="Clear" />
|
<input id="clear-syslog" type="button" class="btn btn-danger btn-sm" value="Clear" />
|
||||||
</div></div></div>
|
</div></div></div>
|
||||||
<div class="card border-primary mb-3" style="">
|
<div class="card border-primary mb-3">
|
||||||
<div class="card-header">Pin Assignments</div>
|
<div class="card-header">Pin Assignments</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead><tr><th scope="col">Device</th><th scope="col">Pin Name</th><th scope="col">GPIO Number</th><th scope="col">Type</th></tr></thead>
|
<thead><tr><th scope="col">Device</th><th scope="col">Pin Name</th><th scope="col">GPIO Number</th><th scope="col">Type</th></tr></thead>
|
||||||
<tbody id="gpiotable"></tbody></table></div></div></div>
|
<tbody id="gpiotable"></tbody></table></div></div>
|
||||||
<!-- syslog -->
|
<div class="card border-primary mb-3" style="visibility: collapse;" id="tasks_sect">
|
||||||
<div class="tab-pane fade" id="tab-nvs">
|
<div class="card-header">Tasks</div>
|
||||||
<table class="table table-hover">
|
<div class="card-body">
|
||||||
<thead>
|
<table class="table table-hover">
|
||||||
<tr>
|
<!-- console.log(msg_time.toLocaleString() + '\tname' + '\tcpu' + '\tstate' + '\tminstk' + '\tbprio' + '\tcprio' + '\tnum'); -->
|
||||||
<th scope="col">Key</th>
|
<thead><tr><th scope="col">#</th><th scope="col">Task Name</th><th scope="col">CPU</th><th scope="col">State</th><th scope="col">Min Stack</th><th scope="col">Base Priority</th><th scope="col">Cur Priority</th></tr></thead>
|
||||||
<th scope="col">Value</th>
|
<tbody id="tasks"></tbody></table></div></div>
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody id="nvsTable">
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="buttons">
|
|
||||||
<div id="boot-div">
|
|
||||||
<form id="reboot-form" action="/reboot.json" method="post" target="dummyframe">
|
|
||||||
<button id="reboot-button" type="submit" class="btn btn-primary">Reboot</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<input id="save-nvs" type="button" class="btn btn-success" value="Commit">
|
|
||||||
<input id="save-as-nvs" type="button" class="btn btn-success" value="Download config">
|
|
||||||
<input id="load-nvs" type="button" class="btn btn-success" value="Load File">
|
|
||||||
<input aria-describedby="fileHelp" onchange="onChooseFile(event, onFileLoad.bind(this))" id="nvsfilename" type="file" style="display:none">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- syslog -->
|
||||||
<!-- nvs -->
|
<div class="tab-pane fade " id="tab-credits">
|
||||||
<div class="tab-pane fade" id="tab-credits">
|
|
||||||
<div class="jumbotron">
|
<div class="jumbotron">
|
||||||
<p><strong><a href="https://github.com/sle118/squeezelite-esp32">squeezelite-esp32</a></strong>, © 2020, philippe44, sle118, daduke<br />Licensed under the GPL</p>
|
<p><strong><a href="https://github.com/sle118/squeezelite-esp32">squeezelite-esp32</a></strong>, © 2020, philippe44, sle118, daduke<br /><a href="https://opensource.org/licenses/MIT">This software is released under the MIT License.</a></p>
|
||||||
<p>
|
<p>
|
||||||
This app would not be possible without the following libraries:
|
This app would not be possible without the following libraries:
|
||||||
</p>
|
</p>
|
||||||
@@ -393,7 +404,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- credits -->
|
<!-- credits -->
|
||||||
</div>
|
</div>
|
||||||
<footer class="footer"><span id="foot-fw"></span><span id="foot-wifi"></span></footer>
|
<footer class="footer">
|
||||||
|
<button class="btn-warning" id="reboot_nav" type="submit" onclick="$('#reboot_nav').removeClass('active'); delay_reboot(500,'', false);" style="display: none;">Reboot</button>
|
||||||
|
<button class="btn-danger" id="reboot_ota_nav" type="submit" onclick="$('#reboot_ota_nav').removeClass('active'); delay_reboot(500,'', true);" style="display: none;">Exit Recovery</button><br>
|
||||||
|
<span id="foot-fw"></span><span id="foot-wifi"></span></footer>
|
||||||
<iframe width="0" height="0" border="0" name="dummyframe" id="dummyframe"></iframe>
|
<iframe width="0" height="0" border="0" name="dummyframe" id="dummyframe"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,29 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2017-2019 Tony Pottier
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
@file main.c
|
|
||||||
@author Tony Pottier
|
|
||||||
@brief Entry point for the ESP32 application.
|
|
||||||
@see https://idyl.io
|
|
||||||
@see https://github.com/tonyp7/esp32-wifi-manager
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
56
components/wifi-manager/messages.json
Normal file
56
components/wifi-manager/messages.json
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
[{
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":184520,\"free_spiram\":4048492,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":3468,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":2,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 61257,
|
||||||
|
"current_time": 147316
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183992,\"free_spiram\":4048488,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":3468,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 71255,
|
||||||
|
"current_time": 147317
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183992,\"free_spiram\":4048492,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 81256,
|
||||||
|
"current_time": 147317
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183992,\"free_spiram\":4048488,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 91255,
|
||||||
|
"current_time": 147317
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183992,\"free_spiram\":4048492,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 101255,
|
||||||
|
"current_time": 147317
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183992,\"free_spiram\":4048488,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":98,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 111255,
|
||||||
|
"current_time": 147318
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183992,\"free_spiram\":4048492,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 121256,
|
||||||
|
"current_time": 147318
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183872,\"free_spiram\":4048488,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 131255,
|
||||||
|
"current_time": 147318
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183872,\"free_spiram\":4048492,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 141256,
|
||||||
|
"current_time": 147319
|
||||||
|
}
|
||||||
|
]
|
||||||
90
components/wifi-manager/messages_testing.json
Normal file
90
components/wifi-manager/messages_testing.json
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
[{
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":184520,\"free_spiram\":4048492,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":3468,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":2,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 61257,
|
||||||
|
"current_time": 147316
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183992,\"free_spiram\":4048488,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":3468,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 71255,
|
||||||
|
"current_time": 147317
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183992,\"free_spiram\":4048492,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 81256,
|
||||||
|
"current_time": 147317
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183992,\"free_spiram\":4048488,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 91255,
|
||||||
|
"current_time": 147317
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183992,\"free_spiram\":4048492,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 101255,
|
||||||
|
"current_time": 147317
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183992,\"free_spiram\":4048488,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":98,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 111255,
|
||||||
|
"current_time": 147318
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183992,\"free_spiram\":4048492,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 121256,
|
||||||
|
"current_time": 147318
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183872,\"free_spiram\":4048488,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 131255,
|
||||||
|
"current_time": 147318
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":190232,\"min_free_iram\":183872,\"free_spiram\":4048492,\"min_free_spiram\":4026220,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":400,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":97,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":1580,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":0,\"minstk\":708,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":3436,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 141256,
|
||||||
|
"current_time": 147319
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"message": "Info Message",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_SYSTEM",
|
||||||
|
"sent_time": 3519,
|
||||||
|
"current_time": 24674
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"message": "Warning Message",
|
||||||
|
"type": "MESSAGING_WARNING",
|
||||||
|
"class": "MESSAGING_CLASS_SYSTEM",
|
||||||
|
"sent_time": 3519,
|
||||||
|
"current_time": 24674
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"message": "Warning Message",
|
||||||
|
"type": "MESSAGING_ERROR",
|
||||||
|
"class": "MESSAGING_CLASS_SYSTEM",
|
||||||
|
"sent_time": 3519,
|
||||||
|
"current_time": 24674
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"message": "{\"free_iram\":194144,\"min_free_iram\":185048,\"free_spiram\":4061372,\"min_free_spiram\":4050012,\"ntasks\":13,\"tasks\":[]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 11201,
|
||||||
|
"current_time": 24674
|
||||||
|
}, {
|
||||||
|
"message": "{\"free_iram\":193848,\"min_free_iram\":185048,\"free_spiram\":4049576,\"min_free_spiram\":4049576,\"ntasks\":13,\"tasks\":[{\"cpu\":0,\"minstk\":480,\"bprio\":1,\"cprio\":1,\"nme\":\"Tmr Svc\",\"st\":1,\"num\":8},{\"cpu\":99,\"minstk\":1000,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE1\",\"st\":1,\"num\":7},{\"cpu\":98,\"minstk\":992,\"bprio\":0,\"cprio\":0,\"nme\":\"IDLE0\",\"st\":1,\"num\":6},{\"cpu\":0,\"minstk\":2184,\"bprio\":18,\"cprio\":18,\"nme\":\"tiT\",\"st\":2,\"num\":12},{\"cpu\":0,\"minstk\":1948,\"bprio\":5,\"cprio\":5,\"nme\":\"console\",\"st\":2,\"num\":18},{\"cpu\":0,\"minstk\":528,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc0\",\"st\":2,\"num\":2},{\"cpu\":0,\"minstk\":676,\"bprio\":20,\"cprio\":20,\"nme\":\"sys_evt\",\"st\":2,\"num\":13},{\"cpu\":0,\"minstk\":2096,\"bprio\":5,\"cprio\":5,\"nme\":\"wifi_manager\",\"st\":2,\"num\":15},{\"cpu\":0,\"minstk\":3468,\"bprio\":22,\"cprio\":22,\"nme\":\"esp_timer\",\"st\":2,\"num\":1},{\"cpu\":0,\"minstk\":2524,\"bprio\":5,\"cprio\":5,\"nme\":\"httpd\",\"st\":2,\"num\":16},{\"cpu\":1,\"minstk\":868,\"bprio\":23,\"cprio\":23,\"nme\":\"wifi\",\"st\":2,\"num\":14},{\"cpu\":0,\"minstk\":536,\"bprio\":24,\"cprio\":24,\"nme\":\"ipc1\",\"st\":2,\"num\":3},{\"cpu\":0,\"minstk\":7244,\"bprio\":1,\"cprio\":1,\"nme\":\"telnet\",\"st\":2,\"num\":17}]}",
|
||||||
|
"type": "MESSAGING_INFO",
|
||||||
|
"class": "MESSAGING_CLASS_STATS",
|
||||||
|
"sent_time": 21267,
|
||||||
|
"current_time": 24674
|
||||||
|
}
|
||||||
|
]
|
||||||
Binary file not shown.
12
components/wifi-manager/res/bootstrap.css
vendored
Normal file
12
components/wifi-manager/res/bootstrap.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
components/wifi-manager/res/bootstrap.css.gz
Normal file
BIN
components/wifi-manager/res/bootstrap.css.gz
Normal file
Binary file not shown.
1
components/wifi-manager/res/bootstrap.css.map
Normal file
1
components/wifi-manager/res/bootstrap.css.map
Normal file
File diff suppressed because one or more lines are too long
7
components/wifi-manager/res/bootstrap.js
vendored
Normal file
7
components/wifi-manager/res/bootstrap.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
components/wifi-manager/res/bootstrap.js.gz
Normal file
BIN
components/wifi-manager/res/bootstrap.js.gz
Normal file
Binary file not shown.
1
components/wifi-manager/res/bootstrap.map
Normal file
1
components/wifi-manager/res/bootstrap.map
Normal file
File diff suppressed because one or more lines are too long
BIN
components/wifi-manager/res/bootstrap.map.gz
Normal file
BIN
components/wifi-manager/res/bootstrap.map.gz
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
components/wifi-manager/res/code.js.gz
Normal file
BIN
components/wifi-manager/res/code.js.gz
Normal file
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
BIN
components/wifi-manager/res/favicon.ico.gz
Normal file
BIN
components/wifi-manager/res/favicon.ico.gz
Normal file
Binary file not shown.
2
components/wifi-manager/res/jquery.js
vendored
Normal file
2
components/wifi-manager/res/jquery.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
components/wifi-manager/res/jquery.js.gz
Normal file
BIN
components/wifi-manager/res/jquery.js.gz
Normal file
Binary file not shown.
BIN
components/wifi-manager/res/style.css.gz
Normal file
BIN
components/wifi-manager/res/style.css.gz
Normal file
Binary file not shown.
1
components/wifi-manager/scan.json
Normal file
1
components/wifi-manager/scan.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"ssid":"zodmgbbq","ip":"192.168.1.119","netmask":"255.255.255.0","gw":"192.168.1.1","urc":0}
|
|
||||||
1
components/wifi-manager/status-messages.json
Normal file
1
components/wifi-manager/status-messages.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"project_name":"recovery","version":"custom.build","recovery":1,"Jack":"1","Voltage":0,"disconnect_count":0,"avg_conn_time":0,"is_i2c_locked":false,"urc":0,"ssid":"MyTestSSID","ip":"192.168.10.225","netmask":"255.255.255.0","gw":"192.168.10.1"}
|
||||||
15
components/wifi-manager/status.json
Normal file
15
components/wifi-manager/status.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"project_name": "recovery",
|
||||||
|
"version": "custom.build",
|
||||||
|
"recovery": 1,
|
||||||
|
"Jack": "1",
|
||||||
|
"Voltage": 0,
|
||||||
|
"disconnect_count": 0,
|
||||||
|
"avg_conn_time": 0,
|
||||||
|
"is_i2c_locked": false,
|
||||||
|
"urc": 0,
|
||||||
|
"ssid": "MyTestSSID",
|
||||||
|
"ip": "192.168.10.225",
|
||||||
|
"netmask": "255.255.255.0",
|
||||||
|
"gw": "192.168.10.1"
|
||||||
|
}
|
||||||
@@ -272,18 +272,18 @@ void wifi_manager_init_wifi(){
|
|||||||
ESP_LOGD(TAG, "Initializing wifi. Setting WiFi mode to WIFI_MODE_NULL");
|
ESP_LOGD(TAG, "Initializing wifi. Setting WiFi mode to WIFI_MODE_NULL");
|
||||||
ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_NULL) );
|
ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_NULL) );
|
||||||
ESP_LOGD(TAG, "Initializing wifi. Starting wifi");
|
ESP_LOGD(TAG, "Initializing wifi. Starting wifi");
|
||||||
char * disable_ps = config_alloc_get_default(NVS_TYPE_STR, "disable_ps", "n", 0);
|
// char * disable_ps = config_alloc_get_default(NVS_TYPE_STR, "disable_ps", "n", 0);
|
||||||
|
|
||||||
if (gpio36_39_used || (disable_ps && strcasecmp(disable_ps,"y")==0)) {
|
// if (gpio36_39_used || (disable_ps && strcasecmp(disable_ps,"y")==0)) {
|
||||||
if(gpio36_39_used){
|
// if(gpio36_39_used){
|
||||||
ESP_LOGW(TAG, "GPIO 36 or 39 are in use, need to disable WiFi PowerSave!");
|
// ESP_LOGW(TAG, "GPIO 36 or 39 are in use, need to disable WiFi PowerSave!");
|
||||||
}
|
// }
|
||||||
else {
|
// else {
|
||||||
ESP_LOGW(TAG, "wifi powersave config is disabled. Disabling WiFi PowerSave!");
|
// ESP_LOGW(TAG, "wifi powersave config is disabled. Disabling WiFi PowerSave!");
|
||||||
}
|
// }
|
||||||
esp_wifi_set_ps(WIFI_PS_NONE);
|
// esp_wifi_set_ps(WIFI_PS_NONE);
|
||||||
}
|
// }
|
||||||
FREE_AND_NULL(disable_ps);
|
// FREE_AND_NULL(disable_ps);
|
||||||
ESP_ERROR_CHECK( esp_wifi_start() );
|
ESP_ERROR_CHECK( esp_wifi_start() );
|
||||||
|
|
||||||
taskYIELD();
|
taskYIELD();
|
||||||
@@ -459,6 +459,7 @@ cJSON * wifi_manager_get_new_array_json(cJSON **old){
|
|||||||
return cJSON_CreateArray();
|
return cJSON_CreateArray();
|
||||||
}
|
}
|
||||||
cJSON * wifi_manager_get_basic_info(cJSON **old){
|
cJSON * wifi_manager_get_basic_info(cJSON **old){
|
||||||
|
monitor_gpio_t *mgpio= get_jack_insertion_gpio();
|
||||||
const esp_app_desc_t* desc = esp_ota_get_app_description();
|
const esp_app_desc_t* desc = esp_ota_get_app_description();
|
||||||
ESP_LOGV(TAG, "wifi_manager_get_basic_info called");
|
ESP_LOGV(TAG, "wifi_manager_get_basic_info called");
|
||||||
cJSON *root = wifi_manager_get_new_json(old);
|
cJSON *root = wifi_manager_get_new_json(old);
|
||||||
@@ -466,7 +467,7 @@ cJSON * wifi_manager_get_basic_info(cJSON **old){
|
|||||||
cJSON_AddItemToObject(root, "version", cJSON_CreateString(desc->version));
|
cJSON_AddItemToObject(root, "version", cJSON_CreateString(desc->version));
|
||||||
if(release_url !=NULL) cJSON_AddItemToObject(root, "release_url", cJSON_CreateString(release_url));
|
if(release_url !=NULL) cJSON_AddItemToObject(root, "release_url", cJSON_CreateString(release_url));
|
||||||
cJSON_AddNumberToObject(root,"recovery", is_recovery_running?1:0);
|
cJSON_AddNumberToObject(root,"recovery", is_recovery_running?1:0);
|
||||||
cJSON_AddItemToObject(root, "Jack", cJSON_CreateString(jack_inserted_svc() ? "1" : "0"));
|
cJSON_AddItemToObject(root, "Jack", cJSON_CreateString(mgpio->gpio>=0 && jack_inserted_svc() ? "1" : "0"));
|
||||||
cJSON_AddNumberToObject(root,"Voltage", battery_value_svc());
|
cJSON_AddNumberToObject(root,"Voltage", battery_value_svc());
|
||||||
cJSON_AddNumberToObject(root,"disconnect_count", num_disconnect );
|
cJSON_AddNumberToObject(root,"disconnect_count", num_disconnect );
|
||||||
cJSON_AddNumberToObject(root,"avg_conn_time", num_disconnect>0?(total_connected_time/num_disconnect):0 );
|
cJSON_AddNumberToObject(root,"avg_conn_time", num_disconnect>0?(total_connected_time/num_disconnect):0 );
|
||||||
@@ -1284,7 +1285,16 @@ void wifi_manager( void * pvParameters ){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ESP_LOGD(TAG, "MESSAGE: ORDER_CONNECT_STA - setting config for WIFI_IF_STA");
|
ESP_LOGD(TAG, "MESSAGE: ORDER_CONNECT_STA - setting config for WIFI_IF_STA");
|
||||||
if((err=esp_wifi_set_config(WIFI_IF_STA, wifi_manager_get_wifi_sta_config()))!=ESP_OK) {
|
wifi_config_t* cfg = wifi_manager_get_wifi_sta_config();
|
||||||
|
char * scan_mode = config_alloc_get_default(NVS_TYPE_STR, "wifi_smode", "f", 0);
|
||||||
|
if (scan_mode && strcasecmp(scan_mode,"a")==0) {
|
||||||
|
cfg->sta.scan_method=WIFI_ALL_CHANNEL_SCAN;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cfg->sta.scan_method=WIFI_FAST_SCAN;
|
||||||
|
}
|
||||||
|
FREE_AND_NULL(scan_mode);
|
||||||
|
if((err=esp_wifi_set_config(WIFI_IF_STA, cfg))!=ESP_OK) {
|
||||||
ESP_LOGE(TAG, "Failed to set STA configuration. Error %s",esp_err_to_name(err));
|
ESP_LOGE(TAG, "Failed to set STA configuration. Error %s",esp_err_to_name(err));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ extern "C" {
|
|||||||
* Value: WIFI_PS_MODEM for power save (wifi modem sleep periodically)
|
* Value: WIFI_PS_MODEM for power save (wifi modem sleep periodically)
|
||||||
* Note: Power save is only effective when in STA only mode
|
* Note: Power save is only effective when in STA only mode
|
||||||
*/
|
*/
|
||||||
#define DEFAULT_STA_POWER_SAVE WIFI_PS_NONE
|
#define DEFAULT_STA_POWER_SAVE WIFI_PS_MIN_MODEM
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Defines the maximum length in bytes of a JSON representation of an access point.
|
* @brief Defines the maximum length in bytes of a JSON representation of an access point.
|
||||||
|
|||||||
Binary file not shown.
@@ -92,11 +92,15 @@ sub init {
|
|||||||
|
|
||||||
$client->SUPER::init(@_);
|
$client->SUPER::init(@_);
|
||||||
$client->config_artwork;
|
$client->config_artwork;
|
||||||
}
|
$client->send_equalizer;
|
||||||
|
|
||||||
|
main::INFOLOG && $log->is_info && $log->info("SqueezeESP player connected: " . $client->id);
|
||||||
|
}
|
||||||
|
|
||||||
sub initPrefs {
|
sub initPrefs {
|
||||||
my $client = shift;
|
my $client = shift;
|
||||||
$sprefs->client($client)->init($defaultPrefs);
|
$sprefs->client($client)->init($defaultPrefs);
|
||||||
|
$prefs->client($client)->init( { equalizer => [(0) x 10] } );
|
||||||
$client->SUPER::initPrefs;
|
$client->SUPER::initPrefs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,6 +150,15 @@ sub treble {
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub send_equalizer {
|
||||||
|
my ($client, $equalizer) = @_;
|
||||||
|
|
||||||
|
$equalizer ||= $prefs->client($client)->get('equalizer') || [(0) x 10];
|
||||||
|
my $size = @$equalizer;
|
||||||
|
my $data = pack("c[$size]", @{$equalizer});
|
||||||
|
$client->sendFrame( eqlz => \$data );
|
||||||
|
}
|
||||||
|
|
||||||
sub update_equalizer {
|
sub update_equalizer {
|
||||||
my ($client, $value, $index) = @_;
|
my ($client, $value, $index) = @_;
|
||||||
return if $client->tone_update;
|
return if $client->tone_update;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ sub page {
|
|||||||
sub prefs {
|
sub prefs {
|
||||||
my ($class, $client) = @_;
|
my ($class, $client) = @_;
|
||||||
my @prefs;
|
my @prefs;
|
||||||
push @prefs, qw(width small_VU) if defined $client->displayWidth;
|
push @prefs, qw(width small_VU) if $client->displayWidth;
|
||||||
return ($prefs->client($client), @prefs);
|
return ($prefs->client($client), @prefs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ sub handler {
|
|||||||
my ($cprefs, @prefs) = $class->prefs($client);
|
my ($cprefs, @prefs) = $class->prefs($client);
|
||||||
|
|
||||||
if ($paramRef->{'saveSettings'}) {
|
if ($paramRef->{'saveSettings'}) {
|
||||||
if (defined $client->displayWidth) {
|
if ($client->displayWidth) {
|
||||||
$cprefs->set('small_VU', $paramRef->{'pref_small_VU'} || 15);
|
$cprefs->set('small_VU', $paramRef->{'pref_small_VU'} || 15);
|
||||||
my $spectrum = {
|
my $spectrum = {
|
||||||
scale => $paramRef->{'pref_spectrum_scale'} || 25,
|
scale => $paramRef->{'pref_spectrum_scale'} || 25,
|
||||||
@@ -76,7 +76,7 @@ sub handler {
|
|||||||
$client->update_tones($equalizer);
|
$client->update_tones($equalizer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined $client->displayWidth) {
|
if ($client->displayWidth) {
|
||||||
# the Settings super class can't handle anything but scalar values
|
# the Settings super class can't handle anything but scalar values
|
||||||
# we need to populate the $paramRef for the other prefs manually
|
# we need to populate the $paramRef for the other prefs manually
|
||||||
$paramRef->{'pref_spectrum'} = $cprefs->get('spectrum');
|
$paramRef->{'pref_spectrum'} = $cprefs->get('spectrum');
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ $prefs->migrateClient(1, sub {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$prefs->setChange(sub {
|
$prefs->setChange(sub {
|
||||||
send_equalizer($_[2]);
|
$_[2]->send_equalizer;
|
||||||
}, 'equalizer');
|
}, 'equalizer');
|
||||||
|
|
||||||
sub initPlugin {
|
sub initPlugin {
|
||||||
@@ -40,8 +40,10 @@ sub initPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$class->SUPER::initPlugin(@_);
|
$class->SUPER::initPlugin(@_);
|
||||||
Slim::Networking::Slimproto::addPlayerClass($class, 100, 'squeezeesp32', { client => 'Plugins::SqueezeESP32::Player', display => 'Plugins::SqueezeESP32::Graphics' });
|
# no name can be a subset of others due to a bug in addPlayerClass
|
||||||
main::INFOLOG && $log->is_info && $log->info("Added class 100 for SqueezeESP32");
|
Slim::Networking::Slimproto::addPlayerClass($class, 100, 'squeezeesp32-basic', { client => 'Plugins::SqueezeESP32::Player', display => 'Plugins::SqueezeESP32::Graphics' });
|
||||||
|
Slim::Networking::Slimproto::addPlayerClass($class, 101, 'squeezeesp32-graphic', { client => 'Plugins::SqueezeESP32::Player', display => 'Slim::Display::NoDisplay' });
|
||||||
|
main::INFOLOG && $log->is_info && $log->info("Added class 100 and 101 for SqueezeESP32");
|
||||||
|
|
||||||
# register a command to set the EQ - without saving the values! Send params as single comma separated list of values
|
# register a command to set the EQ - without saving the values! Send params as single comma separated list of values
|
||||||
Slim::Control::Request::addDispatch(['squeezeesp32', 'seteq', '_eq'], [1, 0, 0, \&setEQ]);
|
Slim::Control::Request::addDispatch(['squeezeesp32', 'seteq', '_eq'], [1, 0, 0, \&setEQ]);
|
||||||
@@ -50,9 +52,6 @@ sub initPlugin {
|
|||||||
Slim::Control::Request::subscribe( sub { onNotification(@_) }, [ ['newmetadata'] ] );
|
Slim::Control::Request::subscribe( sub { onNotification(@_) }, [ ['newmetadata'] ] );
|
||||||
Slim::Control::Request::subscribe( sub { onNotification(@_) }, [ ['playlist'], ['open', 'newsong'] ]);
|
Slim::Control::Request::subscribe( sub { onNotification(@_) }, [ ['playlist'], ['open', 'newsong'] ]);
|
||||||
Slim::Control::Request::subscribe( \&onStopClear, [ ['playlist'], ['stop', 'clear'] ]);
|
Slim::Control::Request::subscribe( \&onStopClear, [ ['playlist'], ['stop', 'clear'] ]);
|
||||||
|
|
||||||
# the custom player class is only initialized if it has a display - thus we need to listen to connect events in order to initializes other player prefs
|
|
||||||
Slim::Control::Request::subscribe( \&onPlayer,[ ['client'], [ 'new', 'reconnect' ] ] );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub onStopClear {
|
sub onStopClear {
|
||||||
@@ -64,20 +63,6 @@ sub onStopClear {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub onPlayer {
|
|
||||||
my $request = shift;
|
|
||||||
my $client = $request->client || return;
|
|
||||||
|
|
||||||
if ($client->model eq 'squeezeesp32') {
|
|
||||||
main::INFOLOG && $log->is_info && $log->info("SqueezeESP player connected: " . $client->id);
|
|
||||||
|
|
||||||
$prefs->client($client)->init( {
|
|
||||||
equalizer => [(0) x 10],
|
|
||||||
} );
|
|
||||||
send_equalizer($client);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub onNotification {
|
sub onNotification {
|
||||||
my $request = shift;
|
my $request = shift;
|
||||||
my $client = $request->client || return;
|
my $client = $request->client || return;
|
||||||
@@ -104,18 +89,7 @@ sub setEQ {
|
|||||||
$eqParams[$x] ||= 0;
|
$eqParams[$x] ||= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
send_equalizer($client, \@eqParams);
|
$client->send_equalizer(\@eqParams);
|
||||||
}
|
|
||||||
|
|
||||||
sub send_equalizer {
|
|
||||||
my ($client, $equalizer) = @_;
|
|
||||||
|
|
||||||
if ($client->model eq 'squeezeesp32') {
|
|
||||||
$equalizer ||= $prefs->client($client)->get('equalizer') || [(0) x 10];
|
|
||||||
my $size = @$equalizer;
|
|
||||||
my $data = pack("c[$size]", @{$equalizer});
|
|
||||||
$client->sendFrame( eqlz => \$data );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|||||||
@@ -10,6 +10,6 @@
|
|||||||
<name>PLUGIN_SQUEEZEESP32</name>
|
<name>PLUGIN_SQUEEZEESP32</name>
|
||||||
<description>PLUGIN_SQUEEZEESP32_DESC</description>
|
<description>PLUGIN_SQUEEZEESP32_DESC</description>
|
||||||
<module>Plugins::SqueezeESP32::Plugin</module>
|
<module>Plugins::SqueezeESP32::Plugin</module>
|
||||||
<version>0.104</version>
|
<version>0.200</version>
|
||||||
<creator>Philippe</creator>
|
<creator>Philippe</creator>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<?xml version='1.0' standalone='yes'?>
|
<?xml version='1.0' standalone='yes'?>
|
||||||
<extensions>
|
<extensions>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin version="0.104" name="SqueezeESP32" minTarget="7.9" maxTarget="*">
|
<plugin version="0.200" name="SqueezeESP32" minTarget="7.9" maxTarget="*">
|
||||||
<link>https://github.com/sle118/squeezelite-esp32</link>
|
<link>https://github.com/sle118/squeezelite-esp32</link>
|
||||||
<creator>Philippe</creator>
|
<creator>Philippe</creator>
|
||||||
<sha>79e505a30d7b6dbf43893acab176d57438e2a4a1</sha>
|
<sha>ab2d65f5ba8e73f0f78a1a8650af19ebb1e8e724</sha>
|
||||||
<email>philippe_44@outlook.com</email>
|
<email>philippe_44@outlook.com</email>
|
||||||
<desc lang="EN">SqueezeESP32 additional player id (100)</desc>
|
<desc lang="EN">SqueezeESP32 additional player id (100)</desc>
|
||||||
<url>http://github.com/sle118/squeezelite-esp32/raw/master/plugin/SqueezeESP32.zip</url>
|
<url>http://github.com/sle118/squeezelite-esp32/raw/master/plugin/SqueezeESP32.zip</url>
|
||||||
|
|||||||
19
test/CMakelists.txt
Normal file
19
test/CMakelists.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# This is the project CMakeLists.txt file for the test subproject
|
||||||
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
|
# Include the components directory of the main application:
|
||||||
|
#
|
||||||
|
set(EXTRA_COMPONENT_DIRS "../components")
|
||||||
|
|
||||||
|
# Set the components to include the tests for.
|
||||||
|
# This can be overriden from CMake cache:
|
||||||
|
# - when invoking CMake directly: cmake -D TEST_COMPONENTS="xxxxx" ..
|
||||||
|
# - when using idf.py: idf.py -T xxxxx build
|
||||||
|
#
|
||||||
|
set(TEST_COMPONENTS "platform_console" CACHE STRING "List of components to test")
|
||||||
|
|
||||||
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
|
project(squeezelite_esp32_test)
|
||||||
|
add_definitions(-include "${PROJECT_SOURCE_DIR}/../build/config/sdkconfig.h")
|
||||||
|
set_property(TARGET squeezelite_esp32_test.elf PROPERTY RECOVERY_PREFIX app_update )
|
||||||
|
|
||||||
2
test/main/CMakeLists.txt
Normal file
2
test/main/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
idf_component_register(SRCS "unit_tests.c"
|
||||||
|
INCLUDE_DIRS ".")
|
||||||
121
test/main/unit_tests.c
Normal file
121
test/main/unit_tests.c
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
/* Example test application for testable component.
|
||||||
|
|
||||||
|
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, this
|
||||||
|
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||||
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "unity.h"
|
||||||
|
/*
|
||||||
|
* Squeezelite for esp32
|
||||||
|
*
|
||||||
|
* (c) Sebastien 2019
|
||||||
|
* Philippe G. 2019, philippe_44@outlook.com
|
||||||
|
*
|
||||||
|
* This software is released under the MIT License.
|
||||||
|
* https://opensource.org/licenses/MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "platform_esp32.h"
|
||||||
|
#include "led.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "freertos/FreeRTOS.h"
|
||||||
|
#include "driver/gpio.h"
|
||||||
|
#include "driver/spi_master.h"
|
||||||
|
#include "freertos/task.h"
|
||||||
|
#include "esp_system.h"
|
||||||
|
#include "esp_spi_flash.h"
|
||||||
|
#include "esp_wifi.h"
|
||||||
|
#include "esp_system.h"
|
||||||
|
#include <esp_event.h>
|
||||||
|
#include "nvs_flash.h"
|
||||||
|
#include "esp_log.h"
|
||||||
|
#include "freertos/event_groups.h"
|
||||||
|
#include "mdns.h"
|
||||||
|
#include "lwip/api.h"
|
||||||
|
#include "lwip/err.h"
|
||||||
|
#include "lwip/netdb.h"
|
||||||
|
#include "nvs_utilities.h"
|
||||||
|
#include "trace.h"
|
||||||
|
#include "wifi_manager.h"
|
||||||
|
#include "squeezelite-ota.h"
|
||||||
|
#include <math.h>
|
||||||
|
#include "audio_controls.h"
|
||||||
|
#include "platform_config.h"
|
||||||
|
#include "telnet.h"
|
||||||
|
#include "messaging.h"
|
||||||
|
#include "gds.h"
|
||||||
|
#include "gds_default_if.h"
|
||||||
|
#include "gds_draw.h"
|
||||||
|
#include "gds_text.h"
|
||||||
|
#include "gds_font.h"
|
||||||
|
#include "display.h"
|
||||||
|
#include "accessors.h"
|
||||||
|
#include "cmd_system.h"
|
||||||
|
#include "cmd_config.h"
|
||||||
|
#include "cmd_i2ctools.h"
|
||||||
|
#include "cmd_nvs.h"
|
||||||
|
const char unknown_string_placeholder[] = "unknown";
|
||||||
|
const char null_string_placeholder[] = "null";
|
||||||
|
// as an exception _init function don't need include
|
||||||
|
extern void services_init(void);
|
||||||
|
const char * str_or_unknown(const char * str) { return (str?str:unknown_string_placeholder); }
|
||||||
|
const char * str_or_null(const char * str) { return (str?str:null_string_placeholder); }
|
||||||
|
bool is_recovery_running;
|
||||||
|
extern void initialize_console();
|
||||||
|
/* brief this is an exemple of a callback that you can setup in your own app to get notified of wifi manager event */
|
||||||
|
esp_err_t update_certificates(bool force){return ESP_OK; }
|
||||||
|
void init_commands(){
|
||||||
|
initialize_console();
|
||||||
|
/* Register commands */
|
||||||
|
register_system();
|
||||||
|
register_config_cmd();
|
||||||
|
register_nvs();
|
||||||
|
register_i2ctools();
|
||||||
|
}
|
||||||
|
void test_init()
|
||||||
|
{
|
||||||
|
const esp_partition_t *running = esp_ota_get_running_partition();
|
||||||
|
is_recovery_running = (running->subtype == ESP_PARTITION_SUBTYPE_APP_FACTORY);
|
||||||
|
initialize_nvs();
|
||||||
|
config_init();
|
||||||
|
services_init();
|
||||||
|
init_commands();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void print_banner(const char* text);
|
||||||
|
|
||||||
|
void app_main()
|
||||||
|
{
|
||||||
|
test_init();
|
||||||
|
print_banner("Running tests with [config] tag");
|
||||||
|
UNITY_BEGIN();
|
||||||
|
unity_run_tests_by_tag("[config]", false);
|
||||||
|
UNITY_END();
|
||||||
|
|
||||||
|
// print_banner("Running all the registered tests");
|
||||||
|
// UNITY_BEGIN();
|
||||||
|
// unity_run_all_tests();
|
||||||
|
// UNITY_END();
|
||||||
|
|
||||||
|
print_banner("Starting interactive test menu");
|
||||||
|
/* This function will not return, and will be busy waiting for UART input.
|
||||||
|
* Make sure that task watchdog is disabled if you use this function.
|
||||||
|
*/
|
||||||
|
unity_run_menu();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void print_banner(const char* text)
|
||||||
|
{
|
||||||
|
printf("\n#### %s #####\n\n", text);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
8
test/partitions.csv
Normal file
8
test/partitions.csv
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Name, Type, SubType, Offset, Size, Flags
|
||||||
|
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
|
||||||
|
nvs, data, nvs, 0x9000, 0x4000,
|
||||||
|
otadata, data, ota, 0xD000, 0x2000,
|
||||||
|
phy_init, data, phy, 0xF000, 0x1000,
|
||||||
|
recovery, app, factory, 0x10000, 0x140000,
|
||||||
|
ota_0, app, ota_0, , 0x2A0000,
|
||||||
|
settings, data, nvs, , 0x10000,
|
||||||
|
Reference in New Issue
Block a user