mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-07 20:17:04 +03:00
Compare commits
138 Commits
developmen
...
ESP32-A1S.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
369a9cb9bc | ||
|
|
b9deead084 | ||
|
|
723e7442af | ||
|
|
8189a59d59 | ||
|
|
cc209be4f9 | ||
|
|
1d9e8e863c | ||
|
|
c37fd57b2c | ||
|
|
54420387ab | ||
|
|
173b2d13da | ||
|
|
d60506c63f | ||
|
|
2d80c44181 | ||
|
|
eb5df86733 | ||
|
|
096e1d636d | ||
|
|
434836782c | ||
|
|
3b9e50ada7 | ||
|
|
78a16e41dc | ||
|
|
2bc4a8c807 | ||
|
|
c521fba4a6 | ||
|
|
174942f509 | ||
|
|
9bf7b250e0 | ||
|
|
32c2a4d68a | ||
|
|
64f96c68dc | ||
|
|
9807bf5476 | ||
|
|
5a630887c4 | ||
|
|
2a8fb902da | ||
|
|
08fcf84d6c | ||
|
|
d162996042 | ||
|
|
7bd8c842c8 | ||
|
|
fd9158e7c1 | ||
|
|
effd24ccd4 | ||
|
|
1c730905ec | ||
|
|
9a8991ebf2 | ||
|
|
014030513a | ||
|
|
bfb85271d4 | ||
|
|
7c13c130b8 | ||
|
|
1a3c888f44 | ||
|
|
90ee59754d | ||
|
|
c33c6187ca | ||
|
|
99019cd22f | ||
|
|
3dc2ed9629 | ||
|
|
99722a6f94 | ||
|
|
75580feaa0 | ||
|
|
2d573da503 | ||
|
|
2687023b6f | ||
|
|
0993186e01 | ||
|
|
ede495a145 | ||
|
|
c82ae71726 | ||
|
|
cd13577d93 | ||
|
|
1d24543359 | ||
|
|
08f04187ae | ||
|
|
8fbe1159f5 | ||
|
|
2c64f50093 | ||
|
|
cb646284c6 | ||
|
|
72c4f810fb | ||
|
|
6170f49673 | ||
|
|
d486a99aa1 | ||
|
|
f0bd81125b | ||
|
|
251882a400 | ||
|
|
0503d03e64 | ||
|
|
fed98f470f | ||
|
|
95d4dbc905 | ||
|
|
54b9da287f | ||
|
|
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 | ||
|
|
0c224b4b84 | ||
|
|
bbbc924fcd | ||
|
|
cc5fb49ff8 | ||
|
|
189bc763dd | ||
|
|
78b7639400 | ||
|
|
56954962a3 | ||
|
|
5ff673ae7d | ||
|
|
2eb995d621 | ||
|
|
573ddb6fda | ||
|
|
708a3f9c4a | ||
|
|
a73c659a1e | ||
|
|
b22143a3b6 | ||
|
|
6195750b41 | ||
|
|
889b1097cc | ||
|
|
41cdb8bcdd | ||
|
|
8c33acfd35 | ||
|
|
0222a34286 | ||
|
|
a90c9802ab | ||
|
|
94da8ca950 | ||
|
|
9a9a4fef65 | ||
|
|
3a7b1f48c7 | ||
|
|
a46bbb409f | ||
|
|
08d16c2ca2 | ||
|
|
b501352ddc | ||
|
|
1c51598366 | ||
|
|
db839a9ccd | ||
|
|
5aba426b98 | ||
|
|
6c184efa92 | ||
|
|
028a090864 |
148
.github/workflows/CrossBuild.yml
vendored
Normal file
148
.github/workflows/CrossBuild.yml
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: Cross-Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore: [ master ]
|
||||
pull_request:
|
||||
branches-ignore: [ master ]
|
||||
|
||||
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@v3
|
||||
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@v2
|
||||
with:
|
||||
path: 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}.${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="dev.${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 sle118/idf:release-v4.0 /bin/bash -c "cp build-scripts/${TARGET_BUILD_NAME}-sdkconfig.defaults sdkconfig && idf.py build && zip -r build_output.zip 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
|
||||
build_output.zip
|
||||
- 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
|
||||
if: env.release_flag == 1
|
||||
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
|
||||
if: env.release_flag == 1
|
||||
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
|
||||
67
.github/workflows/codeql-analysis.yml
vendored
Normal file
67
.github/workflows/codeql-analysis.yml
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master-cmake ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ master-cmake ]
|
||||
schedule:
|
||||
- cron: '19 12 * * 4'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'cpp', 'javascript', 'python']
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||
# Learn more:
|
||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
28
.gitignore
vendored
28
.gitignore
vendored
@@ -69,3 +69,31 @@ squeezelite-esp32-jsonblob.zip
|
||||
/flash_cmd.txt
|
||||
/writeSequeezeEsp.bat
|
||||
/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/
|
||||
|
||||
node_modules/*
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
set(EXTRA_COMPONENT_DIRS components/platform_console/app_recovery components/platform_console/app_squeezelite )
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
add_definitions(-DMODEL_NAME=SqueezeESP32)
|
||||
message(STATUS "Building RECOVERY")
|
||||
project(recovery)
|
||||
set_property(TARGET recovery.elf PROPERTY RECOVERY_PREFIX app_recovery )
|
||||
|
||||
include(squeezelite.cmake)
|
||||
|
||||
|
||||
set(PROJECT_VER $ENV{PROJECT_VER})
|
||||
|
||||
#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_DEBUG)
|
||||
|
||||
@@ -18,8 +18,6 @@ RUN wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a
|
||||
RUN tar -xzf xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
|
||||
RUN rm xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
|
||||
|
||||
# Patch I2S in esp-idf
|
||||
RUN cp /workspace/squeezelite-esp32/idf-patch/i2s.c /workspace/esp-idf/components/driver/i2s.c
|
||||
RUN rm -r /workspace/squeezelite-esp32
|
||||
RUN mkdir /workspace/squeezelite-esp32
|
||||
|
||||
|
||||
296
README.md
296
README.md
@@ -1,28 +1,77 @@
|
||||

|
||||
# Squeezelite-esp32
|
||||
## Supported Hardware
|
||||
### SqueezeAMP
|
||||
Works with the SqueezeAMP see [here](https://forums.slimdevices.com/showthread.php?110926-pre-ANNOUNCE-SqueezeAMP-and-SqueezeliteESP32) and [here](https://github.com/philippe44/SqueezeAMP/blob/master/README.md). Add repository https://raw.githubusercontent.com/sle118/squeezelite-esp32/master/plugin/repo.xml to LMS if you want to have a display
|
||||
## What is this
|
||||
Squeezelite-esp32 is an audio software suite made to run on espressif's ESP32 wifi (b/g/n) and bluetooth chipset. It offers the following capabilities
|
||||
|
||||
Use the `squeezelite-esp32-SqueezeAmp-sdkconfig.defaults` configuration file.
|
||||
- Stream your local music and connect to all major on-line music providers (Spotify, Deezer, Tidal, Qobuz) using [Logitech Media Server - a.k.a LMS](https://forums.slimdevices.com/) and enjoy multi-room audio synchronization. LMS can be extended by numerous plugins and can be controlled using a Web browser or dedicated applications (iPhone, Android). It can also send audio to UPnP, Sonos, ChromeCast and AirPlay speakers/devices.
|
||||
- Stream from a Bluetooth device (iPhone, Android)
|
||||
- Stream from an AirPlay controller (iPhone, iTunes ...) and enjoy synchronization multiroom as well (although it's AirPlay 1 only)
|
||||
|
||||
Depending on the hardware connected to the ESP32, you can send audio to a local DAC, to SPDIF or to a Bluetooth speaker. The bare minimum required hardware is a WROVER module with 4MB of Flash and 4MB of PSRAM (https://www.espressif.com/en/products/modules/esp32). With that module standalone, just apply power and you can stream to a Bluetooth speaker. You can also send audio to most I2S DAC as well as to SPDIF receivers using just a cable or an optical transducer (you'll need *one* resistor...)
|
||||
|
||||
But squeezelite-esp32 is highly extensible and you can add
|
||||
|
||||
- Buttons and Rotary Encoder and map/combine them to various functions (play, pause, volume, next ...)
|
||||
- IR receiver (no pullup resistor or capacitor needed, just the 38kHz receiver)
|
||||
- Monochrome, GrayScale or Color displays using SPI or I2S (supported drivers are SH1106, SSD1306, SSD1322, SSD1326/7, SSD1351, ST7735 and ST7789).
|
||||
|
||||
Other features include
|
||||
|
||||
- Resampling
|
||||
- 10-bands equalizer
|
||||
- Automatic initial setup using any WiFi device
|
||||
- Full web interface for further configuration/management
|
||||
- Firmware over-the-air update
|
||||
|
||||
## Supported Hardware
|
||||
Any esp32-based hardware with at least 4MB of flash and 4MB of PSRAM will be capable of running squeezelite-esp32 and there are various boards that include such chip. A few are mentionned below, but any should work. You can find various help & instructions [here](https://forums.slimdevices.com/showthread.php?112697-ANNOUNCE-Squeezelite-ESP32-(dedicated-thread))
|
||||
### Raw WROVER module
|
||||
Per above description, a [WROVER module](https://www.espressif.com/en/products/modules/esp32) is enough to run Squeezelite-esp32, but that requires a bit of tinkering to extend it to have analogue audio or hardware buttons (e.g.)
|
||||
|
||||
Please note that when sending to a Bluetooth speaker, then resampling *must* be enabled (using -R) option if you want to send audio with rate other than 44.1kHz. Similarly, when using SPDIF, only 44.1kHz and 48kHz are supported so you might have to enable resampling as well. If you connect a DAC, choice will depends on its capabilities. See below for more details.
|
||||
|
||||
Most DAC will work out-of-the-box with simply an I2S connection, but some require specific commands to be sent using I2C. See DAC option below to understand how to send these dedicated commands. There is build-in support for TAS575x, TAS5780, TAS5713 and AC101 DAC.
|
||||
### SqueezeAMP
|
||||
This is the main hardware companion of Squeezelite-esp32 and has been developped together. Details on capabilities can be found [here](https://forums.slimdevices.com/showthread.php?110926-pre-ANNOUNCE-SqueezeAMP-and-SqueezeliteESP32) and [here](https://github.com/philippe44/SqueezeAMP).
|
||||
|
||||
if you want to rebuild, use the `squeezelite-esp32-SqueezeAmp-sdkconfig.defaults` configuration file.
|
||||
|
||||
NB: You can use the pre-build binaries SqueezeAMP4MBFlash which has all the hardware I/O set properly. You can also use the generic binary I2S4MBFlash in which case the NVS parameters shall be set to get the exact same behavior
|
||||
- set_GPIO: 12=green,13=red,34=jack,2=spkfault
|
||||
- batt_config: channel=7,scale=20.24
|
||||
- dac_config: model=TAS57xx,bck=33,ws=25,do=32,sda=27,scl=26,mute=14:0
|
||||
- spdif_config: bck=33,ws=25,do=15
|
||||
|
||||
### ESP32-A1S
|
||||
Works with [ESP32-A1S](https://docs.ai-thinker.com/esp32-a1s) module that includes audio codec and headset output. You still need to use a demo board like [this](https://www.aliexpress.com/item/4000765857347.html?spm=2114.12010615.8148356.11.5d963cd0j669ns) or an external amplifier if you want direct speaker connection.
|
||||
|
||||
The board showed above has the following IO set
|
||||
The board shown above has the following IO set
|
||||
- amplifier: GPIO21
|
||||
- key2: GPIO13, key3: GPIO19, key4: GPIO23, key5: GPIO18, key6: GPIO5 (to be confirmed with dip switches)
|
||||
- key1: not sure, something with GPIO36
|
||||
- key1: not sure, using GPIO36 in a matrix
|
||||
- jack insertion: GPIO39 (inserted low)
|
||||
- LED: GPIO22 (active low)
|
||||
(note that GPIO need pullups)
|
||||
- D4 -> GPIO22 used for green LED (active low)
|
||||
- D5 -> GPIO19 (muxed with key3)
|
||||
- The IO connector also brings GPIO5, GPIO18, GPIO19, GPIO21, GPIO22 and GPIO23 (don't forget it's muxed with keys!)
|
||||
- The JTAG connector uses GPIO 12, 13, 14 and 15 (see dip switch) but these are also used for SD-card (and GPIO13 is key2 as well)
|
||||
- It's always possible to re-use GPIOO (download at boot) and GPIO1/GPIO3 which are RX/TX of UART0 but you'll lose trace
|
||||
|
||||
(note that some GPIO need pullups)
|
||||
|
||||
So a possible config would be
|
||||
- set_GPIO: 21=amp,22=green:0,39=jack:0
|
||||
- dac_config: model=AC101,bck=27,ws=26,do=25,di=35,sda=33,scl=32
|
||||
- a button mapping:
|
||||
```
|
||||
[{"gpio":5,"normal":{"pressed":"ACTRLS_TOGGLE"}},{"gpio":18,"pull":true,"shifter_gpio":5,"normal":{"pressed":"ACTRLS_VOLUP"}, "shifted":{"pressed":"ACTRLS_NEXT"}}, {"gpio":23,"pull":true,"shifter_gpio":5,"normal":{"pressed":"ACTRLS_VOLDOWN"},"shifted":{"pressed":"ACTRLS_PREV"}}]
|
||||
```
|
||||
### T-WATCH2020 by LilyGo
|
||||
This is a fun [smartwatch](http://www.lilygo.cn/prod_view.aspx?TypeId=50036&Id=1290&FId=t3:50036:3) based on ESP32. It has a 240x240 ST7789 screen and onboard audio. Not very useful to listen to anything but it works. This is an example of a device that requires an I2C set of commands for its dac (see below). There is a build-option if you decide to rebuild everything by yourself, otherwise the I2S default option works with the following parameters
|
||||
|
||||
- dac_config: model=I2S,bck=26,ws=25,do=33,i2c=106,sda=21,scl=22
|
||||
- dac_controlset: { "init": [ {"reg":41, "val":128}, {"reg":18, "val":255} ], "poweron": [ {"reg":18, "val":64, "mode":"or"} ], "poweroff": [ {"reg":18, "val":191, "mode":"and"} ] }
|
||||
- spi_config: dc=27,data=19,clk=18
|
||||
- display_config: SPI,driver=ST7789,width=240,height=240,cs=5,back=12,speed=16000000,HFlip,VFlip
|
||||
### ESP32-WROVER + I2S DAC
|
||||
Squeezelite-esp32 requires esp32 chipset and 4MB PSRAM. ESP32-WROVER meets these requirements. To get an audio output an I2S DAC can be used. Cheap PCM5102 I2S DACs work others may also work. PCM5012 DACs can be hooked up via:
|
||||
|
||||
@@ -41,6 +90,10 @@ XMT - 3.3V
|
||||
|
||||
Use the `squeezelite-esp32-I2S-4MFlash-sdkconfig.defaults` configuration file.
|
||||
|
||||
### SqueezeAmpToo !
|
||||
|
||||
And the super cool project https://github.com/rochuck/squeeze-amp-too
|
||||
|
||||
## Configuration
|
||||
To access NVS, in the webUI, go to credits and select "shows nvs editor". Go into the NVS editor tab to change NFS parameters. In syntax description below \<\> means a value while \[\] describe optional parameters.
|
||||
|
||||
@@ -53,12 +106,23 @@ sda=<gpio>,scl=<gpio>[,port=0|1][,speed=<speed>]
|
||||
The NVS parameter "spi_config" set the spi's gpio used for generic purpose (e.g. display). Leave it blank to disable SPI usage. The DC parameter is needed for displays. Syntax is
|
||||
```
|
||||
data=<gpio>,clk=<gpio>[,dc=<gpio>][,host=1|2]
|
||||
```
|
||||
```
|
||||
### DAC/I2S
|
||||
The NVS parameter "dac_config" set the gpio used for i2s communication with your DAC. You can define the defaults at compile time but nvs parameter takes precedence except for SqueezeAMP and A1S where these are forced at runtime. If your DAC also requires i2c, then you must go the re-compile route. Syntax is
|
||||
```
|
||||
bck=<gpio>,ws=<gpio>,do=<gpio>
|
||||
bck=<gpio>,ws=<gpio>,do=<gpio>[,mute=<gpio>[:0|1][,model=TAS57xx|TAS5713|AC101|I2S][,sda=<gpio>,scl=gpio[,i2c=<addr>]]
|
||||
```
|
||||
if "model" is not set or is not recognized, then default "I2S" is used. I2C parameters are optional an only needed if your dac requires an I2C control (See 'dac_controlset' below). Note that "i2c" parameters are decimal, hex notation is not allowed.
|
||||
|
||||
The parameter "dac_controlset" allows definition of simple commands to be sent over i2c for init, power on and off using a JSON syntax:
|
||||
```
|
||||
{ init: [ {"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}, ... {{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"} ],
|
||||
poweron: [ {"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}, ... {{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"} ],
|
||||
poweroff: [ {"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}, ... {{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"} ] }
|
||||
```
|
||||
This is standard JSON notation, so if you are not familiar with it, Google is your best friend. Be aware that the '...' means you can have as many entries as you want, it's not part of the syntax. Every section is optional, but it does not make sense to set i2c in the 'dac_config' parameter and not setting anything here. The parameter 'mode' allows to *or* the register with the value or to *and* it. Don't set 'mode' if you simply want to write. **Note that all values must be decimal**. You can use a validator like [this](https://jsonlint.com) to verify your syntax
|
||||
|
||||
NB: For well-known configuration, this is ignored
|
||||
### SPDIF
|
||||
The NVS parameter "spdif_config" sets the i2s's gpio needed for SPDIF.
|
||||
|
||||
@@ -70,16 +134,29 @@ Leave it blank to disable SPDIF usage, you can also define them at compile time
|
||||
```
|
||||
bck=<gpio>,ws=<gpio>,do=<gpio>
|
||||
```
|
||||
NB: For well-known configuration, this is ignored
|
||||
### Display
|
||||
The NVS parameter "display_config" sets the parameters for an optional display. Syntax is
|
||||
```
|
||||
I2C,width=<pixels>,height=<pixels>[address=<i2c_address>][,HFlip][,VFlip][driver=SSD1306|SSD1326|SH1106]
|
||||
SPI,width=<pixels>,height=<pixels>,cs=<gpio>[,speed=<speed>][,HFlip][,VFlip][driver=SSD1306|SSD1326|SH1106]
|
||||
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]]
|
||||
```
|
||||
- back: a LED backlight used by some older devices (ST7735). It is PWM controlled for brightness
|
||||
- reset: some display have a reset pin that is should normally be pulled up if unused
|
||||
- VFlip and HFlip are optional can be used to change display orientation
|
||||
- rotate: for non-square *drivers*, move to portrait mode. Note that *width* and *height* must be inverted then
|
||||
- Default speed is 8000000 (8MHz) but SPI can work up to 26MHz or even 40MHz
|
||||
- SH1106 is 128x64 monochrome I2C/SPI [here]((https://www.waveshare.com/wiki/1.3inch_OLED_HAT))
|
||||
- SSD1306 is 128x32 monochrome I2C/SPI [here](https://www.buydisplay.com/i2c-blue-0-91-inch-oled-display-module-128x32-arduino-raspberry-pi)
|
||||
- SSD1322 is 128x128 16-level grayscale SPI [here](https://www.amazon.com/gp/product/B079N1LLG8/ref=ox_sc_act_title_1?smid=A1N6DLY3NQK2VM&psc=1) - artwork can be up to 96x96 with vertical vu-meter/spectrum
|
||||
- SSD1351 is 128x128 65k/262k color SPI [here](https://www.waveshare.com/product/displays/lcd-oled/lcd-oled-3/1.5inch-rgb-oled-module.htm)
|
||||
- SSD1326 is 256x32 monochrome or grayscale 16-levels SPI [here](https://www.aliexpress.com/item/32833603664.html?spm=a2g0o.productlist.0.0.2d19776cyQvsBi&algo_pvid=c7a3db92-e019-4095-8a28-dfdf0a087f98&algo_expid=c7a3db92-e019-4095-8a28-dfdf0a087f98-1&btsid=0ab6f81e15955375483301352e4208&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_)
|
||||
- SSD1327 is 256x64 grayscale 16-levels SPI in multiple sizes [here](https://www.buydisplay.com/oled-display/oled-display-module?resolution=159) - it is very nice
|
||||
- SSD1675 is an e-ink paper and is experimental as e-ink is really not suitable for LMS du to its very low refresh rate
|
||||
- ST7735 is a 128x160 65k color SPI [here](https://www.waveshare.com/product/displays/lcd-oled/lcd-oled-3/1.8inch-lcd-module.htm). This needs a backlight control
|
||||
- ST7789 is a 240x320 65k (262k not enabled) color SPI [here](https://www.waveshare.com/product/displays/lcd-oled/lcd-oled-3/2inch-lcd-module.htm). It also exist with 240x240 displays. See **rotate** for use in portrait mode
|
||||
|
||||
Currently 128x32/64 I2C and SPI display like [this](https://www.buydisplay.com/i2c-blue-0-91-inch-oled-display-module-128x32-arduino-raspberry-pi) and [this](https://www.waveshare.com/wiki/1.3inch_OLED_HAT) are supported
|
||||
To use the display on LMS, add repository https://raw.githubusercontent.com/sle118/squeezelite-esp32/master/plugin/repo.xml. You will then be able to tweak how the vu-meter and spectrum analyzer are displayed, as well as size of artwork. You can also install the excellent plugin "Music Information Screen" which is super useful to tweak the layout.
|
||||
|
||||
The NVS parameter "metadata_config" sets how metadata is displayed for AirPlay and Bluetooth. Syntax is
|
||||
```
|
||||
@@ -91,8 +168,6 @@ The NVS parameter "metadata_config" sets how metadata is displayed for AirPlay a
|
||||
|
||||
- 'format' can contain free text and any of the 3 keywords %artist%, %album%, %title%. Using that format string, the keywords are replaced by their value to build the string to be displayed. Note that the plain text following a keyword that happens to be empty during playback of a track will be removed. For example, if you have set format=%artist% - %title% and there is no artist in the metadata then only <title> will be displayed not " - <title>".
|
||||
|
||||
You can install the excellent plugin "Music Information Screen" which is super useful to tweak the layout for these small displays.
|
||||
|
||||
### Infrared
|
||||
You can use any IR receiver compatible with NEC protocol (38KHz). Vcc, GND and output are the only pins that need to be connected, no pullup, no filtering capacitor, it's a straight connection.
|
||||
|
||||
@@ -103,11 +178,11 @@ In AirPlay and Bluetooth mode, only these native remotes are supported, I've not
|
||||
See "set GPIO" below to set the GPIO associated to infrared receiver (option "ir").
|
||||
|
||||
### Set GPIO
|
||||
The parameter "set_GPIO" is use to assign GPIO to various functions.
|
||||
The parameter "set_GPIO" is used to assign GPIO to various functions.
|
||||
|
||||
GPIO can be set to GND provide or Vcc at boot. This is convenient to power devices that consume less than 40mA from the side connector. Be careful because there is no conflict checks being made wrt which GPIO you're changing, so you might damage your board or create a conflict here.
|
||||
|
||||
The \<amp\> parameter can use used to assign a GPIO that will be set to 1 when playback starts. It will be reset to 0 when squeezelite becomes idle. The idle timeout is set on the squeezelite command line through -C \<timeout\>
|
||||
The \<amp\> parameter can use used to assign a GPIO that will be set to active level (default 1) when playback starts. It will be reset when squeezelite becomes idle. The idle timeout is set on the squeezelite command line through -C \<timeout\>
|
||||
|
||||
If you have an audio jack that supports insertion (use :0 or :1 to set the level when inserted), you can specify which GPIO it's connected to. Using the parameter jack_mutes_amp allows to mute the amp when headset (e.g.) is inserted.
|
||||
|
||||
@@ -118,23 +193,38 @@ The \<ir\> parameter set the GPIO associated to an IR receiver. No need to add p
|
||||
Syntax is:
|
||||
|
||||
```
|
||||
<gpio>=Vcc|GND|amp|ir|jack[:0|1]|green[:0|1]|red[:0|1]|spkfault[:0|1][,<repeated sequence for next GPIO>]
|
||||
<gpio>=Vcc|GND|amp[:1|0]|ir|jack[:0|1]|green[:0|1]|red[:0|1]|spkfault[:0|1][,<repeated sequence for next GPIO>]
|
||||
```
|
||||
You can define the defaults for jack, spkfault leds at compile time but nvs parameter takes precedence except for SqueezeAMP where these are forced at runtime.
|
||||
You can define the defaults for jack, spkfault leds at compile time but nvs parameter takes precedence except for well-known configurations where these are forced at runtime.
|
||||
### LED
|
||||
See §**set_GPIO** for how to set the green and red LEDs. In addition, their brightness can be controlled using the "led_brigthness" parameter. The syntax is
|
||||
```
|
||||
[green=0..100][,red=0..100]
|
||||
```
|
||||
NB: For well-known configuration, this is ignored
|
||||
### Rotary Encoder
|
||||
One rotary encoder is supported, quadrature shift with press. Such encoders usually have 2 pins for encoders (A and B), and common C that must be set to ground and an optional SW pin for press. A, B and SW must be pulled up, so automatic pull-up is provided by ESP32, but you can add your own resistors. A bit of filtering on A and B (~470nF) helps for debouncing which is not made by software.
|
||||
|
||||
Encoder is normally hard-coded to respectively knob left, right and push on LMS and to volume down/up/play toggle on BT and AirPlay. Using the option 'volume' makes it hard-coded to volume down/up/play toggle all the time (even in LMS). The option 'longpress' allows an alternate mode when SW is long-pressed. In that mode, left is previous, right is next and press is toggle. Every long press on SW alternates between modes.
|
||||
Encoder is normally hard-coded to respectively knob left, right and push on LMS and to volume down/up/play toggle on BT and AirPlay. Using the option 'volume' makes it hard-coded to volume down/up/play toggle all the time (even in LMS). The option 'longpress' allows an alternate mode when SW is long-pressed. In that mode, left is previous, right is next and press is toggle. Every long press on SW alternates between modes (the main mode actual behavior depends on 'volume').
|
||||
|
||||
There is also the possibility to use 'knobonly' option (exclusive with 'volume' and 'longpress'). This mode attempts to offer a single knob full navigation which is a bit contorded due to LMS UI's principles. Left, Right and Press obey to LMS's navigation rules and especially Press always goes to lower submenu item, even when navigating in the Music Library. That causes a challenge as there is no 'Play', 'Back' or 'Pause' button. Workaround are as of below:
|
||||
- longpress is 'Play'
|
||||
- double press is 'Back' (Left in LMS's terminology).
|
||||
- a quick left-right movement on the encoder is 'Pause'
|
||||
|
||||
The speed of double click (or left-right) can be set using the optional parameter of 'knobonly'. This is not a perfect solution, and other ideas are welcome. Be aware that the longer you set double click speed, the less responsive the interface will be. The reason is that I need to wait for that delay before deciding if it's a single or double click. It can also make menu navigation "hesitations" being easily interpreted as 'Pause'
|
||||
|
||||
Use parameter rotary_config with the following syntax:
|
||||
|
||||
```
|
||||
A=<gpio>,B=<gpio>[,SW=gpio>[,volume][,longpress]]
|
||||
A=<gpio>,B=<gpio>[,SW=gpio>[[,knobonly[=<ms>]]|[[,volume][,longpress]]]]
|
||||
```
|
||||
|
||||
HW note: all gpio used for rotary have internal pull-up so normally there is no need to provide Vcc to the encoder. Nevertheless if the encoder board you're using also has its own pull-up that are stronger than ESP32's ones (which is likely the case), then there will be crosstalk between gpio, so you must bring Vcc. Look at your board schematic and you'll understand that these board pull-up create a "winning" pull-down when any other pin is grounded.
|
||||
|
||||
See also the "IMPORTANT NOTE" on the "Buttons" section
|
||||
The SW gpio is optional, you can re-affect it to a pure button if you prefer but the volume, longpress and knobonly options make little sense as the missing switch plays an important role in these modes. You could still have the "volume" mode, but you won't be able to use it for *anything* expect volume up and down. So be aware that the use of syntax [] is a bit misleading hereabove.
|
||||
|
||||
See also the "IMPORTANT NOTE" on the "Buttons" section and remember that when 'lms_ctrls_raw' (see below) is activated, none of these knobonly,volume,longpress options apply, raw button codes (not actions) are simply sent to LMS
|
||||
|
||||
### Buttons
|
||||
Buttons are described using a JSON string with the following syntax
|
||||
@@ -230,81 +320,46 @@ There is no good or bad option, it's your choice. Use the NVS parameter "lms_ctr
|
||||
### Battery / ADC
|
||||
The NVS parameter "bat_config" sets the ADC1 channel used to measure battery/DC voltage. Scale is a float ratio applied to every sample of the 12 bits ADC. A measure is taken every 10s and an average is made every 5 minutes (not a sliding window). Syntax is
|
||||
```
|
||||
channel=0..7,scale=<scale>
|
||||
channel=0..7,scale=<scale>,cells=<2|3>
|
||||
```
|
||||
NB: Set parameter to empty to disable battery reading
|
||||
## Setting up ESP-IDF
|
||||
### Docker
|
||||
#### **************** todo: Docker scripts needs some rework.
|
||||
|
||||
You can use docker to build squeezelite-esp32
|
||||
First you need to build the Docker container:
|
||||
```
|
||||
docker build -t esp-idf .
|
||||
```
|
||||
Then you need to run the container:
|
||||
```
|
||||
docker run -i -t -v `pwd`:/workspace/squeezelite-esp32 esp-idf
|
||||
```
|
||||
The above command will mount this repo into the docker container and start a bash terminal
|
||||
for you to then follow the below build steps
|
||||
|
||||
### 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.
|
||||
=======
|
||||
<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
|
||||
MOST IMPORTANT: create the right default config file
|
||||
- make defconfig
|
||||
(Note: You can also copy over config files from the build-scripts folder to ./sdkconfig)
|
||||
Then adapt the config file to your wifi/BT/I2C device (can also be done on the command line)
|
||||
- make menuconfig
|
||||
Then
|
||||
|
||||
```
|
||||
idf.py -p PORT [-b BAUD] flash
|
||||
idf.py -p PORT [-b BAUD] monitor
|
||||
|
||||
```
|
||||
|
||||
NB: Set parameter to empty to disable battery reading. For well-known configuration, this is ignored (except for SqueezeAMP where number of cells is required)
|
||||
# Configuration
|
||||
1/ setup WiFi
|
||||
## Setup WiFi
|
||||
- Boot the esp, look for a new wifi access point showing up and connect to it. Default build ssid and passwords are "squeezelite"/"squeezelite".
|
||||
- Once connected, navigate to 192.168.4.1
|
||||
- Wait for the list of access points visible from the device to populate in the web page.
|
||||
- Choose an access point and enter any credential as needed
|
||||
- Once connection is established, note down the address the device received; this is the address you will use to configure it going forward
|
||||
|
||||
2/ setup squeezelite command line (optional)
|
||||
## Setup squeezelite command line (optional)
|
||||
|
||||
At this point, the device should have disabled its built-in access point and should be connected to a known WiFi network.
|
||||
- navigate to the address that was noted in step #1
|
||||
- Using the list of predefined options, hoose the mode in which you want squeezelite to start
|
||||
- Using the list of predefined options, choose the mode in which you want squeezelite to start
|
||||
- Generate the command
|
||||
- Add or change any additional command line option (for example player name, etc)
|
||||
- Activate squeezelite execution: this tells the device to automatiaclly run the command at start
|
||||
- Update the configuration
|
||||
- click on the "start toggle" button. This will force a reboot.
|
||||
- The toggle switch should be set to 'ON' to ensure that squeezelite is active after booting
|
||||
- The toggle switch should be set to 'ON' to ensure that squeezelite is active after booting (you might have to fiddle with it a few times)
|
||||
- You can enable accessto NVS parameters under 'credits'
|
||||
|
||||
3/ Updating Squeezelite
|
||||
## Monitor
|
||||
|
||||
In addition of the esp-idf serial link monitor option, you can also enable a telnet server (see NVS parameters) where you'll have access to a ton of logs of what's happening inside the WROVER.
|
||||
|
||||
## Update Squeezelite
|
||||
- From the firmware tab, click on "Check for Updates"
|
||||
- Look for updated binaries
|
||||
- Select a line
|
||||
- Click on "Flash!"
|
||||
- The system will reboot into recovery mode (if not already in that mode), wipe the squeezelite partition and download/flash the selected version
|
||||
- You can choose a local file or have a local webserver
|
||||
|
||||
3/ Recovery
|
||||
## Recovery
|
||||
- From the firmware tab, click on the "Recovery" button. This will reboot the ESP32 into recovery, where additional configuration options are available from the NVS editor
|
||||
|
||||
# Additional command line notes, configured from the http configuration
|
||||
## Additional configuration notes (from the Web UI)
|
||||
The squeezelite options are very similar to the regular Linux ones. Differences are :
|
||||
|
||||
- the output is -o ["BT -n '<sinkname>' "] | [I2S]
|
||||
@@ -320,12 +375,88 @@ See squeezlite command line, but keys options are
|
||||
- Z <rate> : tell LMS what is the max sample rate supported before LMS resamples
|
||||
- R (see above)
|
||||
- r "<minrate>-<maxrate>"
|
||||
- C <sec> : set timeout to switch off amp gpio
|
||||
- W : activate WAV and AIFF header parsing
|
||||
# Building everything yourself
|
||||
## Setting up ESP-IDF
|
||||
### Docker
|
||||
You can use docker to build squeezelite-esp32 (optional)
|
||||
First you need to build the Docker container:
|
||||
```
|
||||
docker build -t esp-idf .
|
||||
```
|
||||
Then you need to run the container:
|
||||
```
|
||||
docker run -i -t -v `pwd`:/workspace/squeezelite-esp32 esp-idf
|
||||
```
|
||||
The above command will mount this repo into the docker container and start a bash terminal
|
||||
for you to then follow the below build steps
|
||||
|
||||
## Additional misc notes to do you build
|
||||
### Manual Install of ESP-IDF
|
||||
<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/
|
||||
And then copying the i2s.c patch file from this repo over to the esp-idf folder
|
||||
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. As of this writing (08.2020), espressif has patched esp-dsp so this is no more needed
|
||||
|
||||
## Building Squeezelite-esp32
|
||||
Don't forget the to choose one of the config files in build_scripts/ and rename it sdkconfig.defaults or sdkconfig as many important WiFi/BT options are set there. The codecs libraries will not be rebuilt by these scripts (it's a tedious process - see below)
|
||||
### Using make (deprecated)
|
||||
MOST IMPORTANT: create the right default config file
|
||||
- make defconfig
|
||||
(Note: You can also copy over config files from the build-scripts folder to ./sdkconfig)
|
||||
Then adapt the config file to your wifi/BT/I2C device (can also be done on the command line)
|
||||
- make menuconfig
|
||||
Then
|
||||
|
||||
```
|
||||
# Build recovery.bin, bootloader.bin, ota_data_initial.bin, partitions.bin
|
||||
# force appropriate rebuild by touching all the files which may have a RECOVERY_APPLICATION specific source compile logic
|
||||
find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -type f -print0 | xargs -0 grep -l "RECOVERY_APPLICATION" | xargs touch
|
||||
export PROJECT_NAME="recovery"
|
||||
make -j4 all EXTRA_CPPFLAGS='-DRECOVERY_APPLICATION=1'
|
||||
make flash
|
||||
#
|
||||
# Build squeezelite.bin
|
||||
# Now force a rebuild by touching all the files which may have a RECOVERY_APPLICATION specific source compile logic
|
||||
find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -type f -print0 | xargs -0 grep -l "RECOVERY_APPLICATION" | xargs touch
|
||||
export PROJECT_NAME="squeezelite"
|
||||
make -j4 app EXTRA_CPPFLAGS='-DRECOVERY_APPLICATION=0'
|
||||
python ${IDF_PATH}/components/esptool_py/esptool/esptool.py --chip esp32 --port ${ESPPORT} --baud ${ESPBAUD} --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x150000 ./build/squeezelite.bin
|
||||
# monitor serial output
|
||||
make monitor
|
||||
|
||||
```
|
||||
|
||||
You can also manually download the recovery & initial boot
|
||||
```
|
||||
python ${IDF_PATH}/components/esptool_py/esptool/esptool.py --chip esp32 --port ${ESPPORT} --baud ${ESPBAUD} --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xd000 ./build/ota_data_initial.bin 0x1000 ./build/bootloader/bootloader.bin 0x10000 ./build/recovery.bin 0x8000 ./build/partitions.bin
|
||||
```
|
||||
### Using cmake
|
||||
Create you config using 'idf.py menuconfig' then build binaries using 'idf.py all'. It will build the recovery and the application (squeezelite) itself. See the recommended command to upload everything. Otherwise, if you just want to download squeezelite, do
|
||||
```
|
||||
python.exe <idf_path>\components\esptool_py\esptool\esptool.py -p COM<n> -b 921600 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x150000 build\squeezelite.bin
|
||||
```
|
||||
Use 'idf monitor' to monitor the application (see esp-idf documentation)
|
||||
## Additional misc notes to do you build (kitchen sink)
|
||||
- don't forget to set IDF_PATH, ESPPORT and ESPBAUD
|
||||
- When initially cloning the repo, make sure you do it recursively. For example:
|
||||
- git clone --recursive https://github.com/sle118/squeezelite-esp32.git
|
||||
- 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
|
||||
- as of this writing, ESP-IDF has a bug int he way the PLL values are calculated for i2s, so you *must* use the i2s.c file in the patch directory
|
||||
- misc compiler #define
|
||||
- use no resampling or set RESAMPLE (soxr - but overloads CPU) or set RESAMPLE16 for fast fixed 16 bits resampling
|
||||
- use LOOPBACK (mandatory)
|
||||
- use BYTES_PER_FRAME=4 (8 is not fully functionnal)
|
||||
- LINKALL (mandatory)
|
||||
- NO_FAAD unless you want to us faad, which currently overloads the CPU
|
||||
- TREMOR_ONLY (mandatory)
|
||||
### codecs
|
||||
- for codecs libraries, add -mlongcalls if you want to rebuild them, but you should not (use the provided ones in codecs/lib). if you really want to rebuild them, open an issue
|
||||
- libmad, libflac (no esp's version), libvorbis (tremor - not esp's version), alac work
|
||||
- libfaad does not really support real time, but if you want to try
|
||||
- libfaad does not really support real time, but if you want to try (but using helixaac is a better option)
|
||||
- -O3 -DFIXED_POINT -DSMALL_STACK
|
||||
- change ac_link in configure and case ac_files, remove ''
|
||||
- compiler but in cfft.c and cffti1, must disable optimization using
|
||||
@@ -338,19 +469,4 @@ See squeezlite command line, but keys options are
|
||||
- change ac_files to remove ''
|
||||
- add DEPS_CFLAGS and DEPS_LIBS to avoid pkg-config to be required
|
||||
- stack consumption can be very high with some codec variants, so set NONTHREADSAFE_PSEUDOSTACK and GLOBAL_STACK_SIZE=32000 and unset VAR_ARRAYS in config.h
|
||||
- better use helixaac
|
||||
- set IDF_PATH=/home/esp-idf
|
||||
- set ESPPORT=COM9
|
||||
- update flash partition size
|
||||
- other compiler #define
|
||||
- use no resampling or set RESAMPLE (soxr) or set RESAMPLE16 for fast fixed 16 bits resampling
|
||||
- use LOOPBACK (mandatory)
|
||||
- use BYTES_PER_FRAME=4 (8 is not fully functionnal)
|
||||
- LINKALL (mandatory)
|
||||
- NO_FAAD unless you want to us faad, which currently overloads the CPU
|
||||
- TREMOR_ONLY (mandatory)
|
||||
- When initially cloning the repo, make sure you do it recursively. For example:
|
||||
- git clone --recursive https://github.com/sle118/squeezelite-esp32.git
|
||||
- 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
|
||||
|
||||
- libmad has been patched to avoid using a lot of stack and is not provided here. There is an issue with sync detection in 1.15.1b from where the original stack patch was done but since a few fixes have been made wrt sync detection. This 1.15.1b-10 found on debian fixes the issue where mad thinks it has reached sync but has not and so returns a wrong sample rate. It comes at the expense of 8KB (!) of code where a simple check in squeezelite/mad.c that next_frame[0] is 0xff and next_frame[1] & 0xf0 is 0xf0 does the trick ...
|
||||
|
||||
@@ -180,13 +180,9 @@ CONFIG_BT_A2DP_ENABLE=y
|
||||
# CONFIG_BT_SPP_ENABLED is not set
|
||||
# CONFIG_BT_HFP_ENABLE is not set
|
||||
CONFIG_BT_SSP_ENABLED=y
|
||||
<<<<<<< HEAD
|
||||
# CONFIG_BT_BLE_ENABLED is not set
|
||||
CONFIG_BT_STACK_NO_LOG=y
|
||||
=======
|
||||
CONFIG_BT_BLE_ENABLED=n
|
||||
CONFIG_BT_BLE_SMP_ENABLE=y
|
||||
|
||||
CONFIG_BT_STACK_NO_LOG=n
|
||||
|
||||
|
||||
|
||||
@@ -356,7 +352,6 @@ CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2
|
||||
>>>>>>> refs/remotes/origin/master
|
||||
CONFIG_BT_ACL_CONNECTIONS=4
|
||||
CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y
|
||||
CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y
|
||||
@@ -630,19 +625,9 @@ 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
|
||||
<<<<<<< HEAD
|
||||
# CONFIG_LWIP_SO_RCVBUF is not set
|
||||
# CONFIG_LWIP_IP_REASSEMBLY is not set
|
||||
# CONFIG_LWIP_IP_FRAG is not set
|
||||
# CONFIG_LWIP_STATS is not set
|
||||
# CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set
|
||||
=======
|
||||
CONFIG_LWIP_IP_REASSEMBLY=y
|
||||
|
||||
|
||||
|
||||
|
||||
>>>>>>> refs/remotes/origin/master
|
||||
#CONFIG_LWIP_IP_REASSEMBLY is not set
|
||||
CONFIG_LWIP_IP6_REASSEMBLY=Y
|
||||
CONFIG_LWIP_IP4_REASSEMBLY=Y
|
||||
CONFIG_LWIP_ESP_GRATUITOUS_ARP=y
|
||||
CONFIG_LWIP_GARP_TMR_INTERVAL=60
|
||||
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32
|
||||
|
||||
@@ -179,183 +179,10 @@ CONFIG_BT_A2DP_ENABLE=y
|
||||
# CONFIG_BT_SPP_ENABLED is not set
|
||||
# CONFIG_BT_HFP_ENABLE is not set
|
||||
CONFIG_BT_SSP_ENABLED=y
|
||||
<<<<<<< HEAD
|
||||
# CONFIG_BT_BLE_ENABLED is not set
|
||||
CONFIG_BT_STACK_NO_LOG=y
|
||||
=======
|
||||
CONFIG_BT_BLE_ENABLED=n
|
||||
CONFIG_BT_BLE_SMP_ENABLE=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_HCI_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_HCI_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BTM_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BTM_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_L2CAP_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_SDP_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_SDP_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_GAP_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_GAP_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BNEP_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BNEP_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_PAN_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_PAN_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_A2D_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_A2D_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_AVDT_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_AVDT_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_AVCT_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_AVCT_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_AVRC_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_AVRC_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_MCA_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_MCA_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_HID_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_HID_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_APPL_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_APPL_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_GATT_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_GATT_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_SMP_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_SMP_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BTIF_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BTIF_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BTC_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BTC_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_OSI_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_OSI_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2
|
||||
>>>>>>> refs/remotes/origin/master
|
||||
CONFIG_BT_STACK_NO_LOG=n
|
||||
CONFIG_BT_ACL_CONNECTIONS=4
|
||||
CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y
|
||||
CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y
|
||||
@@ -507,11 +334,6 @@ 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_AMPDU_TX_ENABLED is not set
|
||||
# CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED is not set
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_ESP32_WIFI_NVS_ENABLED=y
|
||||
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
|
||||
@@ -633,19 +455,13 @@ 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
|
||||
<<<<<<< HEAD
|
||||
# CONFIG_LWIP_SO_RCVBUF is not set
|
||||
# CONFIG_LWIP_IP_FRAG is not set
|
||||
# CONFIG_LWIP_IP_REASSEMBLY is not set
|
||||
# CONFIG_LWIP_STATS is not set
|
||||
# CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set
|
||||
=======
|
||||
CONFIG_LWIP_IP_REASSEMBLY=y
|
||||
|
||||
|
||||
|
||||
|
||||
>>>>>>> refs/remotes/origin/master
|
||||
#CONFIG_LWIP_IP_REASSEMBLY is not set
|
||||
CONFIG_LWIP_IP6_REASSEMBLY=Y
|
||||
CONFIG_LWIP_IP4_REASSEMBLY=Y
|
||||
CONFIG_LWIP_ESP_GRATUITOUS_ARP=y
|
||||
CONFIG_LWIP_GARP_TMR_INTERVAL=60
|
||||
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -180,183 +180,8 @@ CONFIG_BT_A2DP_ENABLE=y
|
||||
# CONFIG_BT_SPP_ENABLED is not set
|
||||
# CONFIG_BT_HFP_ENABLE is not set
|
||||
CONFIG_BT_SSP_ENABLED=y
|
||||
<<<<<<< HEAD
|
||||
# CONFIG_BT_BLE_ENABLED is not set
|
||||
CONFIG_BT_STACK_NO_LOG=y
|
||||
=======
|
||||
CONFIG_BT_BLE_ENABLED=n
|
||||
CONFIG_BT_BLE_SMP_ENABLE=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_HCI_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_HCI_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BTM_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BTM_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_L2CAP_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_SDP_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_SDP_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_GAP_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_GAP_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BNEP_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BNEP_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_PAN_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_PAN_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_A2D_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_A2D_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_AVDT_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_AVDT_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_AVCT_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_AVCT_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_AVRC_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_AVRC_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_MCA_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_MCA_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_HID_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_HID_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_APPL_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_APPL_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_GATT_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_GATT_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_SMP_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_SMP_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BTIF_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BTIF_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BTC_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BTC_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_OSI_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_OSI_TRACE_LEVEL=2
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_WARNING=y
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2
|
||||
>>>>>>> refs/remotes/origin/master
|
||||
CONFIG_BT_STACK_NO_LOG=n
|
||||
CONFIG_BT_ACL_CONNECTIONS=4
|
||||
CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y
|
||||
CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y
|
||||
@@ -630,19 +455,9 @@ 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
|
||||
<<<<<<< HEAD
|
||||
# CONFIG_LWIP_SO_RCVBUF is not set
|
||||
# CONFIG_LWIP_IP_FRAG is not set
|
||||
# CONFIG_LWIP_IP_REASSEMBLY is not set
|
||||
# CONFIG_LWIP_STATS is not set
|
||||
# CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set
|
||||
=======
|
||||
CONFIG_LWIP_IP_REASSEMBLY=y
|
||||
|
||||
|
||||
|
||||
|
||||
>>>>>>> refs/remotes/origin/master
|
||||
#CONFIG_LWIP_IP_REASSEMBLY is not set
|
||||
CONFIG_LWIP_IP6_REASSEMBLY=Y
|
||||
CONFIG_LWIP_IP4_REASSEMBLY=Y
|
||||
CONFIG_LWIP_ESP_GRATUITOUS_ARP=y
|
||||
CONFIG_LWIP_GARP_TMR_INTERVAL=60
|
||||
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32
|
||||
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,6 +1,5 @@
|
||||
idf_component_register(SRC_DIRS .
|
||||
INCLUDE_DIRS . ./inc inc/alac inc/FLAC inc/helix-aac inc/mad inc/ogg inc/opus inc/opusfile inc/resample16 inc/soxr inc/vorbis
|
||||
PRIV_REQUIRES newlib
|
||||
idf_component_register(
|
||||
INCLUDE_DIRS . ./inc inc/alac inc/FLAC inc/helix-aac inc/mad inc/ogg inc/opus inc/opusfile inc/resample16 inc/soxr inc/vorbis
|
||||
)
|
||||
|
||||
add_prebuilt_library(libmad lib/libmad.a)
|
||||
@@ -9,16 +8,16 @@ add_prebuilt_library(libhelix-aac lib/libhelix-aac.a )
|
||||
add_prebuilt_library(libvorbisidec lib/libvorbisidec.a )
|
||||
add_prebuilt_library(libogg lib/libogg.a )
|
||||
add_prebuilt_library(libalac lib/libalac.a )
|
||||
add_prebuilt_library(libremple16 lib/libresample16.a )
|
||||
add_prebuilt_library(libresample16 lib/libresample16.a )
|
||||
add_prebuilt_library(libopusfile lib/libopusfile.a )
|
||||
add_prebuilt_library(libopus lib/libopus.a )
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE libmad)
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE libFLAC)
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE libhelix-aac)
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE libvorbisidec)
|
||||
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE libogg)
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE libalac)
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE libremple16)
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE libopusfile)
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE libopus)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE libmad)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE libFLAC)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE libhelix-aac)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE libvorbisidec)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE libogg)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE libalac)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE libresample16)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE libopusfile)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE libopus)
|
||||
|
||||
@@ -19,7 +19,7 @@ extern "C" {
|
||||
|
||||
struct alac_codec_s *alac_create_decoder(int magic_cookie_size, unsigned char *magic_cookie,
|
||||
unsigned char *sample_size, unsigned *sample_rate,
|
||||
unsigned char *channels);
|
||||
unsigned char *channels, unsigned int *block_size);
|
||||
void alac_delete_decoder(struct alac_codec_s *codec);
|
||||
bool alac_to_pcm(struct alac_codec_s *codec, unsigned char* input,
|
||||
unsigned char *output, char channels, unsigned *out_frames);
|
||||
|
||||
Binary file not shown.
@@ -1,3 +0,0 @@
|
||||
void dummy_obj() {
|
||||
return;
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
idf_component_register(SRC_DIRS . core core/ifaces fonts
|
||||
INCLUDE_DIRS . fonts core
|
||||
REQUIRES platform_config tools esp_common
|
||||
|
||||
@@ -147,23 +147,28 @@ static bool Init( struct GDS_Device* Device ) {
|
||||
Private->ReMap = 0;
|
||||
Device->SetLayout( Device, false, false, false);
|
||||
|
||||
// set Display Enhancement
|
||||
Device->WriteCommand( Device, 0xB4 );
|
||||
WriteDataByte( Device, 0xA0 );
|
||||
WriteDataByte( Device, 0xB5 );
|
||||
|
||||
// set Clocks
|
||||
Device->WriteCommand( Device, 0xB3 );
|
||||
WriteDataByte( Device, 0x91 );
|
||||
WriteDataByte( Device, 0xB2 ); // 0x91 seems to be common but is too slow for 5.5'
|
||||
|
||||
// set MUX
|
||||
Device->WriteCommand( Device, 0xCA );
|
||||
WriteDataByte( Device, Device->Height - 1 );
|
||||
|
||||
// phase 1 & 2 period (needed?)
|
||||
// phase 1 & 2 period
|
||||
Device->WriteCommand( Device, 0xB1 );
|
||||
WriteDataByte( Device, 0xE2 );
|
||||
WriteDataByte( Device, 0xE3 ); // 0xE2 was recommended
|
||||
|
||||
// set pre-charge V (needed?°)
|
||||
// set pre-charge V
|
||||
Device->WriteCommand( Device, 0xBB );
|
||||
WriteDataByte( Device, 0x1F );
|
||||
WriteDataByte( Device, 0x0F); // 0x1F causes column interferences
|
||||
|
||||
// set COM deselect voltage (needed?)
|
||||
// set COM deselect voltage
|
||||
Device->WriteCommand( Device, 0xBE );
|
||||
WriteDataByte( Device, 0x07 );
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ static bool I2CDefaultWriteData( struct GDS_Device* Device, const uint8_t* Data,
|
||||
bool GDS_I2CInit( int PortNumber, int SDA, int SCL, int Speed ) {
|
||||
I2CPortNumber = PortNumber;
|
||||
|
||||
I2CWait = pdMS_TO_TICKS( Speed ? Speed / 4000 : 100 );
|
||||
I2CWait = pdMS_TO_TICKS( Speed ? (250 * 250000) / Speed : 250 );
|
||||
|
||||
if (SDA != -1 && SCL != -1) {
|
||||
i2c_config_t Config = { 0 };
|
||||
|
||||
@@ -52,7 +52,8 @@ static const char *known_drivers[] = {"SH1106",
|
||||
"SSD1327",
|
||||
"SSD1675",
|
||||
"SSD1351",
|
||||
"ST77xx",
|
||||
"ST7735",
|
||||
"ST7789",
|
||||
"ILI9341",
|
||||
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;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
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++ ){
|
||||
if(strcasestr(driver,known_drivers[i])){
|
||||
return known_drivers[i];
|
||||
@@ -396,3 +397,27 @@ const char *display_conf_get_driver_name(char * driver){
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
char * display_get_supported_drivers(void){
|
||||
int total_size = 1;
|
||||
char * supported_drivers=NULL;
|
||||
const char * separator = "|";
|
||||
int separator_len = strlen(separator);
|
||||
|
||||
for(uint8_t i=0;known_drivers[i]!=NULL && strlen(known_drivers[i])>0;i++ ){
|
||||
total_size += strlen(known_drivers[i])+separator_len;
|
||||
}
|
||||
total_size+=2;
|
||||
supported_drivers = malloc(total_size);
|
||||
memset(supported_drivers,0x00,total_size);
|
||||
strcat(supported_drivers,"<");
|
||||
for(uint8_t i=0;known_drivers[i]!=NULL && strlen(known_drivers[i])>0;i++ ){
|
||||
supported_drivers = strcat(supported_drivers,known_drivers[i]);
|
||||
supported_drivers = strcat(supported_drivers,separator);
|
||||
}
|
||||
strcat(supported_drivers,">");
|
||||
return supported_drivers;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "gds.h"
|
||||
|
||||
|
||||
/*
|
||||
The displayer is not thread-safe and the caller must ensure use its own
|
||||
mutexes if it wants something better. Especially, text() line() and draw()
|
||||
@@ -31,10 +32,11 @@ enum displayer_time_e { DISPLAYER_ELAPSED, DISPLAYER_REMAINING };
|
||||
|
||||
enum display_bus_cmd_e { DISPLAY_BUS_TAKE, DISPLAY_BUS_GIVE };
|
||||
bool (*display_bus)(void *from, enum display_bus_cmd_e cmd);
|
||||
const char *display_conf_get_driver_name(char * driver);
|
||||
bool display_is_valid_driver(char * driver);
|
||||
const char *display_conf_get_driver_name(const char * driver);
|
||||
bool display_is_valid_driver(const char * driver);
|
||||
|
||||
void displayer_scroll(char *string, int speed, int pause);
|
||||
void displayer_control(enum displayer_cmd_e cmd, ...);
|
||||
void displayer_metadata(char *artist, char *album, char *title);
|
||||
void displayer_timer(enum displayer_time_e mode, int elapsed, int duration);
|
||||
char * display_get_supported_drivers(void);
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#include "bt_app_core.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include "esp_system.h"
|
||||
#include <string.h>
|
||||
|
||||
@@ -15,9 +15,29 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#define BT_APP_CORE_TAG "BT_APP_CORE"
|
||||
|
||||
#define BT_APP_SIG_WORK_DISPATCH (0x01)
|
||||
|
||||
/* A2DP global state */
|
||||
enum {
|
||||
APP_AV_STATE_IDLE,
|
||||
APP_AV_STATE_DISCOVERING,
|
||||
APP_AV_STATE_DISCOVERED,
|
||||
APP_AV_STATE_UNCONNECTED,
|
||||
APP_AV_STATE_CONNECTING,
|
||||
APP_AV_STATE_CONNECTED,
|
||||
APP_AV_STATE_DISCONNECTING,
|
||||
};
|
||||
|
||||
/* sub states of APP_AV_STATE_CONNECTED */
|
||||
enum {
|
||||
APP_AV_MEDIA_STATE_IDLE,
|
||||
APP_AV_MEDIA_STATE_STARTING,
|
||||
APP_AV_MEDIA_STATE_STARTED,
|
||||
APP_AV_MEDIA_STATE_STOPPING,
|
||||
APP_AV_MEDIA_STATE_WAIT_DISCONNECT
|
||||
};
|
||||
extern int bt_app_source_get_a2d_state();
|
||||
extern int bt_app_source_get_media_state();
|
||||
/**
|
||||
* @brief handler for the dispatched work
|
||||
*/
|
||||
|
||||
@@ -63,6 +63,7 @@ static void bt_av_hdl_avrc_ct_evt(uint16_t event, void *p_param);
|
||||
/* avrc TG event handler */
|
||||
static void bt_av_hdl_avrc_tg_evt(uint16_t event, void *p_param);
|
||||
static void volume_set_by_local_host(uint8_t volume);
|
||||
static void bt_av_notify_evt_handler(uint8_t event_id, esp_avrc_rn_param_t *event_parameter);
|
||||
|
||||
static const char *s_a2d_conn_state_str[] = {"Disconnected", "Connecting", "Connected", "Disconnecting"};
|
||||
static const char *s_a2d_audio_state_str[] = {"Suspended", "Stopped", "Started"};
|
||||
@@ -378,7 +379,7 @@ static void bt_av_play_pos_changed(void)
|
||||
}
|
||||
}
|
||||
|
||||
void bt_av_notify_evt_handler(uint8_t event_id, esp_avrc_rn_param_t *event_parameter)
|
||||
static void bt_av_notify_evt_handler(uint8_t event_id, esp_avrc_rn_param_t *event_parameter)
|
||||
{
|
||||
switch (event_id) {
|
||||
case ESP_AVRC_RN_TRACK_CHANGE:
|
||||
@@ -557,7 +558,7 @@ void bt_sink_init(bt_cmd_vcb_t cmd_cb, bt_data_cb_t data_cb)
|
||||
cmd_handler_chain = cmd_cb;
|
||||
bt_app_a2d_data_cb = data_cb;
|
||||
|
||||
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_BLE));
|
||||
esp_bt_controller_mem_release(ESP_BT_MODE_BLE);
|
||||
|
||||
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
|
||||
if ((err = esp_bt_controller_init(&bt_cfg)) != ESP_OK) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,8 +5,9 @@ idf_component_register( SRCS
|
||||
cmd_system.c
|
||||
cmd_wifi.c
|
||||
platform_console.c
|
||||
cmd_config.c
|
||||
INCLUDE_DIRS .
|
||||
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} ${build_dir}/esp-idf/$<TARGET_PROPERTY:RECOVERY_PREFIX>/lib$<TARGET_PROPERTY:RECOVERY_PREFIX>.a )
|
||||
|
||||
897
components/platform_console/cmd_config.c
Normal file
897
components/platform_console/cmd_config.c
Normal file
@@ -0,0 +1,897 @@
|
||||
/* 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";
|
||||
const char * desc_bt_source= "Bluetooth Audio Output 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"
|
||||
typedef enum {
|
||||
SEARCHING_FOR_BT,
|
||||
SEARCHING_FOR_NAME,
|
||||
SEARCHING_FOR_NAME_START,
|
||||
SEARCHING_FOR_NAME_END,
|
||||
SEARCHING_FOR_BT_CMD_END,
|
||||
FINISHING
|
||||
} parse_state_t;
|
||||
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_str *sink_name;
|
||||
struct arg_str *pin_code;
|
||||
// struct arg_dbl *connect_timeout_delay;
|
||||
// struct arg_dbl *control_delay;
|
||||
struct arg_end *end;
|
||||
} bt_source_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;
|
||||
}
|
||||
char * strip_bt_name(char * opt_str)
|
||||
{
|
||||
char *result = malloc(strlen(opt_str)+1);
|
||||
memset(result, 0x00, strlen(opt_str)+1);
|
||||
char *str = strdup(opt_str);
|
||||
const char * output_marker=" -o";
|
||||
|
||||
if(!result ){
|
||||
ESP_LOGE(TAG,"Error allocating memory for result.");
|
||||
return opt_str;
|
||||
}
|
||||
if(!str){
|
||||
ESP_LOGE(TAG,"Error duplicating command line string.");
|
||||
return opt_str;
|
||||
}
|
||||
bool quoted=false;
|
||||
parse_state_t state = SEARCHING_FOR_BT;
|
||||
char *start = strstr(str, output_marker);
|
||||
if (start)
|
||||
{
|
||||
ESP_LOGV(TAG,"Found output option : %s\n",start);
|
||||
start+=strlen(output_marker);
|
||||
strncpy(result, str, (size_t)(start - str));
|
||||
char * pch=strtok(start," ");
|
||||
while(pch){
|
||||
ESP_LOGV(TAG,"Current output: %s\n[%s]",result,pch);
|
||||
switch (state)
|
||||
{
|
||||
case SEARCHING_FOR_BT:
|
||||
if (strcasestr(pch, "BT") )
|
||||
{
|
||||
state = SEARCHING_FOR_NAME;
|
||||
quoted=strcasestr(pch, "BT")!=NULL;
|
||||
ESP_LOGV(TAG," - fount BT Start %s", quoted?"quoted":"");
|
||||
}
|
||||
else
|
||||
{
|
||||
ESP_LOGV(TAG," - Searching for BT, Ignoring");
|
||||
}
|
||||
strcat(result, " ");
|
||||
strcat(result, pch);
|
||||
break;
|
||||
case SEARCHING_FOR_NAME:
|
||||
if (strcasestr(pch, "name") || strcasestr(pch, "n"))
|
||||
{
|
||||
ESP_LOGV(TAG," - Found name tag");
|
||||
state = SEARCHING_FOR_NAME_START;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat(result, " ");
|
||||
strcat(result, pch);
|
||||
ESP_LOGV(TAG," - Searching for name - added ");;
|
||||
}
|
||||
break;
|
||||
case SEARCHING_FOR_NAME_START:
|
||||
ESP_LOGV(TAG," - Name start");
|
||||
state = SEARCHING_FOR_NAME_END;
|
||||
break;
|
||||
case SEARCHING_FOR_NAME_END:
|
||||
if (strcasestr(pch, "\"")){
|
||||
ESP_LOGV(TAG," - got quoted string");
|
||||
state = FINISHING;
|
||||
}
|
||||
else if(pch[0]== '-'){
|
||||
strcat(result, " ");
|
||||
strcat(result, pch);
|
||||
ESP_LOGV(TAG," - got parameter marker");
|
||||
state = quoted?SEARCHING_FOR_BT_CMD_END:FINISHING;
|
||||
}
|
||||
else {
|
||||
ESP_LOGV(TAG," - name continued");
|
||||
}
|
||||
break;
|
||||
case SEARCHING_FOR_BT_CMD_END:
|
||||
ESP_LOGV(TAG," - looking for quoted BT cmd end");
|
||||
if (strcasestr(pch, "\"")){
|
||||
ESP_LOGV(TAG," - got quote termination");
|
||||
state = FINISHING;
|
||||
}
|
||||
strcat(result, " ");
|
||||
strcat(result, pch);
|
||||
break;
|
||||
case FINISHING:
|
||||
strcat(result, " ");
|
||||
strcat(result, pch);
|
||||
break;
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
pch = strtok(NULL, " ");
|
||||
ESP_LOGV(TAG,"\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ESP_LOGE(TAG,"output option not found in %s\n",str);
|
||||
strcpy(result,str);
|
||||
}
|
||||
|
||||
ESP_LOGV(TAG,"Result commmand : %s\n", result);
|
||||
free(str);
|
||||
return result;
|
||||
}
|
||||
|
||||
static int do_bt_source_cmd(int argc, char **argv){
|
||||
esp_err_t err=ESP_OK;
|
||||
int nerrors = arg_parse(argc, argv,(void **)&bt_source_args);
|
||||
char *buf = NULL;
|
||||
size_t buf_size = 0;
|
||||
// char value[100] ={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,bt_source_args.end,desc_bt_source);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(bt_source_args.sink_name->count >0){
|
||||
err = config_set_value(NVS_TYPE_STR, "a2dp_sink_name", bt_source_args.sink_name->sval[0]);
|
||||
if(err!=ESP_OK){
|
||||
nerrors++;
|
||||
fprintf(f,"Error setting Bluetooth audio device name %s. %s\n",bt_source_args.sink_name->sval[0], esp_err_to_name(err));
|
||||
}
|
||||
else {
|
||||
fprintf(f,"Bluetooth audio device name changed to %s\n",bt_source_args.sink_name->sval[0]);
|
||||
}
|
||||
char * squeezelite_cmd = config_alloc_get_default(NVS_TYPE_STR, "autoexec1", NULL, 0);
|
||||
if( squeezelite_cmd && strstr(squeezelite_cmd," -o ") ){
|
||||
char * new_cmd = strip_bt_name(squeezelite_cmd);
|
||||
if(strcmp(new_cmd,squeezelite_cmd)!=0){
|
||||
fprintf(f,"Replacing old squeezelite command [%s] with [%s].\n",squeezelite_cmd,new_cmd);
|
||||
config_set_value(NVS_TYPE_STR, "autoexec1", new_cmd);
|
||||
if(err!=ESP_OK){
|
||||
nerrors++;
|
||||
fprintf(f,"Error updating squeezelite command line options . %s\n", esp_err_to_name(err));
|
||||
}
|
||||
}
|
||||
free(squeezelite_cmd);
|
||||
free(new_cmd);
|
||||
}
|
||||
|
||||
}
|
||||
if(bt_source_args.pin_code->count >0){
|
||||
const char * v=bt_source_args.pin_code->sval[0];
|
||||
bool bInvalid=false;
|
||||
for(int i=0;i<strlen(v) && !bInvalid;i++){
|
||||
if(v[i]<'0' || v[i]>'9'){
|
||||
bInvalid=true;
|
||||
}
|
||||
}
|
||||
if(bInvalid || strlen(bt_source_args.pin_code->sval[0])>16 || strlen(bt_source_args.pin_code->sval[0])<4){
|
||||
nerrors++;
|
||||
fprintf(f,"Pin code %s invalid. Should be numbers only with length between 4 and 16 characters. \n",bt_source_args.pin_code->sval[0]);
|
||||
}
|
||||
else {
|
||||
err = config_set_value(NVS_TYPE_STR, "a2dp_spin", bt_source_args.pin_code->sval[0]);
|
||||
if(err!=ESP_OK){
|
||||
nerrors++;
|
||||
fprintf(f,"Error setting Bluetooth source pin to %s. %s\n",bt_source_args.pin_code->sval[0], esp_err_to_name(err));
|
||||
}
|
||||
else {
|
||||
fprintf(f,"Bluetooth source pin changed to %s\n",bt_source_args.pin_code->sval[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// if(bt_source_args.connect_timeout_delay->count >0){
|
||||
|
||||
// snprintf(value,sizeof(value),"%d",(int)(bt_source_args.connect_timeout_delay->dval[0]*1000.0));
|
||||
// if(bt_source_args.connect_timeout_delay->dval[0] <0.5 || bt_source_args.connect_timeout_delay->dval[0] >5.0){
|
||||
// nerrors++;
|
||||
// fprintf(f,"Invalid connection timeout %0.0f (%s milliseconds). Value must be between 0.5 sec and 5 sec.\n", bt_source_args.connect_timeout_delay->dval[0], value );
|
||||
// }
|
||||
// else {
|
||||
// err = config_set_value(NVS_TYPE_STR, "a2dp_ctmt", value);
|
||||
// if(err!=ESP_OK){
|
||||
// nerrors++;
|
||||
// fprintf(f,"Error setting connection timeout %0.0f sec (%s milliseconds). %s\n", bt_source_args.connect_timeout_delay->dval[0],value, esp_err_to_name(err));
|
||||
// }
|
||||
// else {
|
||||
// fprintf(f,"Connection timeout changed to %0.0f sec (%s milliseconds)\n",bt_source_args.connect_timeout_delay->dval[0],value);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// if(bt_source_args.control_delay->count >0){
|
||||
// snprintf(value,sizeof(value),"%d",(int)(bt_source_args.control_delay->dval[0]*1000.0));
|
||||
// if(bt_source_args.control_delay->dval[0] <0.1 || bt_source_args.control_delay->dval[0] >2.0){
|
||||
// nerrors++;
|
||||
// fprintf(f,"Invalid control delay %0.0f (%s milliseconds). Value must be between 0.1s and 2s.\n", bt_source_args.control_delay->dval[0], value );
|
||||
// }
|
||||
// else {
|
||||
// err = config_set_value(NVS_TYPE_STR, "a2dp_ctrld", value);
|
||||
// if(err!=ESP_OK){
|
||||
// nerrors++;
|
||||
// fprintf(f,"Error setting control delay to %0.0f sec (%s milliseconds). %s\n",bt_source_args.control_delay->dval[0],value, esp_err_to_name(err));
|
||||
// }
|
||||
// else {
|
||||
// fprintf(f,"Control delay changed to %0.0f sec (%s milliseconds)\n",bt_source_args.control_delay->dval[0],value);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
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_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;
|
||||
}
|
||||
cJSON * bt_source_cb(){
|
||||
cJSON * values = cJSON_CreateObject();
|
||||
char * p = config_alloc_get_default(NVS_TYPE_STR, "a2dp_sink_name", NULL, 0);
|
||||
if(p){
|
||||
cJSON_AddStringToObject(values,"sink_name",p);
|
||||
}
|
||||
FREE_AND_NULL(p);
|
||||
// p = config_alloc_get_default(NVS_TYPE_STR, "a2dp_ctmt", NULL, 0);
|
||||
// if(p){
|
||||
// cJSON_AddNumberToObject(values,"connect_timeout_delay",((double)atoi(p)/1000.0));
|
||||
// }
|
||||
// FREE_AND_NULL(p);
|
||||
p = config_alloc_get_default(NVS_TYPE_STR, "a2dp_spin", "0000", 0);
|
||||
if(p){
|
||||
cJSON_AddStringToObject(values,"pin_code",p);
|
||||
}
|
||||
FREE_AND_NULL(p);
|
||||
// p = config_alloc_get_default(NVS_TYPE_STR, "a2dp_ctrld", NULL, 0);
|
||||
// if(p){
|
||||
// cJSON_AddNumberToObject(values,"control_delay",((double)atoi(p)/1000.0));
|
||||
// }
|
||||
// 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_bt_source_config(void){
|
||||
|
||||
bt_source_args.sink_name= arg_str1("n","sink_name", "name","Bluetooth audio device name. This applies when output mode is Bluetooth");
|
||||
bt_source_args.pin_code= arg_str1("p","pin_code", "pin","Bluetooth security/pin code. Usually 0000. This applies when output mode is Bluetooth");
|
||||
// bt_source_args.control_delay= arg_dbl0("d","control_delay","seconds","Control response delay, in seconds. This determines the response time of the system Bluetooth events. The default value should work for the majority of cases and changing this could lead to instabilities.");
|
||||
// bt_source_args.connect_timeout_delay= arg_dbl0("t","connect_timeout_delay","seconds","Connection timeout. Determines the maximum amount of time, in seconds, that the system will wait when connecting to a bluetooth device. Beyond this delay, a new connect attempt will be made.");
|
||||
bt_source_args.end= arg_end(1);
|
||||
const esp_console_cmd_t cmd = {
|
||||
.command = CFG_TYPE_AUDIO("bt_source"),
|
||||
.help = desc_bt_source,
|
||||
.hint = NULL,
|
||||
.func = &do_bt_source_cmd,
|
||||
.argtable = &bt_source_args
|
||||
};
|
||||
cmd_to_json_with_cb(&cmd,&bt_source_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_bt_source_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_i2ctools.h"
|
||||
#include "cmd_ota.h"
|
||||
#include "cmd_config.h"
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#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 *type = set_args.type->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);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ static int get_value(int argc, char **argv)
|
||||
esp_err_t err = get_value_from_nvs(key, type);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ static int erase_value(int argc, char **argv)
|
||||
esp_err_t err = erase(key);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ static int erase_namespace(int argc, char **argv)
|
||||
|
||||
esp_err_t err = erase_all(name);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -411,11 +411,11 @@ static int erase_wifi_manager(int argc, char **argv)
|
||||
}
|
||||
nvs_close(nvs);
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Console example — various system commands
|
||||
|
||||
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.
|
||||
@@ -31,17 +31,36 @@
|
||||
#include "driver/uart.h" // for the uart driver access
|
||||
#include "messaging.h"
|
||||
#include "platform_console.h"
|
||||
|
||||
|
||||
#ifdef CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS
|
||||
#include "trace.h"
|
||||
#ifdef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS
|
||||
#pragma message("Runtime stats enabled")
|
||||
#define WITH_TASKS_INFO 1
|
||||
#else
|
||||
#pragma message("Runtime stats disabled")
|
||||
#endif
|
||||
|
||||
|
||||
static struct {
|
||||
struct arg_str *scanmode;
|
||||
//disable_ps struct arg_lit *disable_power_save;
|
||||
struct arg_end *end;
|
||||
} wifi_parms_arg;
|
||||
static struct {
|
||||
struct arg_str *name;
|
||||
struct arg_end *end;
|
||||
} 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 void register_setbtsource();
|
||||
//static void register_setbtsource();
|
||||
static void register_free();
|
||||
static void register_setdevicename();
|
||||
static void register_heap();
|
||||
static void register_version();
|
||||
static void register_restart();
|
||||
@@ -50,15 +69,20 @@ static void register_light_sleep();
|
||||
static void register_factory_boot();
|
||||
static void register_restart_ota();
|
||||
static void register_update_certs();
|
||||
static void register_set_services();
|
||||
static void register_set_wifi_parms();
|
||||
#if WITH_TASKS_INFO
|
||||
static void register_tasks();
|
||||
#endif
|
||||
extern BaseType_t wifi_manager_task;
|
||||
void register_system()
|
||||
{
|
||||
register_setbtsource();
|
||||
register_set_wifi_parms();
|
||||
// register_setbtsource();
|
||||
register_free();
|
||||
register_set_services();
|
||||
register_heap();
|
||||
register_setdevicename();
|
||||
register_version();
|
||||
register_restart();
|
||||
register_deep_sleep();
|
||||
@@ -76,7 +100,7 @@ static int get_version(int argc, char **argv)
|
||||
{
|
||||
esp_chip_info_t info;
|
||||
esp_chip_info(&info);
|
||||
log_send_messaging(MESSAGING_INFO,
|
||||
cmd_send_messaging(argv[0],MESSAGING_INFO,
|
||||
"IDF Version:%s\r\n"
|
||||
"Chip info:\r\n"
|
||||
"\tmodel:%s\r\n"
|
||||
@@ -104,35 +128,32 @@ static void register_version()
|
||||
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||
}
|
||||
|
||||
/** 'restart' command restarts the program */
|
||||
|
||||
|
||||
esp_err_t guided_boot(esp_partition_subtype_t partition_subtype)
|
||||
{
|
||||
if(is_recovery_running){
|
||||
if(partition_subtype ==ESP_PARTITION_SUBTYPE_APP_FACTORY){
|
||||
log_send_messaging(MESSAGING_WARNING,"RECOVERY application is already active");
|
||||
if(!wait_for_commit()){
|
||||
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||
}
|
||||
|
||||
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||
esp_restart();
|
||||
return ESP_OK;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(partition_subtype !=ESP_PARTITION_SUBTYPE_APP_FACTORY){
|
||||
log_send_messaging(MESSAGING_WARNING,"SQUEEZELITE application is already active");
|
||||
if(!wait_for_commit()){
|
||||
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||
}
|
||||
|
||||
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||
esp_restart();
|
||||
return ESP_OK;
|
||||
}
|
||||
}
|
||||
if(is_recovery_running){
|
||||
if(partition_subtype ==ESP_PARTITION_SUBTYPE_APP_FACTORY){
|
||||
log_send_messaging(MESSAGING_WARNING,"RECOVERY application is already active");
|
||||
if(!wait_for_commit()){
|
||||
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||
}
|
||||
|
||||
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||
esp_restart();
|
||||
return ESP_OK;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(partition_subtype !=ESP_PARTITION_SUBTYPE_APP_FACTORY){
|
||||
log_send_messaging(MESSAGING_WARNING,"SQUEEZELITE application is already active");
|
||||
if(!wait_for_commit()){
|
||||
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||
}
|
||||
|
||||
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||
esp_restart();
|
||||
return ESP_OK;
|
||||
}
|
||||
}
|
||||
esp_err_t err = ESP_OK;
|
||||
bool bFound=false;
|
||||
log_send_messaging(MESSAGING_INFO, "Looking for partition type %u",partition_subtype);
|
||||
@@ -156,9 +177,7 @@ else {
|
||||
log_send_messaging(MESSAGING_ERROR,"Unable to select partition for reboot: %s",esp_err_to_name(err));
|
||||
}
|
||||
else{
|
||||
log_send_messaging(MESSAGING_WARNING, "Application partition %s sub type %u is selected for boot", partition->label,partition_subtype);
|
||||
bFound=true;
|
||||
messaging_post_message(MESSAGING_WARNING,MESSAGING_CLASS_SYSTEM,"Reboot failed. Cannot iterate through partitions");
|
||||
bFound=true;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -169,9 +188,8 @@ else {
|
||||
ESP_LOGD(TAG, "Yielding to other processes");
|
||||
taskYIELD();
|
||||
if(bFound) {
|
||||
log_send_messaging(MESSAGING_WARNING,"Configuration %s changes. ",config_has_changes()?"has":"does not have");
|
||||
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);
|
||||
esp_restart();
|
||||
@@ -185,7 +203,7 @@ static int restart(int argc, char **argv)
|
||||
{
|
||||
log_send_messaging(MESSAGING_WARNING, "\n\nPerforming a simple restart to the currently active partition.");
|
||||
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);
|
||||
esp_restart();
|
||||
@@ -194,7 +212,7 @@ static int restart(int argc, char **argv)
|
||||
|
||||
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()){
|
||||
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||
}
|
||||
@@ -205,24 +223,24 @@ void simple_restart()
|
||||
}
|
||||
|
||||
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);
|
||||
return ESP_FAIL; // return fail. This should never return... we're rebooting!
|
||||
}
|
||||
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);
|
||||
return ESP_FAIL; // return fail. This should never return... we're rebooting!
|
||||
}
|
||||
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);
|
||||
return 0; // return fail. This should never return... we're rebooting!
|
||||
}
|
||||
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);
|
||||
return 0; // return fail. This should never return... we're rebooting!
|
||||
}
|
||||
@@ -230,7 +248,7 @@ static void register_restart()
|
||||
{
|
||||
const esp_console_cmd_t cmd = {
|
||||
.command = "restart",
|
||||
.help = "Software reset of the chip",
|
||||
.help = "Reboot system",
|
||||
.hint = NULL,
|
||||
.func = &restart,
|
||||
};
|
||||
@@ -241,7 +259,7 @@ static void register_restart_ota()
|
||||
{
|
||||
const esp_console_cmd_t cmd = {
|
||||
.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,
|
||||
.func = &restart_ota,
|
||||
};
|
||||
@@ -253,7 +271,7 @@ static void register_factory_boot()
|
||||
{
|
||||
const esp_console_cmd_t cmd = {
|
||||
.command = "recovery",
|
||||
.help = "Resets and boot to recovery (if available)",
|
||||
.help = "Reboot system to Recovery",
|
||||
.hint = NULL,
|
||||
.func = &restart_factory,
|
||||
};
|
||||
@@ -264,94 +282,10 @@ static void register_factory_boot()
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
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()
|
||||
{
|
||||
@@ -369,9 +303,137 @@ static void register_free()
|
||||
static int heap_size(int argc, char **argv)
|
||||
{
|
||||
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;
|
||||
}
|
||||
cJSON * setdevicename_cb(){
|
||||
char * default_host_name = config_alloc_get_str("host_name",NULL,"Squeezelite");
|
||||
cJSON * values = cJSON_CreateObject();
|
||||
cJSON_AddStringToObject(values,"name",default_host_name);
|
||||
free(default_host_name);
|
||||
return values;
|
||||
}
|
||||
static int setnamevar(char * nvsname, FILE *f, char * value){
|
||||
esp_err_t err=ESP_OK;
|
||||
if((err=config_set_value(NVS_TYPE_STR, nvsname, value))!=ESP_OK){
|
||||
fprintf(f,"Unable to set %s=%s. %s\n",nvsname,value,esp_err_to_name(err));
|
||||
}
|
||||
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)
|
||||
{
|
||||
char * name = NULL;
|
||||
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&name_args);
|
||||
if (nerrors != 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Check "--name" option */
|
||||
if (name_args.name->count) {
|
||||
name=strdup(name_args.name->sval[0]);
|
||||
}
|
||||
else {
|
||||
cmd_send_messaging(argv[0],MESSAGING_ERROR,"Name must be specified.");
|
||||
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+=setnamevar("a2dp_dev_name", f, name);
|
||||
nerrors+=setnamevar("airplay_name", f, name);
|
||||
nerrors+=setnamevar("ap_ssid", f, name);
|
||||
nerrors+=setnamevar("bt_name", f, name);
|
||||
nerrors+=setnamevar("host_name", f, name);
|
||||
nerrors+=set_squeezelite_player_name(f, name);
|
||||
if(nerrors==0){
|
||||
fprintf(f,"Device name changed to %s\n",name);
|
||||
}
|
||||
if(!nerrors ){
|
||||
fprintf(f,"Done.\n");
|
||||
}
|
||||
FREE_AND_NULL(name);
|
||||
fflush (f);
|
||||
cmd_send_messaging(argv[0],nerrors>0?MESSAGING_ERROR:MESSAGING_INFO,"%s", buf);
|
||||
fclose(f);
|
||||
FREE_AND_NULL(buf);
|
||||
return nerrors;
|
||||
|
||||
}
|
||||
|
||||
static void register_heap()
|
||||
{
|
||||
@@ -386,6 +448,22 @@ static void register_heap()
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void register_setdevicename()
|
||||
{
|
||||
char * default_host_name = config_alloc_get_str("host_name",NULL,"Squeezelite");
|
||||
name_args.name = arg_str0("n", "name", default_host_name, "New Name");
|
||||
name_args.end = arg_end(8);
|
||||
const esp_console_cmd_t set_name= {
|
||||
.command = CFG_TYPE_SYST("name"),
|
||||
.help="Device Name",
|
||||
.hint = NULL,
|
||||
.func = &setdevicename,
|
||||
.argtable = &name_args
|
||||
};
|
||||
cmd_to_json_with_cb(&set_name,&setdevicename_cb);
|
||||
ESP_ERROR_CHECK(esp_console_cmd_register(&set_name));
|
||||
}
|
||||
/** 'tasks' command prints the list of tasks and related information */
|
||||
#if WITH_TASKS_INFO
|
||||
|
||||
@@ -394,16 +472,16 @@ static int tasks_info(int argc, char **argv)
|
||||
const size_t bytes_per_task = 40; /* see vTaskList description */
|
||||
char *task_list_buffer = malloc(uxTaskGetNumberOfTasks() * bytes_per_task);
|
||||
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;
|
||||
}
|
||||
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
|
||||
"\tAffinity"
|
||||
#endif
|
||||
"\n");
|
||||
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);
|
||||
return 0;
|
||||
}
|
||||
@@ -423,7 +501,7 @@ static void register_tasks()
|
||||
|
||||
extern esp_err_t update_certificates(bool force);
|
||||
static int force_update_cert(int argc, char **argv){
|
||||
return update_certificates(true)==ESP_OK;
|
||||
return update_certificates(true);
|
||||
}
|
||||
|
||||
static void register_update_certs()
|
||||
@@ -457,30 +535,31 @@ static int deep_sleep(int argc, char **argv)
|
||||
}
|
||||
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);
|
||||
cmd_send_messaging(argv[0],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);
|
||||
cmd_send_messaging(argv[0],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);
|
||||
cmd_send_messaging(argv[0],MESSAGING_ERROR, "Invalid wakeup level: %d", level);
|
||||
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");
|
||||
|
||||
ESP_ERROR_CHECK( esp_sleep_enable_ext1_wakeup(1ULL << io_num, level) );
|
||||
}
|
||||
rtc_gpio_isolate(GPIO_NUM_12);
|
||||
esp_deep_sleep_start();
|
||||
return 0; // this code will never run. deep sleep will cause the system to restart
|
||||
}
|
||||
|
||||
static void register_deep_sleep()
|
||||
@@ -505,7 +584,190 @@ static void register_deep_sleep()
|
||||
};
|
||||
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 */
|
||||
|
||||
static struct {
|
||||
@@ -524,22 +786,22 @@ static int light_sleep(int argc, char **argv)
|
||||
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
|
||||
if (light_sleep_args.wakeup_time->count) {
|
||||
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) );
|
||||
}
|
||||
int io_count = light_sleep_args.wakeup_gpio_num->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;
|
||||
}
|
||||
for (int i = 0; i < io_count; ++i) {
|
||||
int io_num = light_sleep_args.wakeup_gpio_num->ival[i];
|
||||
int level = light_sleep_args.wakeup_gpio_level->ival[i];
|
||||
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;
|
||||
}
|
||||
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");
|
||||
|
||||
ESP_ERROR_CHECK( gpio_wakeup_enable(io_num, level ? GPIO_INTR_HIGH_LEVEL : GPIO_INTR_LOW_LEVEL) );
|
||||
@@ -548,7 +810,7 @@ static int light_sleep(int argc, char **argv)
|
||||
ESP_ERROR_CHECK( esp_sleep_enable_gpio_wakeup() );
|
||||
}
|
||||
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( esp_sleep_enable_uart_wakeup(CONFIG_ESP_CONSOLE_UART_NUM) );
|
||||
}
|
||||
@@ -571,7 +833,7 @@ static int light_sleep(int argc, char **argv)
|
||||
cause_str = "unknown";
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ const char* recovery_prompt = LOG_COLOR_E "recovery-squeezelite-esp32> " LOG_RES
|
||||
|
||||
#define MOUNT_PATH "/data"
|
||||
#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_PARMS_TO_CMD(o,t,n) { cJSON * parms = ParmsToJSON(&t.n->hdr); if(parms) cJSON_AddItemToObject(o,QUOTE(n),parms); }
|
||||
cJSON * cmdList;
|
||||
@@ -99,6 +99,8 @@ cJSON * ParmsToJSON(struct arg_hdr * * argtable){
|
||||
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, "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);
|
||||
tabindex++;
|
||||
}
|
||||
@@ -171,7 +173,7 @@ int arg_parse_msg(int argc, char **argv, struct arg_hdr ** args){
|
||||
if (f != NULL) {
|
||||
arg_print_errors(f, getParmsEnd(args), argv[0]);
|
||||
fflush (f);
|
||||
log_send_messaging(MESSAGING_ERROR,"%s", buf);
|
||||
cmd_send_messaging(argv[0],MESSAGING_ERROR,"%s", buf);
|
||||
}
|
||||
fclose(f);
|
||||
FREE_AND_NULL(buf);
|
||||
@@ -254,7 +256,7 @@ void initialize_console() {
|
||||
esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM);
|
||||
|
||||
/* 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,
|
||||
#if CONFIG_LOG_COLORS
|
||||
.hint_color = atoi(LOG_COLOR_CYAN)
|
||||
@@ -285,7 +287,7 @@ void console_start() {
|
||||
}
|
||||
else {
|
||||
/* 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,
|
||||
#if CONFIG_LOG_COLORS
|
||||
.hint_color = atoi(LOG_COLOR_CYAN)
|
||||
@@ -296,8 +298,10 @@ void console_start() {
|
||||
/* Register commands */
|
||||
esp_console_register_help_command();
|
||||
register_system();
|
||||
register_config_cmd();
|
||||
register_nvs();
|
||||
register_wifi();
|
||||
|
||||
if(!is_recovery_running){
|
||||
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 */
|
||||
int 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);
|
||||
} else if (err == ESP_ERR_INVALID_ARG) {
|
||||
// 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_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) {
|
||||
ESP_LOGE(TAG,"Internal error: %s", esp_err_to_name(err));
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
static void * console_thread() {
|
||||
if(!is_recovery_running){
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#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);
|
||||
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);
|
||||
|
||||
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 .
|
||||
INCLUDE_DIRS . ${IDF_PATH}/components/driver
|
||||
REQUIRES json tools platform_config display
|
||||
|
||||
INCLUDE_DIRS . ${IDF_PATH}/components/driver
|
||||
REQUIRES json tools platform_config display
|
||||
PRIV_REQUIRES soc esp32 squeezelite
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -15,33 +15,322 @@
|
||||
#include "accessors.h"
|
||||
#include "globdefs.h"
|
||||
#include "display.h"
|
||||
#include "display.h"
|
||||
#include "cJSON.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "stdbool.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 *i2c_name="I2C";
|
||||
static const char *spi_name="SPI";
|
||||
|
||||
const char *i2c_name_type="I2C";
|
||||
const char *spi_name_type="SPI";
|
||||
cJSON * gpio_list=NULL;
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#ifndef QUOTE
|
||||
#define QUOTE(name) #name
|
||||
#endif
|
||||
#ifndef STR
|
||||
#define STR(macro) QUOTE(macro)
|
||||
#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){
|
||||
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,"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);
|
||||
config_set_value(NVS_TYPE_STR, "i2c_config", 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);
|
||||
log_send_messaging(MESSAGING_INFO,"Updating I2C configuration to %s",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);
|
||||
}
|
||||
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){
|
||||
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,"data=%u,clk=%u,dc=%u,host=%u",config->mosi_io_num,config->sclk_io_num,dc,host);
|
||||
log_send_messaging(MESSAGING_INFO,"Updating SPI configuration to %s",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);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
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");
|
||||
if (!config) {
|
||||
return NULL;
|
||||
@@ -50,19 +339,19 @@ const display_config_t * config_display_get(){
|
||||
char * p=NULL;
|
||||
|
||||
if ((p = strcasestr(config, "driver")) != NULL){
|
||||
sscanf(p, "%*[^:]:%u", &dstruct.depth);
|
||||
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, "height")) != NULL) dstruct.height = 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;
|
||||
if (strstr(config, "I2C") ) dstruct.type=i2c_name_type;
|
||||
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, "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.vflip= strcasestr(config, "VFlip") ? true : false;
|
||||
dstruct.rotate= strcasestr(config, "rotate") ? true : false;
|
||||
@@ -93,10 +382,90 @@ const i2c_config_t * config_i2c_get(int * i2c_port) {
|
||||
if ((p = strcasestr(nvs_item, "port")) != NULL) i2c_system_port = atoi(strchr(p, '=') + 1);
|
||||
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;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
const gpio_with_level_t * get_gpio_struct_member(const char * nvs_item, const char * name){
|
||||
static gpio_with_level_t gpio_member={
|
||||
.gpio=-1,
|
||||
.level=0
|
||||
};
|
||||
if(!nvs_item) return &gpio_member;
|
||||
const char * p=nvs_item;
|
||||
char type[20]={0};
|
||||
int match=0;
|
||||
do {
|
||||
if ((match=sscanf(p, "%d=%19[^,:]:%d", &gpio_member.gpio, type,&gpio_member.level)) >0 && (GPIO_IS_VALID_GPIO(gpio_member.gpio) || gpio_member.gpio==GPIO_NUM_NC) && strcasestr(type,name)){
|
||||
return &gpio_member;
|
||||
}
|
||||
p = strchr(p, ',');
|
||||
} while (p++);
|
||||
gpio_member.gpio=-1;
|
||||
gpio_member.level=0;
|
||||
return &gpio_member;
|
||||
}
|
||||
|
||||
#define HANDLE_GPIO_STRUCT_MEMBER(name,fixval) memcpy(&gpio_struct.name, get_gpio_struct_member(nvs_item, QUOTE(name)), sizeof(gpio_struct.name)); gpio_struct.name.fixed=fixval
|
||||
#define ADD_GPIO_STRUCT_MEMBER_TO_ARRAY(array,structvar,name,type) if(((set_GPIO_struct_t *)structvar)->name.gpio>=0){cJSON_AddItemToArray(array,get_gpio_entry(QUOTE(name),type,((set_GPIO_struct_t *)structvar)->name.gpio, ((set_GPIO_struct_t *)structvar)->name.fixed));}
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
const set_GPIO_struct_t * get_gpio_struct(){
|
||||
static set_GPIO_struct_t gpio_struct;
|
||||
char * nvs_item=config_alloc_get(NVS_TYPE_STR, "set_GPIO");
|
||||
#ifdef CONFIG_LED_GREEN_GPIO_LEVEL
|
||||
gpio_struct.green.level = CONFIG_LED_GREEN_GPIO_LEVEL;
|
||||
#endif
|
||||
#ifdef CONFIG_LED_GREEN_GPIO
|
||||
gpio_struct.green.gpio = CONFIG_LED_GREEN_GPIO;
|
||||
#endif
|
||||
#ifdef CONFIG_LED_RED_GPIO_LEVEL
|
||||
gpio_struct.green.level = CONFIG_LED_RED_GPIO_LEVEL;
|
||||
#endif
|
||||
#ifdef CONFIG_LED_RED_GPIO
|
||||
gpio_struct.red.gpio = CONFIG_LED_RED_GPIO;
|
||||
#endif
|
||||
if(nvs_item){
|
||||
HANDLE_GPIO_STRUCT_MEMBER(amp,false);
|
||||
#ifndef CONFIG_LED_LOCKED
|
||||
HANDLE_GPIO_STRUCT_MEMBER(green,false);
|
||||
HANDLE_GPIO_STRUCT_MEMBER(red,false);
|
||||
#endif
|
||||
HANDLE_GPIO_STRUCT_MEMBER(jack,false);
|
||||
HANDLE_GPIO_STRUCT_MEMBER(spkfault,false);
|
||||
HANDLE_GPIO_STRUCT_MEMBER(vcc,false);
|
||||
HANDLE_GPIO_STRUCT_MEMBER(gnd,false);
|
||||
HANDLE_GPIO_STRUCT_MEMBER(ir,false);
|
||||
free(nvs_item);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LED_LOCKED
|
||||
gpio_struct.red.fixed=true;
|
||||
gpio_struct.green.fixed=true;
|
||||
#endif
|
||||
#ifdef CONFIG_JACK_LOCKED
|
||||
gpio_struct.jack.gpio=CONFIG_JACK_GPIO;
|
||||
gpio_struct.jack.fixed=true;
|
||||
gpio_struct.jack.level=CONFIG_JACK_GPIO_LEVEL;
|
||||
#endif
|
||||
#ifdef CONFIG_SPKFAULT_LOCKED
|
||||
gpio_struct.spkfault.gpio=CONFIG_SPKFAULT_GPIO;
|
||||
gpio_struct.spkfault.fixed=true;
|
||||
gpio_struct.spkfault.level=CONFIG_SPKFAULT_GPIO_LEVEL;
|
||||
#endif
|
||||
return &gpio_struct;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
@@ -140,3 +509,378 @@ void parse_set_GPIO(void (*cb)(int gpio, char *value)) {
|
||||
|
||||
free(nvs_item);
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
cJSON * get_gpio_entry(const char * name, const char * prefix, int gpio, bool fixed){
|
||||
cJSON * entry = cJSON_CreateObject();
|
||||
cJSON_AddNumberToObject(entry,"gpio",gpio);
|
||||
cJSON_AddStringToObject(entry,"name",name);
|
||||
cJSON_AddStringToObject(entry,"group",prefix);
|
||||
cJSON_AddBoolToObject(entry,"fixed",fixed);
|
||||
return entry;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
cJSON * add_gpio_for_name(cJSON * list,const char * nvs_entry,const char * name, const char * prefix, bool fixed){
|
||||
cJSON * llist = list?list:cJSON_CreateArray();
|
||||
char *p;
|
||||
int gpioNum=0;
|
||||
if ((p = strcasestr(nvs_entry, name)) != NULL) {
|
||||
gpioNum = atoi(strchr(p, '=') + 1);
|
||||
if(gpioNum>=0){
|
||||
cJSON_AddItemToArray(llist,get_gpio_entry(name,prefix,gpioNum,fixed));
|
||||
}
|
||||
}
|
||||
return llist;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
cJSON * get_GPIO_nvs_list(cJSON * list) {
|
||||
cJSON * ilist = list?list:cJSON_CreateArray();
|
||||
const set_GPIO_struct_t * gpios = get_gpio_struct();
|
||||
ADD_GPIO_STRUCT_MEMBER_TO_ARRAY(ilist,gpios,vcc,"other");
|
||||
ADD_GPIO_STRUCT_MEMBER_TO_ARRAY(ilist,gpios,gnd,"other");
|
||||
ADD_GPIO_STRUCT_MEMBER_TO_ARRAY(ilist,gpios,amp,"other");
|
||||
ADD_GPIO_STRUCT_MEMBER_TO_ARRAY(ilist,gpios,ir,"other");
|
||||
ADD_GPIO_STRUCT_MEMBER_TO_ARRAY(ilist,gpios,jack,"other");
|
||||
ADD_GPIO_STRUCT_MEMBER_TO_ARRAY(ilist,gpios,green,"other");
|
||||
ADD_GPIO_STRUCT_MEMBER_TO_ARRAY(ilist,gpios,red,"other");
|
||||
ADD_GPIO_STRUCT_MEMBER_TO_ARRAY(ilist,gpios,spkfault,"other");
|
||||
return ilist;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
cJSON * get_SPDIF_GPIO(cJSON * list, bool fixed){
|
||||
cJSON * llist = list?list:cJSON_CreateArray();
|
||||
char * spdif_config = config_spdif_get_string();
|
||||
if(spdif_config){
|
||||
llist = add_gpio_for_name(llist,spdif_config,"bck", "spdif", fixed);
|
||||
llist = add_gpio_for_name(llist,spdif_config,"ws", "spdif", fixed);
|
||||
llist = add_gpio_for_name(llist,spdif_config,"do", "spdif", fixed);
|
||||
free(spdif_config);
|
||||
}
|
||||
return llist;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
cJSON * get_Rotary_GPIO(cJSON * list){
|
||||
cJSON * llist = list?list:cJSON_CreateArray();
|
||||
char *config = config_alloc_get_default(NVS_TYPE_STR, "rotary_config", NULL, 0);
|
||||
if(config){
|
||||
llist = add_gpio_for_name(llist,config,"A", "rotary", false);
|
||||
llist = add_gpio_for_name(llist,config,"B", "rotary", false);
|
||||
llist = add_gpio_for_name(llist,config,"SW", "rotary", false);
|
||||
free(config);
|
||||
}
|
||||
return llist;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
esp_err_t get_gpio_structure(cJSON * gpio_entry, gpio_entry_t ** gpio){
|
||||
esp_err_t err = ESP_OK;
|
||||
*gpio = malloc(sizeof(gpio_entry_t));
|
||||
cJSON * val = cJSON_GetObjectItem(gpio_entry,"gpio");
|
||||
if(val){
|
||||
(*gpio)->gpio= (int)val->valuedouble;
|
||||
} else {
|
||||
ESP_LOGE(TAG,"gpio pin not found");
|
||||
err=ESP_FAIL;
|
||||
}
|
||||
val = cJSON_GetObjectItem(gpio_entry,"name");
|
||||
if(val){
|
||||
(*gpio)->name= strdup(cJSON_GetStringValue(val));
|
||||
} else {
|
||||
ESP_LOGE(TAG,"gpio name value not found");
|
||||
err=ESP_FAIL;
|
||||
}
|
||||
val = cJSON_GetObjectItem(gpio_entry,"group");
|
||||
if(val){
|
||||
(*gpio)->group= strdup(cJSON_GetStringValue(val));
|
||||
} else {
|
||||
ESP_LOGE(TAG,"gpio group value not found");
|
||||
err=ESP_FAIL;
|
||||
}
|
||||
val = cJSON_GetObjectItem(gpio_entry,"fixed");
|
||||
if(val){
|
||||
(*gpio)->fixed= cJSON_IsTrue(val);
|
||||
} else {
|
||||
ESP_LOGE(TAG,"gpio fixed indicator not found");
|
||||
err=ESP_FAIL;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
esp_err_t free_gpio_entry( gpio_entry_t ** gpio) {
|
||||
if(* gpio){
|
||||
free((* gpio)->name);
|
||||
free((* gpio)->group);
|
||||
free(* gpio);
|
||||
* gpio=NULL;
|
||||
return ESP_OK;
|
||||
}
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
gpio_entry_t * get_gpio_by_no(int gpionum, bool refresh){
|
||||
cJSON * gpio_header=NULL;
|
||||
gpio_entry_t * gpio=NULL;
|
||||
get_gpio_list(refresh);
|
||||
cJSON_ArrayForEach(gpio_header,gpio_list)
|
||||
{
|
||||
if(get_gpio_structure(gpio_header, &gpio)==ESP_OK && gpio->gpio==gpionum){
|
||||
ESP_LOGD(TAG,"Found GPIO: %s=%d %s", gpio->name,gpio->gpio,gpio->fixed?"(FIXED)":"(VARIABLE)");
|
||||
}
|
||||
}
|
||||
return gpio;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
gpio_entry_t * get_gpio_by_name(char * name,char * group, bool refresh){
|
||||
cJSON * gpio_header=NULL;
|
||||
gpio_entry_t * gpio=NULL;
|
||||
get_gpio_list(refresh);
|
||||
cJSON_ArrayForEach(gpio_header,gpio_list)
|
||||
{
|
||||
if(get_gpio_structure(gpio_header, &gpio)==ESP_OK && strcasecmp(gpio->name,name)&& strcasecmp(gpio->group,group)){
|
||||
ESP_LOGD(TAG,"Found GPIO: %s=%d %s", gpio->name,gpio->gpio,gpio->fixed?"(FIXED)":"(VARIABLE)");
|
||||
}
|
||||
}
|
||||
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(bool refresh) {
|
||||
gpio_num_t gpio_num;
|
||||
if(gpio_list && !refresh){
|
||||
return gpio_list;
|
||||
}
|
||||
|
||||
if(gpio_list){
|
||||
cJSON_Delete(gpio_list);
|
||||
}
|
||||
gpio_list= cJSON_CreateArray();
|
||||
|
||||
#ifndef CONFIG_BAT_LOCKED
|
||||
char *bat_config = config_alloc_get_default(NVS_TYPE_STR, "bat_config", NULL, 0);
|
||||
if (bat_config) {
|
||||
char *p;
|
||||
int channel;
|
||||
if ((p = strcasestr(bat_config, "channel") ) != NULL) {
|
||||
channel = atoi(strchr(p, '=') + 1);
|
||||
if(channel != -1){
|
||||
if(adc1_pad_get_io_num(channel,&gpio_num )==ESP_OK){
|
||||
cJSON_AddItemToArray(gpio_list,get_gpio_entry("bat","other",gpio_num,false));
|
||||
}
|
||||
}
|
||||
}
|
||||
free(bat_config);
|
||||
}
|
||||
#else
|
||||
if(adc1_pad_get_io_num(CONFIG_BAT_CHANNEL,&gpio_num )==ESP_OK){
|
||||
cJSON_AddItemToArray(gpio_list,get_gpio_entry("bat","other",gpio_num,true));
|
||||
}
|
||||
#endif
|
||||
gpio_list=get_GPIO_nvs_list(gpio_list);
|
||||
gpio_list=get_SPDIF_GPIO(gpio_list,is_spdif_config_locked());
|
||||
gpio_list=get_Rotary_GPIO(gpio_list);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -10,23 +10,75 @@
|
||||
|
||||
#include "esp_system.h"
|
||||
#include "driver/i2c.h"
|
||||
#include "driver/i2s.h"
|
||||
#include "driver/spi_master.h"
|
||||
extern const char *i2c_name_type;
|
||||
extern const char *spi_name_type;
|
||||
typedef struct {
|
||||
int width;
|
||||
int height;
|
||||
int RST_pin;
|
||||
int i2c_system_port;
|
||||
int address;
|
||||
int CS_pin;
|
||||
int speed;
|
||||
const char *drivername;
|
||||
const char *type;
|
||||
int RST_pin;
|
||||
bool hflip;
|
||||
bool vflip;
|
||||
const char *drivername;
|
||||
int CS_pin;
|
||||
int speed;
|
||||
int back;
|
||||
int depth;
|
||||
const char *type;
|
||||
bool rotate;
|
||||
} display_config_t;
|
||||
const display_config_t * config_display_get();
|
||||
|
||||
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 {
|
||||
int gpio;
|
||||
int level;
|
||||
bool fixed;
|
||||
} gpio_with_level_t;
|
||||
|
||||
typedef struct {
|
||||
gpio_with_level_t vcc;
|
||||
gpio_with_level_t gnd;
|
||||
gpio_with_level_t amp;
|
||||
gpio_with_level_t ir;
|
||||
gpio_with_level_t jack;
|
||||
gpio_with_level_t green;
|
||||
gpio_with_level_t red;
|
||||
gpio_with_level_t spkfault;
|
||||
} set_GPIO_struct_t;
|
||||
|
||||
typedef struct {
|
||||
bool fixed;
|
||||
char * name;
|
||||
char * group;
|
||||
int gpio;
|
||||
} 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);
|
||||
gpio_entry_t * get_gpio_by_name(char * name,char * group, bool refresh);
|
||||
gpio_entry_t * get_gpio_by_no(int gpionum, bool refresh);
|
||||
cJSON * get_gpio_list(bool refresh);
|
||||
bool is_dac_config_locked();
|
||||
bool are_statistics_enabled();
|
||||
@@ -43,7 +43,7 @@ static struct {
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
int battery_value_svc(void) {
|
||||
float battery_value_svc(void) {
|
||||
return battery.avg;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ static void vCallbackFunction( TimerHandle_t xTimer ) {
|
||||
bool led_blink_core(int idx, int ontime, int offtime, bool pushed) {
|
||||
if (!leds[idx].gpio || leds[idx].gpio < 0 ) return false;
|
||||
|
||||
ESP_LOGD(TAG,"led_blink_core");
|
||||
ESP_LOGD(TAG,"led_blink_core %d on:%d off:%d, pushed:%u", idx, ontime, offtime, pushed);
|
||||
if (leds[idx].timer) {
|
||||
// normal requests waits if a pop is pending
|
||||
if (!pushed && leds[idx].pushed) {
|
||||
@@ -231,8 +231,7 @@ void led_svc_init(void) {
|
||||
#ifndef CONFIG_LED_LOCKED
|
||||
parse_set_GPIO(set_led_gpio);
|
||||
#endif
|
||||
ESP_LOGI(TAG,"Configuring LEDs green:%d (active:%d %d%%), red:%d (active:%d %d%%)", green.gpio, green.active, green.pwm, green.gpio, green.active, green.pwm );
|
||||
|
||||
|
||||
char *nvs_item = config_alloc_get(NVS_TYPE_STR, "led_brightness"), *p;
|
||||
if (nvs_item) {
|
||||
if ((p = strcasestr(nvs_item, "green")) != NULL) green.pwm = atoi(strchr(p, '=') + 1);
|
||||
@@ -242,4 +241,6 @@ void led_svc_init(void) {
|
||||
|
||||
led_config(LED_GREEN, green.gpio, green.active, green.pwm);
|
||||
led_config(LED_RED, red.gpio, red.active, red.pwm);
|
||||
|
||||
ESP_LOGI(TAG,"Configuring LEDs green:%d (active:%d %d%%), red:%d (active:%d %d%%)", green.gpio, green.active, green.pwm, red.gpio, red.active, red.pwm );
|
||||
}
|
||||
|
||||
@@ -119,6 +119,8 @@ const char * messaging_get_class_desc(messaging_classes msg_class){
|
||||
CASE_TO_STR(MESSAGING_CLASS_OTA);
|
||||
CASE_TO_STR(MESSAGING_CLASS_SYSTEM);
|
||||
CASE_TO_STR(MESSAGING_CLASS_STATS);
|
||||
CASE_TO_STR(MESSAGING_CLASS_CFGCMD);
|
||||
CASE_TO_STR(MESSAGING_CLASS_BT);
|
||||
default:
|
||||
return "Unknown";
|
||||
break;
|
||||
@@ -141,12 +143,12 @@ cJSON * messaging_retrieve_messages(RingbufHandle_t buf_handle){
|
||||
else {
|
||||
json_message = cJSON_CreateObject();
|
||||
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, "class", messaging_get_class_desc(message->msg_class));
|
||||
cJSON_AddNumberToObject(json_message,"sent_time",message->sent_time);
|
||||
cJSON_AddNumberToObject(json_message,"current_time",esp_timer_get_time() / 1000);
|
||||
cJSON_AddItemToArray(json_messages,json_message);
|
||||
vRingbufferReturnItem(buf_handle, (void *)message);
|
||||
}
|
||||
}
|
||||
return json_messages;
|
||||
@@ -260,5 +262,23 @@ void log_send_messaging(messaging_types msgtype,const char *fmt, ...) {
|
||||
else{
|
||||
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 "freertos/FreeRTOS.h"
|
||||
#include "freertos/ringbuf.h"
|
||||
#include "cJSON.h"
|
||||
#pragma once
|
||||
@@ -10,7 +11,9 @@ typedef enum {
|
||||
typedef enum {
|
||||
MESSAGING_CLASS_OTA,
|
||||
MESSAGING_CLASS_SYSTEM,
|
||||
MESSAGING_CLASS_STATS
|
||||
MESSAGING_CLASS_STATS,
|
||||
MESSAGING_CLASS_CFGCMD,
|
||||
MESSAGING_CLASS_BT
|
||||
} messaging_classes;
|
||||
|
||||
typedef struct messaging_list_t *messaging_handle_t;
|
||||
@@ -30,6 +33,7 @@ void messaging_post_message(messaging_types type,messaging_classes msg_class, co
|
||||
cJSON * messaging_retrieve_messages(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 cmd_send_messaging(const char * cmdname,messaging_types msgtype, const char *fmt, ...);
|
||||
esp_err_t messaging_type_to_err_type(messaging_types type);
|
||||
void messaging_service_init();
|
||||
|
||||
|
||||
@@ -32,11 +32,8 @@ static const char *TAG = "monitor";
|
||||
|
||||
static TimerHandle_t monitor_timer;
|
||||
|
||||
static struct {
|
||||
int gpio;
|
||||
int active;
|
||||
} jack = { CONFIG_JACK_GPIO, 0 },
|
||||
spkfault = { CONFIG_SPKFAULT_GPIO, 0 };
|
||||
static monitor_gpio_t jack = { CONFIG_JACK_GPIO, 0 };
|
||||
static monitor_gpio_t spkfault = { CONFIG_SPKFAULT_GPIO, 0 };
|
||||
|
||||
void (*jack_handler_svc)(bool inserted);
|
||||
bool jack_inserted_svc(void);
|
||||
@@ -44,11 +41,13 @@ bool jack_inserted_svc(void);
|
||||
void (*spkfault_handler_svc)(bool inserted);
|
||||
bool spkfault_svc(void);
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
static void task_stats( cJSON* top ) {
|
||||
#ifdef CONFIG_FREERTOS_USE_TRACE_FACILITY
|
||||
#pragma message("Compiled with trace facility")
|
||||
static struct {
|
||||
TaskStatus_t *tasks;
|
||||
uint32_t total, n;
|
||||
@@ -63,6 +62,7 @@ static void task_stats( cJSON* top ) {
|
||||
*scratch = '\0';
|
||||
|
||||
#ifdef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS
|
||||
#pragma message("Compiled with runtime stats")
|
||||
uint32_t elapsed = current.total - previous.total;
|
||||
|
||||
for(int i = 0, n = 0; i < current.n; i++ ) {
|
||||
@@ -90,6 +90,8 @@ static void task_stats( cJSON* top ) {
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma message("Compiled WITHOUT runtime stats")
|
||||
|
||||
for (int i = 0, n = 0; i < current.n; i ++) {
|
||||
n += sprintf(scratch + n, "%16s s:%5u\t", current.tasks[i].pcTaskName, current.tasks[i].usStackHighWaterMark);
|
||||
cJSON * t=cJSON_CreateObject();
|
||||
@@ -109,6 +111,8 @@ static void task_stats( cJSON* top ) {
|
||||
cJSON_AddItemToObject(top,"tasks",tlist);
|
||||
if (previous.tasks) free(previous.tasks);
|
||||
previous = current;
|
||||
#else
|
||||
#pragma message("Compiled WITHOUT trace facility")
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -142,7 +146,6 @@ static void monitor_callback(TimerHandle_t xTimer) {
|
||||
*/
|
||||
static void jack_handler_default(void *id, button_event_e event, button_press_e mode, bool long_press) {
|
||||
ESP_LOGD(TAG, "Jack %s", event == BUTTON_PRESSED ? "inserted" : "removed");
|
||||
messaging_post_message(MESSAGING_INFO, MESSAGING_CLASS_SYSTEM,"jack is %s",BUTTON_PRESSED ? "inserted" : "removed");
|
||||
if (jack_handler_svc) (*jack_handler_svc)(event == BUTTON_PRESSED);
|
||||
}
|
||||
|
||||
@@ -181,6 +184,9 @@ static void set_jack_gpio(int gpio, char *value) {
|
||||
jack.gpio = gpio;
|
||||
if ((p = strchr(value, ':')) != NULL) jack.active = atoi(p + 1);
|
||||
}
|
||||
else {
|
||||
jack.gpio = -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -194,6 +200,9 @@ static void set_spkfault_gpio(int gpio, char *value) {
|
||||
spkfault.gpio = gpio;
|
||||
if ((p = strchr(value, ':')) != NULL) spkfault.active = atoi(p + 1);
|
||||
}
|
||||
else {
|
||||
spkfault.gpio = -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -237,7 +246,7 @@ void monitor_svc_init(void) {
|
||||
monitor_timer = xTimerCreate("monitor", MONITOR_TIMER / portTICK_RATE_MS, pdTRUE, NULL, monitor_callback);
|
||||
xTimerStart(monitor_timer, portMAX_DELAY);
|
||||
}
|
||||
free(p);
|
||||
FREE_AND_NULL(p);
|
||||
|
||||
ESP_LOGI(TAG, "Heap internal:%zu (min:%zu) external:%zu (min:%zu)",
|
||||
heap_caps_get_free_size(MALLOC_CAP_INTERNAL),
|
||||
@@ -245,3 +254,17 @@ void monitor_svc_init(void) {
|
||||
heap_caps_get_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
|
||||
typedef struct {
|
||||
int gpio;
|
||||
int active;
|
||||
} monitor_gpio_t;
|
||||
|
||||
extern void (*jack_handler_svc)(bool inserted);
|
||||
extern bool jack_inserted_svc(void);
|
||||
@@ -16,6 +20,9 @@ extern bool jack_inserted_svc(void);
|
||||
extern void (*spkfault_handler_svc)(bool inserted);
|
||||
extern bool spkfault_svc(void);
|
||||
|
||||
extern int battery_value_svc(void);
|
||||
extern float battery_value_svc(void);
|
||||
extern uint8_t battery_level_svc(void);
|
||||
|
||||
extern monitor_gpio_t * get_spkfault_gpio();
|
||||
extern monitor_gpio_t * get_jack_insertion_gpio();
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "squeezelite.h"
|
||||
|
||||
#include <alac_wrapper.h>
|
||||
#include "alac_wrapper.h"
|
||||
|
||||
#if BYTES_PER_FRAME == 4
|
||||
#define ALIGN8(n) (n << 8)
|
||||
@@ -119,8 +119,15 @@ static int read_mp4_header(void) {
|
||||
// extract audio config from within alac
|
||||
if (!strcmp(type, "alac") && bytes > len) {
|
||||
u8_t *ptr = streambuf->readp + 36;
|
||||
l->decoder = alac_create_decoder(len - 36, ptr, &l->sample_size, &l->sample_rate, &l->channels);
|
||||
l->play = l->trak;
|
||||
unsigned int block_size;
|
||||
l->play = l->trak;
|
||||
l->decoder = alac_create_decoder(len - 36, ptr, &l->sample_size, &l->sample_rate, &l->channels, &block_size);
|
||||
l->writebuf = malloc(block_size + 256);
|
||||
LOG_INFO("allocated write buffer of %u bytes", block_size);
|
||||
if (!l->writebuf) {
|
||||
LOG_ERROR("allocation failed");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// extract the total number of samples from stts
|
||||
@@ -374,10 +381,9 @@ static decode_state alac_decode(void) {
|
||||
|
||||
// need to create a buffer with contiguous data
|
||||
if (bytes < block_size) {
|
||||
u8_t *buffer = malloc(block_size);
|
||||
memcpy(buffer, streambuf->readp, bytes);
|
||||
memcpy(buffer + bytes, streambuf->buf, block_size - bytes);
|
||||
iptr = buffer;
|
||||
iptr = malloc(block_size);
|
||||
memcpy(iptr, streambuf->readp, bytes);
|
||||
memcpy(iptr + bytes, streambuf->buf, block_size - bytes);
|
||||
} else iptr = streambuf->readp;
|
||||
|
||||
if (!alac_to_pcm(l->decoder, iptr, l->writebuf, 2, &frames)) {
|
||||
@@ -472,6 +478,7 @@ static decode_state alac_decode(void) {
|
||||
}
|
||||
} else if (l->sample_size == 16) {
|
||||
u16_t *_iptr = (u16_t*) iptr;
|
||||
iptr += count * 4;
|
||||
while (count--) {
|
||||
*optr++ = ALIGN16(*_iptr++);
|
||||
*optr++ = ALIGN16(*_iptr++);
|
||||
@@ -484,6 +491,7 @@ static decode_state alac_decode(void) {
|
||||
}
|
||||
} else if (l->sample_size == 32) {
|
||||
u32_t *_iptr = (u32_t*) iptr;
|
||||
iptr += count * 8;
|
||||
while (count--) {
|
||||
*optr++ = ALIGN32(*_iptr++);
|
||||
*optr++ = ALIGN32(*_iptr++);
|
||||
@@ -509,27 +517,17 @@ static decode_state alac_decode(void) {
|
||||
return DECODE_RUNNING;
|
||||
}
|
||||
|
||||
static void alac_open(u8_t size, u8_t rate, u8_t chan, u8_t endianness) {
|
||||
if (l->decoder) alac_delete_decoder(l->decoder);
|
||||
else l->writebuf = malloc(BLOCK_SIZE * 2);
|
||||
|
||||
if (l->chunkinfo) free(l->chunkinfo);
|
||||
if (l->block_size) free(l->block_size);
|
||||
if (l->stsc) free(l->stsc);
|
||||
l->decoder = l->chunkinfo = l->stsc = l->block_size = NULL;
|
||||
l->skip = 0;
|
||||
l->samples = l->sttssamples = 0;
|
||||
l->empty = false;
|
||||
l->pos = l->consume = l->sample = l->nextchunk = 0;
|
||||
}
|
||||
|
||||
static void alac_close(void) {
|
||||
if (l->decoder) alac_delete_decoder(l->decoder);
|
||||
if (l->writebuf) free(l->writebuf);
|
||||
if (l->chunkinfo) free(l->chunkinfo);
|
||||
if (l->block_size) free(l->block_size);
|
||||
if (l->stsc) free(l->stsc);
|
||||
l->decoder = l->chunkinfo = l->stsc = l->block_size = NULL;
|
||||
free(l->writebuf);
|
||||
memset(l, 0, sizeof(struct alac));
|
||||
}
|
||||
|
||||
static void alac_open(u8_t size, u8_t rate, u8_t chan, u8_t endianness) {
|
||||
alac_close();
|
||||
}
|
||||
|
||||
struct codec *register_alac(void) {
|
||||
@@ -543,13 +541,9 @@ struct codec *register_alac(void) {
|
||||
alac_decode, // decode
|
||||
};
|
||||
|
||||
l = malloc(sizeof(struct alac));
|
||||
if (!l) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
l->decoder = l->chunkinfo = l->stsc = l->block_size = NULL;
|
||||
|
||||
l = calloc(1, sizeof(struct alac));
|
||||
if (!l) return NULL;
|
||||
|
||||
LOG_INFO("using alac to decode alc");
|
||||
return &ret;
|
||||
}
|
||||
|
||||
@@ -279,6 +279,7 @@ static void notify(in_addr_t ip, u16_t hport, u16_t cport) {
|
||||
|
||||
if (connect(cli_sock, (struct sockaddr *) &addr, addrlen) < 0) {
|
||||
LOG_ERROR("unable to connect to server %s:%hu with cli", inet_ntoa(server_ip), server_cport);
|
||||
closesocket(cli_sock);
|
||||
cli_sock = -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -327,12 +327,12 @@ void register_external(void) {
|
||||
|
||||
void deregister_external(void) {
|
||||
if (!strcasestr(output.device, "BT ") && enable_bt_sink) {
|
||||
bt_sink_deinit();
|
||||
LOG_INFO("Stopping BT sink");
|
||||
bt_sink_deinit();
|
||||
}
|
||||
if (enable_airplay){
|
||||
LOG_INFO("Stopping AirPlay sink");
|
||||
raop_sink_deinit();
|
||||
LOG_INFO("Stopping AirPlay sink");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -808,6 +808,8 @@ static void grfa_handler(u8_t *data, int len) {
|
||||
artwork.y = htons(pkt->y);
|
||||
} else if (artwork.size) GDS_ClearWindow(display, artwork.x, artwork.y, -1, -1, GDS_COLOR_BLACK);
|
||||
|
||||
LOG_INFO("gfra en:%u x:%hu, y:%hu", artwork.enable, artwork.x, artwork.y);
|
||||
|
||||
// done in any case
|
||||
return;
|
||||
}
|
||||
@@ -875,7 +877,7 @@ static void visu_update(void) {
|
||||
|
||||
// convert to dB (1 bit remaining for getting X²/N, 60dB dynamic starting from 0dBFS = 3 bits back-off)
|
||||
for (int i = visu.n; --i >= 0;) {
|
||||
visu.bars[i].current = visu.max * (0.01667f*10*log10f(0.0000001f + (visu.bars[i].current >> (visu_export.gain == FIXED_ONE ? 7 : 1))) - 0.2543f);
|
||||
visu.bars[i].current = visu.max * (0.01667f*10*log10f(0.0000001f + (visu.bars[i].current >> (visu_export.gain == FIXED_ONE ? 8 : 1))) - 0.2543f);
|
||||
if (visu.bars[i].current > visu.max) visu.bars[i].current = visu.max;
|
||||
else if (visu.bars[i].current < 0) visu.bars[i].current = 0;
|
||||
}
|
||||
@@ -917,7 +919,7 @@ static void visu_update(void) {
|
||||
}
|
||||
|
||||
// convert to dB and bars, same back-off
|
||||
if (power) visu.bars[i].current = visu.max * (0.01667f*10*(log10f(power) - log10f(FFT_LEN/(visu_export.gain == FIXED_ONE ? 128 : 2)*2)) - 0.2543f);
|
||||
if (power) visu.bars[i].current = visu.max * (0.01667f*10*(log10f(power) - log10f(FFT_LEN*(visu_export.gain == FIXED_ONE ? 256 : 2))) - 0.2543f);
|
||||
if (visu.bars[i].current > visu.max) visu.bars[i].current = visu.max;
|
||||
else if (visu.bars[i].current < 0) visu.bars[i].current = 0;
|
||||
}
|
||||
@@ -970,7 +972,7 @@ static void visu_update(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (displayer.width / 2 > 3 * VU_WIDTH / 4) {
|
||||
} else if (displayer.width / 2 >= 3 * VU_WIDTH / 4) {
|
||||
if (visu.rotate) {
|
||||
draw_VU(display, vu_bitmap, visu.bars[0].current, 0, visu.row, visu.height / 2, visu.rotate);
|
||||
draw_VU(display, vu_bitmap, visu.bars[1].current, 0, visu.row + visu.height / 2, visu.height / 2, visu.rotate);
|
||||
@@ -1042,7 +1044,7 @@ static void visu_handler( u8_t *data, int len) {
|
||||
|
||||
// little trick to clean the taller screens when switching visu
|
||||
if (visu.row >= displayer.height) GDS_ClearExt(display, false, true, visu.col, visu.row, visu.col + visu.width - 1, visu.row + visu.height - 1);
|
||||
|
||||
|
||||
if (visu.mode) {
|
||||
// these will be overidden if necessary
|
||||
visu.col = visu.border = 0;
|
||||
@@ -1065,13 +1067,27 @@ static void visu_handler( u8_t *data, int len) {
|
||||
bars = htonl(pkt->bars);
|
||||
visu.spectrum_scale = htonl(pkt->spectrum_scale) / 100.;
|
||||
} else {
|
||||
// full screen visu, try to use bottom screen if available
|
||||
// full screen visu, try to optimize orientation/shape
|
||||
visu.width = htonl(pkt->full.width);
|
||||
visu.height = GDS_GetHeight(display) > displayer.height ? GDS_GetHeight(display) - displayer.height : GDS_GetHeight(display);
|
||||
visu.row = GDS_GetHeight(display) - visu.height;
|
||||
visu.height = GDS_GetHeight(display);
|
||||
|
||||
// try to estimate if we should rotate visu
|
||||
if (visu.height > displayer.height && visu.height > 2*visu.width) visu.rotate = true;
|
||||
// do we have enough height to play with layout
|
||||
if (GDS_GetHeight(display) > displayer.height) {
|
||||
// by default, use up to the bottom of the display
|
||||
visu.height -= displayer.height;
|
||||
visu.row = displayer.height;
|
||||
|
||||
if (artwork.enable && artwork.y) {
|
||||
// server sets width to artwork X offset to tell us to rotate
|
||||
if (visu.width != artwork.x) {
|
||||
visu.height = artwork.y - displayer.height;
|
||||
if (visu.height <= 0) {
|
||||
visu.height = displayer.height;
|
||||
LOG_WARN("No room left for visualizer, disable it or increase artwork offset %d", artwork.y);
|
||||
}
|
||||
} else visu.rotate = true;
|
||||
}
|
||||
} else visu.row = 0;
|
||||
|
||||
// is this spectrum or analogue/digital
|
||||
if ((visu.mode & ~VISU_ESP32) == VISU_SPECTRUM) {
|
||||
@@ -1094,9 +1110,10 @@ static void visu_handler( u8_t *data, int len) {
|
||||
visu.style = htonl(pkt->classical_vu.style);
|
||||
if (visu.style) visu.row = visu.height - VU_HEIGHT;
|
||||
}
|
||||
if (bars > MAX_BARS) bars = MAX_BARS;
|
||||
}
|
||||
|
||||
if (bars > MAX_BARS) bars = MAX_BARS;
|
||||
|
||||
// for rotate, swap width & height
|
||||
if (visu.rotate) visu_fit(bars, visu.height, visu.width);
|
||||
else visu_fit(bars, visu.width, visu.height);
|
||||
|
||||
@@ -51,7 +51,7 @@ u8_t custom_player_id = 12;
|
||||
void embedded_init(void) {
|
||||
mutex_create(slimp_mutex);
|
||||
sb_controls_init();
|
||||
if (sb_display_init()) custom_player_id = 100;
|
||||
custom_player_id = sb_display_init() ? 100 : 101;
|
||||
}
|
||||
|
||||
u16_t get_RSSI(void) {
|
||||
|
||||
@@ -35,7 +35,7 @@ typedef unsigned long long u64_t;
|
||||
#define OUTPUT_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
|
||||
|
||||
// or can be as simple as #define PLAYER_ID 100
|
||||
|
||||
@@ -76,7 +76,7 @@ void equalizer_update(s8_t *gain) {
|
||||
* process equalizer
|
||||
*/
|
||||
void equalizer_process(u8_t *buf, u32_t bytes, u32_t sample_rate) {
|
||||
// don't want to process with output locked, so tak ethe small risk to miss one parametric update
|
||||
// don't want to process with output locked, so take the small risk to miss one parametric update
|
||||
if (equalizer.update) {
|
||||
equalizer_close();
|
||||
equalizer_open(sample_rate);
|
||||
|
||||
10
components/squeezelite/external/dac_external.c
vendored
10
components/squeezelite/external/dac_external.c
vendored
@@ -128,12 +128,12 @@ static esp_err_t i2c_write_reg(uint8_t reg, uint8_t val) {
|
||||
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
|
||||
i2c_master_start(cmd);
|
||||
|
||||
i2c_master_write_byte(cmd, i2c_addr | I2C_MASTER_WRITE, I2C_MASTER_NACK);
|
||||
i2c_master_write_byte(cmd, (i2c_addr << 1) | I2C_MASTER_WRITE, I2C_MASTER_NACK);
|
||||
i2c_master_write_byte(cmd, reg, I2C_MASTER_NACK);
|
||||
i2c_master_write_byte(cmd, val, I2C_MASTER_NACK);
|
||||
|
||||
i2c_master_stop(cmd);
|
||||
ret = i2c_master_cmd_begin(i2c_port, cmd, 1000 / portTICK_RATE_MS);
|
||||
ret = i2c_master_cmd_begin(i2c_port, cmd, 100 / portTICK_RATE_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
|
||||
if (ret != ESP_OK) {
|
||||
@@ -153,15 +153,15 @@ static uint8_t i2c_read_reg(uint8_t reg) {
|
||||
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
|
||||
i2c_master_start(cmd);
|
||||
|
||||
i2c_master_write_byte(cmd, i2c_addr | I2C_MASTER_WRITE, I2C_MASTER_NACK);
|
||||
i2c_master_write_byte(cmd, (i2c_addr << 1) | I2C_MASTER_WRITE, I2C_MASTER_NACK);
|
||||
i2c_master_write_byte(cmd, reg, I2C_MASTER_NACK);
|
||||
|
||||
i2c_master_start(cmd);
|
||||
i2c_master_write_byte(cmd, i2c_addr | I2C_MASTER_READ, I2C_MASTER_NACK);
|
||||
i2c_master_write_byte(cmd, (i2c_addr << 1) | I2C_MASTER_READ, I2C_MASTER_NACK);
|
||||
i2c_master_read_byte(cmd, &data, I2C_MASTER_NACK);
|
||||
|
||||
i2c_master_stop(cmd);
|
||||
ret = i2c_master_cmd_begin(i2c_port, cmd, 1000 / portTICK_RATE_MS);
|
||||
ret = i2c_master_cmd_begin(i2c_port, cmd, 100 / portTICK_RATE_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
|
||||
if (ret != ESP_OK) {
|
||||
|
||||
@@ -430,12 +430,11 @@ static decode_state helixaac_decode(void) {
|
||||
}
|
||||
}
|
||||
|
||||
// we always have at least WRAPBUF_LEN unless it's the end of a stream
|
||||
if (bytes_wrap < WRAPBUF_LEN) {
|
||||
// we always have at least WRAPBUF_LEN unless it's the end of a stream
|
||||
if (bytes_wrap < WRAPBUF_LEN && bytes_wrap != bytes_total) {
|
||||
// build a linear buffer if we are crossing the end of streambuf
|
||||
memcpy(a->wrap_buf, streambuf->readp, bytes_wrap);
|
||||
memcpy(a->wrap_buf + bytes_wrap, streambuf->buf, min(WRAPBUF_LEN, bytes_total) - bytes_wrap);
|
||||
|
||||
memcpy(a->wrap_buf + bytes_wrap, streambuf->buf, min(WRAPBUF_LEN, bytes_total) - bytes_wrap);
|
||||
sptr = a->wrap_buf;
|
||||
bytes = bytes_wrap = min(WRAPBUF_LEN, bytes_total);
|
||||
} else {
|
||||
|
||||
@@ -253,6 +253,9 @@ frames_t _output_frames(frames_t avail) {
|
||||
}
|
||||
|
||||
out_frames = !silence ? min(size, cont_frames) : size;
|
||||
|
||||
if (output.channels & 0x01) gainR = MONO_MUTED;
|
||||
else if (output.channels & 0x02) gainL = MONO_MUTED;
|
||||
|
||||
wrote = output.write_cb(out_frames, silence, gainL, gainR, cross_gain_in, cross_gain_out, &cross_ptr);
|
||||
|
||||
|
||||
@@ -90,9 +90,7 @@ static int _write_frames(frames_t out_frames, bool silence, s32_t gainL, s32_t g
|
||||
_apply_cross(outputbuf, out_frames, cross_gain_in, cross_gain_out, cross_ptr);
|
||||
}
|
||||
|
||||
if (gainL != FIXED_ONE || gainR!= FIXED_ONE) {
|
||||
_apply_gain(outputbuf, out_frames, gainL, gainR);
|
||||
}
|
||||
_apply_gain(outputbuf, out_frames, gainL, gainR);
|
||||
|
||||
#if BYTES_PER_FRAME == 4
|
||||
memcpy(btout + oframes * BYTES_PER_FRAME, outputbuf->readp, out_frames * BYTES_PER_FRAME);
|
||||
@@ -115,14 +113,16 @@ static int _write_frames(frames_t out_frames, bool silence, s32_t gainL, s32_t g
|
||||
}
|
||||
|
||||
output_visu_export((s16_t*) (btout + oframes * BYTES_PER_FRAME), out_frames, output.current_sample_rate, silence, (gainL + gainR) / 2);
|
||||
|
||||
oframes += out_frames;
|
||||
|
||||
return (int)out_frames;
|
||||
}
|
||||
|
||||
int32_t output_bt_data(uint8_t *data, int32_t len) {
|
||||
int32_t avail_data = 0, wanted_len = 0, start_timer = 0;
|
||||
int32_t iframes = len / BYTES_PER_FRAME, start_timer = 0;
|
||||
|
||||
if (len < 0 || data == NULL || !running) {
|
||||
if (iframes <= 0 || data == NULL || !running) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -131,32 +131,25 @@ int32_t output_bt_data(uint8_t *data, int32_t len) {
|
||||
|
||||
// This is how the BTC layer calculates the number of bytes to
|
||||
// for us to send. (BTC_SBC_DEC_PCM_DATA_LEN * sizeof(OI_INT16) - availPcmBytes
|
||||
wanted_len=len;
|
||||
SET_MIN_MAX(len,req);
|
||||
TIME_MEASUREMENT_START(start_timer);
|
||||
LOCK;
|
||||
output.device_frames = 0; // todo: check if this is the right way do to this.
|
||||
|
||||
LOCK;
|
||||
SET_MIN_MAX_SIZED(_buf_used(outputbuf),bt,outputbuf->size);
|
||||
output.device_frames = 0;
|
||||
output.updated = gettime_ms();
|
||||
output.frames_played_dmp = output.frames_played;
|
||||
SET_MIN_MAX_SIZED(_buf_used(outputbuf),bt,outputbuf->size);
|
||||
do {
|
||||
avail_data = _output_frames( wanted_len/BYTES_PER_FRAME )*BYTES_PER_FRAME; // Keep the transfer buffer full
|
||||
wanted_len-=avail_data;
|
||||
} while (wanted_len > 0 && avail_data != 0);
|
||||
|
||||
if (wanted_len > 0) {
|
||||
SET_MIN_MAX(wanted_len, under);
|
||||
}
|
||||
output.frames_in_process = len-wanted_len;
|
||||
|
||||
equalizer_process(data, (len - wanted_len) * BYTES_PER_FRAME, output.current_sample_rate);
|
||||
|
||||
_output_frames(iframes);
|
||||
output.frames_in_process = oframes;
|
||||
UNLOCK;
|
||||
|
||||
equalizer_process(data, oframes * BYTES_PER_FRAME, output.current_sample_rate);
|
||||
|
||||
SET_MIN_MAX(TIME_MEASUREMENT_GET(start_timer),lock_out_time);
|
||||
SET_MIN_MAX((len-wanted_len), rec);
|
||||
SET_MIN_MAX((len-oframes*BYTES_PER_FRAME), rec);
|
||||
TIME_MEASUREMENT_START(start_timer);
|
||||
|
||||
return len-wanted_len;
|
||||
return oframes * BYTES_PER_FRAME;
|
||||
}
|
||||
|
||||
void output_bt_tick(void) {
|
||||
|
||||
@@ -78,7 +78,7 @@ void output_init_embedded(log_level level, char *device, unsigned output_buf_siz
|
||||
output.start_frames = FRAME_BLOCK;
|
||||
output.rate_delay = rate_delay;
|
||||
|
||||
if (strcasestr(device, "BT ")) {
|
||||
if (strcasestr(device, "BT ") || !strcasecmp(device, "BT")) {
|
||||
LOG_INFO("init Bluetooth");
|
||||
close_cb = &output_close_bt;
|
||||
output_init_bt(level, device, output_buf_size, params, rates, rate_delay, idle);
|
||||
|
||||
@@ -410,10 +410,7 @@ static int _i2s_write_frames(frames_t out_frames, bool silence, s32_t gainL, s32
|
||||
}
|
||||
|
||||
#if BYTES_PER_FRAME == 4
|
||||
if (gainL != FIXED_ONE || gainR!= FIXED_ONE) {
|
||||
_apply_gain(outputbuf, out_frames, gainL, gainR);
|
||||
}
|
||||
|
||||
_apply_gain(outputbuf, out_frames, gainL, gainR);
|
||||
memcpy(obuf + oframes * BYTES_PER_FRAME, outputbuf->readp, out_frames * BYTES_PER_FRAME);
|
||||
#else
|
||||
optr = (s32_t*) outputbuf->readp;
|
||||
|
||||
@@ -356,17 +356,34 @@ void _apply_cross(struct buffer *outputbuf, frames_t out_frames, s32_t cross_gai
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if !WIN
|
||||
inline
|
||||
#endif
|
||||
void _apply_gain(struct buffer *outputbuf, frames_t count, s32_t gainL, s32_t gainR) {
|
||||
ISAMPLE_T *ptrL = (ISAMPLE_T *)(void *)outputbuf->readp;
|
||||
ISAMPLE_T *ptrR = (ISAMPLE_T *)(void *)outputbuf->readp + 1;
|
||||
while (count--) {
|
||||
*ptrL = gain(gainL, *ptrL);
|
||||
*ptrR = gain(gainR, *ptrR);
|
||||
ptrL += 2;
|
||||
ptrR += 2;
|
||||
}
|
||||
if (gainL == FIXED_ONE && gainR == FIXED_ONE) {
|
||||
return;
|
||||
} else if (gainL == MONO_MUTED) {
|
||||
ISAMPLE_T *ptr = (ISAMPLE_T *)(void *)outputbuf->readp + 1;
|
||||
while (count--) {
|
||||
*(ptr - 1) = *ptr = gain(gainR, *ptr);
|
||||
ptr += 2;
|
||||
}
|
||||
} else if (gainR == MONO_MUTED) {
|
||||
ISAMPLE_T *ptr = (ISAMPLE_T *)(void *)outputbuf->readp;
|
||||
while (count--) {
|
||||
*(ptr + 1) = *ptr = gain(gainL, *ptr);
|
||||
ptr += 2;
|
||||
}
|
||||
} else {
|
||||
ISAMPLE_T *ptrL = (ISAMPLE_T *)(void *)outputbuf->readp;
|
||||
ISAMPLE_T *ptrR = (ISAMPLE_T *)(void *)outputbuf->readp + 1;
|
||||
while (count--) {
|
||||
*ptrL = gain(gainL, *ptrL);
|
||||
*ptrR = gain(gainR, *ptrR);
|
||||
ptrL += 2; ptrR += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ static decode_state pcm_decode(void) {
|
||||
out = process.max_in_frames;
|
||||
);
|
||||
|
||||
if ((stream.state <= DISCONNECT && bytes == 0) || (limit && audio_left == 0)) {
|
||||
if ((stream.state <= DISCONNECT && bytes < bytes_per_frame) || (limit && audio_left == 0)) {
|
||||
UNLOCK_O_direct;
|
||||
UNLOCK_S;
|
||||
return DECODE_COMPLETE;
|
||||
|
||||
@@ -397,8 +397,9 @@ static void process_strm(u8_t *pkt, int len) {
|
||||
output.next_replay_gain = unpackN(&strm->replay_gain);
|
||||
output.fade_mode = strm->transition_type - '0';
|
||||
output.fade_secs = strm->transition_period;
|
||||
output.invert = (strm->flags & 0x03) == 0x03;
|
||||
LOG_DEBUG("set fade mode: %u", output.fade_mode);
|
||||
output.invert = (strm->flags & 0x03) == 0x03;
|
||||
output.channels = (strm->flags & 0x0c) >> 2;
|
||||
LOG_DEBUG("set fade: %u, channels: %u, invert: %u", output.fade_mode, output.channels, output.invert);
|
||||
UNLOCK_O;
|
||||
}
|
||||
break;
|
||||
@@ -822,14 +823,14 @@ in_addr_t discover_server(char *default_server, int max) {
|
||||
memset(&s, 0, sizeof(s));
|
||||
|
||||
if (sendto(disc_sock, buf, len, 0, (struct sockaddr *)&d, sizeof(d)) < 0) {
|
||||
LOG_INFO("error sending disovery");
|
||||
LOG_INFO("error sending discovery");
|
||||
}
|
||||
|
||||
if (poll(&pollinfo, 1, 5000) == 1) {
|
||||
char readbuf[32], *p;
|
||||
char readbuf[64], *p;
|
||||
socklen_t slen = sizeof(s);
|
||||
memset(readbuf, 0, 32);
|
||||
recvfrom(disc_sock, readbuf, 32 - 1, 0, (struct sockaddr *)&s, &slen);
|
||||
memset(readbuf, 0, sizeof(readbuf));
|
||||
recvfrom(disc_sock, readbuf, sizeof(readbuf) - 1, 0, (struct sockaddr *)&s, &slen);
|
||||
LOG_INFO("got response from: %s:%d", inet_ntoa(s.sin_addr), ntohs(s.sin_port));
|
||||
|
||||
if ((p = strstr(readbuf, port_d)) != NULL) {
|
||||
@@ -962,7 +963,7 @@ void slimproto(log_level level, char *server, u8_t mac[6], const char *name, con
|
||||
if (++failed_connect > 5 && !server) {
|
||||
slimproto_ip = serv_addr.sin_addr.s_addr = discover_server(NULL, MAX_SERVER_RETRIES);
|
||||
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
|
||||
// rediscover server if it was not set at startup or exit
|
||||
if (!server && ++failed_connect > 5) {
|
||||
|
||||
@@ -471,7 +471,8 @@ void _wake_create(event_event*);
|
||||
|
||||
#define MAX_SILENCE_FRAMES 2048
|
||||
|
||||
#define FIXED_ONE 0x10000
|
||||
#define FIXED_ONE 0x10000
|
||||
#define MONO_MUTED (FIXED_ONE + 1)
|
||||
|
||||
#ifndef BYTES_PER_FRAME
|
||||
#define BYTES_PER_FRAME 8
|
||||
@@ -660,6 +661,7 @@ typedef enum { FADE_NONE = 0, FADE_CROSSFADE, FADE_IN, FADE_OUT, FADE_INOUT } fa
|
||||
struct outputstate {
|
||||
output_state state;
|
||||
output_format format;
|
||||
u8_t channels;
|
||||
const char *device;
|
||||
int external;
|
||||
u32_t init_size;
|
||||
|
||||
@@ -46,27 +46,17 @@ struct buffer *streambuf = &buf;
|
||||
#define UNLOCK mutex_unlock(streambuf->mutex)
|
||||
|
||||
/*
|
||||
After a lot of hesitation, I've added that "poll mutex" to prevent
|
||||
socket from being allocated while we are still in poll(). The issue
|
||||
happens is we have a close quickly followed by an open, we might still
|
||||
be in the poll() and simple OS fail as they re-allocate the same socket
|
||||
on which a thread is still waiting.
|
||||
Ideally, you want to set the lock in the disconnect() but that would mean
|
||||
very often we'd have to always wait for the end of the poll(), i.e. up to
|
||||
100ms for nothing most of the time where if it is in the open(), it is
|
||||
less elegant as closing a socket on which there is a poll() is not good
|
||||
but it's more efficient as it is very rare that you'd have an open() less
|
||||
then 100ms after a close()
|
||||
When LMS sends a close/open sequence very quickly, the stream thread might
|
||||
still be waiting in the poll() on the closed socket. It is never recommended
|
||||
to have a thread closing a socket used by another thread but it works, as
|
||||
opposed to an infinite select().
|
||||
In stream_sock() a new socket is created and full OS will allocate a different
|
||||
one but on RTOS and simple IP stack, the same might be re-used and that causes
|
||||
an exception as a thread is already waiting on a newly allocated socket
|
||||
A simple variable that forces stream_sock() to wait until we are out of poll()
|
||||
is enough and much faster than a mutex
|
||||
*/
|
||||
#if EMBEDDED
|
||||
static mutex_type poll_mutex;
|
||||
#define LOCK_L mutex_lock(poll_mutex)
|
||||
#define UNLOCK_L mutex_unlock(poll_mutex)
|
||||
#else
|
||||
#define LOCK_L
|
||||
#define UNLOCK_L
|
||||
#endif
|
||||
|
||||
static bool polling;
|
||||
static sockfd fd;
|
||||
|
||||
struct streamstate stream;
|
||||
@@ -209,7 +199,6 @@ static void *stream_thread() {
|
||||
|
||||
} else {
|
||||
|
||||
LOCK_L;
|
||||
pollinfo.fd = fd;
|
||||
pollinfo.events = POLLIN;
|
||||
if (stream.state == SEND_HEADERS) {
|
||||
@@ -218,10 +207,12 @@ static void *stream_thread() {
|
||||
}
|
||||
|
||||
UNLOCK;
|
||||
// no mutex needed - we just want to know if we are inside poll()
|
||||
polling = true;
|
||||
|
||||
if (_poll(ssl, &pollinfo, 100)) {
|
||||
|
||||
UNLOCK_L;
|
||||
polling = false;
|
||||
LOCK;
|
||||
|
||||
// check socket has not been closed while in poll
|
||||
@@ -343,7 +334,7 @@ static void *stream_thread() {
|
||||
|
||||
n = _recv(ssl, fd, streambuf->writep, space, 0);
|
||||
if (n == 0) {
|
||||
LOG_INFO("end of stream");
|
||||
LOG_INFO("end of stream (%u bytes)", stream.bytes);
|
||||
_disconnect(DISCONNECT, DISCONNECT_OK);
|
||||
}
|
||||
if (n < 0 && _last_error() != ERROR_WOULDBLOCK) {
|
||||
@@ -374,7 +365,7 @@ static void *stream_thread() {
|
||||
UNLOCK;
|
||||
|
||||
} else {
|
||||
UNLOCK_L;
|
||||
polling = false;
|
||||
LOG_SDEBUG("poll timeout");
|
||||
}
|
||||
}
|
||||
@@ -427,9 +418,6 @@ void stream_init(log_level level, unsigned stream_buf_size) {
|
||||
*stream.header = '\0';
|
||||
|
||||
fd = -1;
|
||||
#if EMBEDDED
|
||||
mutex_create_p(poll_mutex);
|
||||
#endif
|
||||
|
||||
#if LINUX || FREEBSD
|
||||
touch_memory(streambuf->buf, streambuf->size);
|
||||
@@ -459,9 +447,6 @@ void stream_close(void) {
|
||||
#endif
|
||||
free(stream.header);
|
||||
buf_destroy(streambuf);
|
||||
#if EMBEDDED
|
||||
mutex_destroy(poll_mutex);
|
||||
#endif
|
||||
}
|
||||
|
||||
void stream_file(const char *header, size_t header_len, unsigned threshold) {
|
||||
@@ -503,9 +488,12 @@ void stream_file(const char *header, size_t header_len, unsigned threshold) {
|
||||
void stream_sock(u32_t ip, u16_t port, const char *header, size_t header_len, unsigned threshold, bool cont_wait) {
|
||||
struct sockaddr_in addr;
|
||||
|
||||
LOCK_L;
|
||||
#if EMBEDDED
|
||||
// wait till we are not polling anymore
|
||||
while (polling && running) { usleep(10000); }
|
||||
#endif
|
||||
|
||||
int sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
UNLOCK_L;
|
||||
|
||||
if (sock < 0) {
|
||||
LOG_ERROR("failed to create socket");
|
||||
@@ -533,19 +521,16 @@ void stream_sock(u32_t ip, u16_t port, const char *header, size_t header_len, un
|
||||
|
||||
#if USE_SSL
|
||||
if (ntohs(port) == 443) {
|
||||
char *server = strcasestr(header, "Host:");
|
||||
char server[256], *p;
|
||||
|
||||
ssl = SSL_new(SSLctx);
|
||||
SSL_set_fd(ssl, sock);
|
||||
|
||||
// add SNI
|
||||
sscanf(header, "Host:%255s", server);
|
||||
if (server) {
|
||||
char *p, *servername = malloc(1024);
|
||||
|
||||
sscanf(server, "Host:%255[^:]s", servername);
|
||||
for (p = servername; *p == ' '; p++);
|
||||
SSL_set_tlsext_host_name(ssl, p);
|
||||
free(servername);
|
||||
if ((p = strchr(server, ':')) != NULL) *p = '\0';
|
||||
SSL_set_tlsext_host_name(ssl, server);
|
||||
}
|
||||
|
||||
while (1) {
|
||||
|
||||
@@ -253,6 +253,10 @@ void process_received_data(const char * buffer, size_t size){
|
||||
if(bMirrorToUART){
|
||||
write(uart_fd, command, size);
|
||||
}
|
||||
for(int i=strlen(command);i>=0;i--){
|
||||
// strip any cr/lf
|
||||
if(command[i]== '\n' || command[i]== '\r') command[i]= '\0';
|
||||
}
|
||||
run_command((char *)command);
|
||||
}
|
||||
free(command);
|
||||
|
||||
@@ -22,11 +22,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "esp_pthread.h"
|
||||
#include "esp_log.h"
|
||||
#ifndef SQUEEZELITE_ESP32_RELEASE_URL
|
||||
#define SQUEEZELITE_ESP32_RELEASE_URL "https://github.com/sle118/squeezelite-esp32/releases"
|
||||
#endif
|
||||
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 void console_start();
|
||||
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
|
||||
#define CASE_TO_STR(x) case x: return STR(x); break;
|
||||
#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)
|
||||
|
||||
|
||||
1
components/wifi-manager/.gitignore
vendored
1
components/wifi-manager/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/.code.js.swp
|
||||
@@ -1,8 +1,10 @@
|
||||
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/
|
||||
|
||||
set( WEBPACK_DIR webapp/webpack/dist )
|
||||
idf_component_register( SRC_DIRS . webapp
|
||||
INCLUDE_DIRS . webapp ${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
|
||||
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
|
||||
|
||||
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 driver_bt
|
||||
)
|
||||
|
||||
|
||||
include(webapp/webapp.cmake)
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
gzip index.html style.css jquery.js --best --keep --force
|
||||
pause
|
||||
@@ -1,2 +0,0 @@
|
||||
<html>
|
||||
</html>
|
||||
@@ -53,6 +53,8 @@ function to process requests, decode URLs, serve files, etc. etc.
|
||||
#include "esp_console.h"
|
||||
#include "argtable3/argtable3.h"
|
||||
#include "platform_console.h"
|
||||
#include "accessors.h"
|
||||
#include "webapp/webpack.h"
|
||||
|
||||
#define HTTP_STACK_SIZE (5*1024)
|
||||
const char str_na[]="N/A";
|
||||
@@ -88,22 +90,7 @@ static const char redirect_payload3[]="'>here</a> to login.</p></body></html>";
|
||||
* @see file "component.mk"
|
||||
* @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_end[] asm("_binary_style_css_end");
|
||||
extern const uint8_t jquery_gz_start[] asm("_binary_jquery_min_js_gz_start");
|
||||
extern const uint8_t jquery_gz_end[] asm("_binary_jquery_min_js_gz_end");
|
||||
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 bootstrap_js_gz_start[] asm("_binary_bootstrap_min_js_gz_start");
|
||||
extern const uint8_t bootstrap_js_gz_end[] asm("_binary_bootstrap_min_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_end[] asm("_binary_bootstrap_min_css_gz_end");
|
||||
extern const uint8_t code_js_start[] asm("_binary_code_js_start");
|
||||
extern const uint8_t code_js_end[] asm("_binary_code_js_end");
|
||||
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 favicon_ico_start[] asm("_binary_favicon_ico_start");
|
||||
extern const uint8_t favicon_ico_end[] asm("_binary_favicon_ico_end");
|
||||
|
||||
esp_err_t redirect_processor(httpd_req_t *req, httpd_err_code_t error);
|
||||
|
||||
|
||||
@@ -231,31 +218,31 @@ bool is_captive_portal_host_name(httpd_req_t *req){
|
||||
/* Custom function to free context */
|
||||
void free_ctx_func(void *ctx)
|
||||
{
|
||||
START_FREE_MEM_CHECK(ff);
|
||||
session_context_t * context = (session_context_t *)ctx;
|
||||
if(context){
|
||||
ESP_LOGD(TAG, "Freeing up socket context");
|
||||
FREE_AND_NULL(context->auth_token);
|
||||
FREE_AND_NULL(context->sess_ip_address);
|
||||
free(context);
|
||||
CHECK_RESET_FREE_MEM_CHECK(ff,"free_ctx");
|
||||
}
|
||||
}
|
||||
|
||||
session_context_t* get_session_context(httpd_req_t *req){
|
||||
START_FREE_MEM_CHECK(ff);
|
||||
bool newConnection=false;
|
||||
if (! req->sess_ctx) {
|
||||
ESP_LOGD(TAG,"New connection context. Allocating session buffer");
|
||||
req->sess_ctx = malloc(sizeof(session_context_t));
|
||||
memset(req->sess_ctx,0x00,sizeof(session_context_t));
|
||||
req->free_ctx = free_ctx_func;
|
||||
newConnection = true;
|
||||
// get the remote IP address only once per session
|
||||
}
|
||||
session_context_t *ctx_data = (session_context_t*)req->sess_ctx;
|
||||
FREE_AND_NULL(ctx_data->sess_ip_address);
|
||||
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);
|
||||
CHECK_RESET_FREE_MEM_CHECK(ff,"get sess context");
|
||||
if(newConnection){
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -333,8 +320,8 @@ static esp_err_t set_content_type_from_file(httpd_req_t *req, const char *filena
|
||||
return httpd_resp_set_type(req, HTTPD_TYPE_TEXT);
|
||||
} else if (IS_FILE_EXT(filename, ".jpeg")) {
|
||||
return httpd_resp_set_type(req, "image/jpeg");
|
||||
} else if (IS_FILE_EXT(filename, ".ico")) {
|
||||
return httpd_resp_set_type(req, "image/x-icon");
|
||||
} else if (IS_FILE_EXT(filename, ".png")) {
|
||||
return httpd_resp_set_type(req, "image/png");
|
||||
} else if (IS_FILE_EXT(filename, ".ico")) {
|
||||
return httpd_resp_set_type(req, "image/x-icon");
|
||||
} else if (IS_FILE_EXT(filename, ".css")) {
|
||||
@@ -369,8 +356,16 @@ static esp_err_t set_content_type_from_req(httpd_req_t *req)
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
||||
int resource_get_index(const char * fileName){
|
||||
for(int i=0;resource_lookups[i][0]!='\0';i++){
|
||||
if(strstr(resource_lookups[i], fileName)){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
esp_err_t root_get_handler(httpd_req_t *req){
|
||||
esp_err_t err = ESP_OK;
|
||||
ESP_LOGD_LOC(TAG, "serving [%s]", req->uri);
|
||||
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
|
||||
httpd_resp_set_hdr(req, "Accept-Encoding", "identity");
|
||||
@@ -378,15 +373,24 @@ esp_err_t root_get_handler(httpd_req_t *req){
|
||||
if(!is_user_authenticated(req)){
|
||||
// todo: send password entry page and return
|
||||
}
|
||||
const size_t file_size = (index_html_end - index_html_start);
|
||||
esp_err_t err = set_content_type_from_req(req);
|
||||
if(err == ESP_OK){
|
||||
httpd_resp_send(req, (const char *)index_html_start, file_size);
|
||||
int idx=-1;
|
||||
if((idx=resource_get_index("index.html"))>=0){
|
||||
const size_t file_size = (resource_map_end[idx] - resource_map_start[idx]);
|
||||
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||
err = set_content_type_from_req(req);
|
||||
if(err == ESP_OK){
|
||||
httpd_resp_send(req, (const char *)resource_map_start[idx], file_size);
|
||||
}
|
||||
}
|
||||
else{
|
||||
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "index.html not found");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
ESP_LOGD_LOC(TAG, "done serving [%s]", req->uri);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
esp_err_t resource_filehandler(httpd_req_t *req){
|
||||
char filepath[FILE_PATH_MAX];
|
||||
ESP_LOGD_LOC(TAG, "serving [%s]", req->uri);
|
||||
@@ -406,39 +410,17 @@ esp_err_t resource_filehandler(httpd_req_t *req){
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
if(strstr(filename, "code.js")) {
|
||||
const size_t file_size = (code_js_end - code_js_start);
|
||||
|
||||
int idx=-1;
|
||||
if((idx=resource_get_index(filename))>=0){
|
||||
set_content_type_from_file(req, filename);
|
||||
httpd_resp_send(req, (const char *)code_js_start, file_size);
|
||||
} else if(strstr(filename, "style.css")) {
|
||||
set_content_type_from_file(req, filename);
|
||||
const size_t file_size = (style_css_end - style_css_start);
|
||||
httpd_resp_send(req, (const char *)style_css_start, file_size);
|
||||
} else if(strstr(filename, "favicon.ico")) {
|
||||
set_content_type_from_file(req, filename);
|
||||
const size_t file_size = (favicon_ico_end - favicon_ico_start);
|
||||
httpd_resp_send(req, (const char *)favicon_ico_start, file_size);
|
||||
} else if(strstr(filename, "jquery.js")) {
|
||||
set_content_type_from_file(req, filename);
|
||||
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||
const size_t file_size = (jquery_gz_end - jquery_gz_start);
|
||||
httpd_resp_send(req, (const char *)jquery_gz_start, file_size);
|
||||
} else if(strstr(filename, "popper.js")) {
|
||||
set_content_type_from_file(req, filename);
|
||||
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||
const size_t file_size = (popper_gz_end - popper_gz_start);
|
||||
httpd_resp_send(req, (const char *)popper_gz_start, file_size);
|
||||
} else if(strstr(filename, "bootstrap.js")) {
|
||||
set_content_type_from_file(req, filename);
|
||||
if(strstr(resource_lookups[idx], ".gz")) {
|
||||
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||
const size_t file_size = (bootstrap_js_gz_end - bootstrap_js_gz_start);
|
||||
httpd_resp_send(req, (const char *)bootstrap_js_gz_start, file_size);
|
||||
} else if(strstr(filename, "bootstrap.css")) {
|
||||
set_content_type_from_file(req, filename);
|
||||
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||
const size_t file_size = (bootstrap_css_gz_end - bootstrap_css_gz_start);
|
||||
httpd_resp_send(req, (const char *)bootstrap_css_gz_start, file_size);
|
||||
} else {
|
||||
}
|
||||
const size_t file_size = (resource_map_end[idx] - resource_map_start[idx]);
|
||||
httpd_resp_send(req, (const char *)resource_map_start[idx], file_size);
|
||||
}
|
||||
else {
|
||||
ESP_LOGE_LOC(TAG, "Unknown resource [%s] from path [%s] ", filename,filepath);
|
||||
/* Respond with 404 Not Found */
|
||||
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, "File does not exist");
|
||||
@@ -486,7 +468,8 @@ esp_err_t console_cmd_get_handler(httpd_req_t *req){
|
||||
return err;
|
||||
}
|
||||
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);
|
||||
//bool bOTA=false;
|
||||
//char * otaURL=NULL;
|
||||
@@ -521,14 +504,18 @@ esp_err_t console_cmd_post_handler(httpd_req_t *req){
|
||||
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.");
|
||||
err = ESP_FAIL;
|
||||
|
||||
}
|
||||
else{
|
||||
// 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);
|
||||
return err;
|
||||
}
|
||||
@@ -540,7 +527,7 @@ esp_err_t ap_get_handler(httpd_req_t *req){
|
||||
}
|
||||
/* if we can get the mutex, write the last version of the AP list */
|
||||
esp_err_t err = set_content_type_from_req(req);
|
||||
if( err == ESP_OK && wifi_manager_lock_json_buffer(( TickType_t ) 10)){
|
||||
if( err == ESP_OK && wifi_manager_lock_json_buffer(( TickType_t ) 200/portTICK_PERIOD_MS)){
|
||||
char *buff = wifi_manager_alloc_get_ap_list_json();
|
||||
wifi_manager_unlock_json_buffer();
|
||||
if(buff!=NULL){
|
||||
@@ -576,7 +563,15 @@ esp_err_t config_get_handler(httpd_req_t *req){
|
||||
}
|
||||
else {
|
||||
ESP_LOGD_LOC(TAG, "config json : %s",json );
|
||||
httpd_resp_send(req, (const char *)json, HTTPD_RESP_USE_STRLEN);
|
||||
cJSON * gplist=get_gpio_list(false);
|
||||
char * gpliststr=cJSON_PrintUnformatted(gplist);
|
||||
httpd_resp_sendstr_chunk(req,"{ \"gpio\":");
|
||||
httpd_resp_sendstr_chunk(req,gpliststr);
|
||||
httpd_resp_sendstr_chunk(req,", \"config\":");
|
||||
httpd_resp_sendstr_chunk(req, (const char *)json);
|
||||
httpd_resp_sendstr_chunk(req,"}");
|
||||
httpd_resp_sendstr_chunk(req,NULL);
|
||||
free(gpliststr);
|
||||
free(json);
|
||||
}
|
||||
}
|
||||
@@ -721,6 +716,7 @@ esp_err_t config_post_handler(httpd_req_t *req){
|
||||
|
||||
if(err==ESP_OK){
|
||||
httpd_resp_sendstr(req, "{ \"result\" : \"OK\" }");
|
||||
messaging_post_message(MESSAGING_INFO,MESSAGING_CLASS_SYSTEM,"Save Success");
|
||||
}
|
||||
cJSON_Delete(root);
|
||||
if(bOTA) {
|
||||
@@ -1031,7 +1027,11 @@ esp_err_t redirect_processor(httpd_req_t *req, httpd_err_code_t error){
|
||||
bool connected_to_sta_ip_interface = 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)){
|
||||
sta_ip_address = strdup(wifi_manager_get_sta_ip_string());
|
||||
wifi_manager_unlock_sta_ip_string();
|
||||
@@ -1041,9 +1041,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);
|
||||
}
|
||||
|
||||
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");
|
||||
char *req_host = alloc_get_http_header(req, "Host");
|
||||
@@ -1118,34 +1115,24 @@ esp_err_t redirect_ev_handler(httpd_req_t *req){
|
||||
|
||||
esp_err_t messages_get_handler(httpd_req_t *req){
|
||||
ESP_LOGD_LOC(TAG, "serving [%s]", req->uri);
|
||||
START_FREE_MEM_CHECK(before);
|
||||
START_FREE_MEM_CHECK(all);
|
||||
if(!is_user_authenticated(req)){
|
||||
// todo: redirect to login page
|
||||
// return ESP_OK;
|
||||
}
|
||||
CHECK_RESET_FREE_MEM_CHECK(before, "after user auth");
|
||||
esp_err_t err = set_content_type_from_req(req);
|
||||
if(err != ESP_OK){
|
||||
return err;
|
||||
}
|
||||
CHECK_RESET_FREE_MEM_CHECK(before, "after set_content_type");
|
||||
cJSON * json_messages= messaging_retrieve_messages(messaging);
|
||||
CHECK_RESET_FREE_MEM_CHECK(before, "after receiving messages");
|
||||
if(json_messages!=NULL){
|
||||
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));
|
||||
CHECK_RESET_FREE_MEM_CHECK(before, "after http send");
|
||||
free(json_text);
|
||||
CHECK_RESET_FREE_MEM_CHECK(before, "after free json message");
|
||||
cJSON_Delete(json_messages);
|
||||
CHECK_RESET_FREE_MEM_CHECK(before, "after free json");
|
||||
}
|
||||
else {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1160,7 +1147,7 @@ esp_err_t status_get_handler(httpd_req_t *req){
|
||||
return err;
|
||||
}
|
||||
|
||||
if(wifi_manager_lock_json_buffer(( TickType_t ) 10)) {
|
||||
if(wifi_manager_lock_json_buffer(( TickType_t ) 200/portTICK_PERIOD_MS)) {
|
||||
char *buff = wifi_manager_alloc_get_ip_info_json();
|
||||
wifi_manager_unlock_json_buffer();
|
||||
if(buff) {
|
||||
@@ -1174,6 +1161,8 @@ esp_err_t status_get_handler(httpd_req_t *req){
|
||||
else {
|
||||
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR , "Error retrieving status object");
|
||||
}
|
||||
// update status for next status call
|
||||
wifi_manager_update_status();
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -1,372 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<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/style.css">
|
||||
<script src="/res/jquery.js"></script>
|
||||
<script src="/res/popper.js"></script>
|
||||
<script src="/res/bootstrap.js"></script>
|
||||
<script src="/res/code.js"></script>
|
||||
|
||||
<title>esp32-wifi-manager</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="info">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="jack" width="24" height="24" viewBox="0 0 24 24">
|
||||
<g id="o_jack" display="none">
|
||||
<path d="m 16.074253,15.636738 v -1.05413 h 5.893274 c 1.16249,0 2.108261,-0.855111 2.108261,-1.906183 0,-1.051073 -0.945771,-1.906236 -2.108261,-1.906236 H 16.074253 V 9.7160604 c 0,-0.5812492 -0.472879,-1.0541321 -1.054131,-1.0541321 H 6.7847349 c -1.256731,0 -2.301908,0.9212057 -2.496867,2.1237027 h -0.451896 c -0.540407,0 -1.001317,0.349129 -1.173459,0.835611 H 0.47312787 c -0.23285,0 -0.42164599,0.188794 -0.42164599,0.421651 v 1.251779 c 0,0.232857 0.18879599,0.421652 0.42164599,0.421652 H 2.6550809 c 0.165919,0.497866 0.632365,0.857588 1.180831,0.857588 h 0.45312 c 0.19781,1.199177 1.241345,2.116956 2.495659,2.116956 h 8.2353861 c 0.581297,0 1.054176,-0.472883 1.054176,-1.05413 z m 5.060935,-4.023245 v 2.125811 h -0.844935 v -2.125811 z m 2.097293,1.062932 c 0,0.582933 -0.561524,1.057661 -1.253986,1.062668 v -2.125337 c 0.692462,0.0049 1.253986,0.47963 1.253986,1.062669 z m -3.785535,-1.062932 v 2.125811 h -3.372693 v -2.125811 z m -18.55215712,0.851 H 2.5901939 v 0.408475 H 0.89478888 Z m 2.94118302,1.266114 c -0.221897,0 -0.40247,-0.185737 -0.40247,-0.414062 v -1.273547 c 0,-0.228271 0.180573,-0.41401 0.40247,-0.41401 h 0.418855 v 2.101671 h -0.418855 z m 2.948763,2.116956 c -0.929997,0 -1.6866,-0.756601 -1.6866,-1.686608 v -0.0087 -2.944976 -0.01545 c 0,-0.930006 0.756603,-1.6866072 1.6866,-1.6866072 h 8.2353871 c 0.114313,0 0.210838,0.096554 0.210838,0.2108266 v 5.9206786 c 0,0.114268 -0.09656,0.210824 -0.210838,0.210824 z" />
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="output" width="24" height="24" viewBox="0 0 24 24">
|
||||
<g id="o_i2s" display="none">
|
||||
<path d="M2 7L2 8L2 9L2 10L2 11L2 12L2 13L2 14L2 15L2 16L2 17L3 17L3 16L3 15L3 14L3 13L3 12L3 11L3 10L3 9L3 8L2 7M6 7L6 8L6 9L7 9L7 8L8 8L9 8L10 8L10 9L11 9L11 10L11 11L10 11L10 12L9 12L9 13L8 13L8 14L7 14L7 15L6 15L6 16L6 17L7 17L8 17L9 17L10 17L11 17L12 17L12 16L11 16L10 16L9 16L8 16L8 15L9 15L9 14L10 14L10 13L11 13L11 12L12 12L12 11L12 10L12 9L12 8L11 8L11 7L10 7L9 7L8 7L6 7M16 7L16 8L15 8L15 9L15 10L15 11L16 11L16 12L17 12L18 12L18 13L19 13L20 13L21 13L21 14L21 15L20 15L20 16L19 16L18 16L17 16L16 16L16 15L15 15L15 16L15 17L16 17L17 17L18 17L19 17L20 17L21 17L21 16L22 16L22 15L22 14L22 13L21 13L21 12L20 12L20 11L19 11L18 11L17 11L16 11L16 10L16 9L17 9L17 8L18 8L19 8L20 8L21 8L21 9L22 9L22 8L22 7L21 7L20 7L19 7L18 7L16 7z"/>
|
||||
</g>
|
||||
<g id="o_bt" display="none">
|
||||
<path d="M3 7L3 8L3 9L3 10L3 11L3 12L3 13L3 14L3 15L3 16L3 17L4 17L5 17L6 17L7 17L8 17L9 17L9 16L10 16L10 15L10 14L10 13L10 12L9 12L9 11L10 11L10 10L10 9L10 8L9 8L9 7L8 7L7 7L6 7L5 7L3 7M12 7L12 8L13 8L14 8L15 8L16 8L16 9L16 10L16 11L16 12L16 13L16 14L16 15L16 16L16 17L17 17L17 16L17 15L17 14L17 13L17 12L17 11L17 10L17 9L17 8L18 8L19 8L20 8L21 8L21 7L20 7L19 7L18 7L17 7L16 7L15 7L14 7L12 7z"/>
|
||||
<path style="fill:#272B30;" d="M4 8L4 9L4 10L4 11L5 11L6 11L7 11L8 11L8 10L9 10L9 9L9 8L8 8L7 8L6 8L4 8M4 12L4 13L4 14L4 15L4 16L5 16L6 16L7 16L8 16L8 15L9 15L9 14L9 13L8 13L8 12L7 12L6 12L4 12z"/>
|
||||
</g>
|
||||
<g id="o_spdif" display="none">
|
||||
<path d="M3 1L3 2L2 2L2 3L2 4L2 5L3 5L3 6L4 6L5 6L5 7L6 7L7 7L8 7L8 8L8 9L7 9L7 10L6 10L5 10L4 10L3 10L3 9L2 9L2 10L2 11L3 11L4 11L5 11L6 11L7 11L8 11L8 10L9 10L9 9L9 8L9 7L8 7L8 6L7 6L7 5L6 5L5 5L4 5L3 5L3 4L3 3L4 3L4 2L5 2L6 2L7 2L8 2L8 3L9 3L9 2L9 1L8 1L7 1L6 1L5 1L3 1M13 1L13 2L13 3L13 4L12 4L12 5L12 6L12 7L12 8L11 8L11 9L11 10L11 11L10 11L10 12L10 13L11 13L11 12L11 11L12 11L12 10L12 9L12 8L13 8L13 7L13 6L13 5L14 5L14 4L14 3L14 2L15 2L15 1L13 1M16 1L16 2L16 3L16 4L16 5L16 6L16 7L16 8L16 9L16 10L16 11L17 11L17 10L17 9L17 8L17 7L18 7L19 7L20 7L21 7L21 6L22 6L22 5L22 4L22 3L22 2L21 2L21 1L20 1L19 1L18 1L16 1z"/>
|
||||
<path style="fill:#272B30;" d="M17 2L17 3L17 4L17 5L17 6L18 6L19 6L20 6L20 5L21 5L21 4L21 3L20 3L20 2L19 2L17 2z"/>
|
||||
<path d="M2 13L2 14L2 15L2 16L2 17L2 18L2 19L2 20L2 21L2 22L2 23L3 23L4 23L5 23L6 23L7 23L8 23L8 22L9 22L9 21L10 21L10 20L10 19L10 18L10 17L10 16L10 15L9 15L9 14L8 14L7 14L7 13L6 13L5 13L4 13L2 13M13 13L13 14L13 15L13 16L13 17L13 18L13 19L13 20L13 21L13 22L13 23L14 23L14 22L14 21L14 20L14 19L14 18L14 17L14 16L14 15L14 14L13 13M17 13L17 14L17 15L17 16L17 17L17 18L17 19L17 20L17 21L17 22L17 23L18 23L18 22L18 21L18 20L18 19L18 18L19 18L20 18L21 18L22 18L22 17L21 17L20 17L19 17L18 17L18 16L18 15L18 14L19 14L20 14L21 14L22 14L22 13L21 13L20 13L19 13L17 13z"/>
|
||||
<path style="fill:#272B30;" d="M3 14L3 15L3 16L3 17L3 18L3 19L3 20L3 21L3 22L4 22L5 22L6 22L7 22L7 21L8 21L8 20L9 20L9 19L9 18L9 17L9 16L8 16L8 15L7 15L7 14L6 14L5 14L3 14z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="battery" width="24" height="24" viewBox="0 0 24 24">
|
||||
<g id="bat0" display="none">
|
||||
<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-.75v6z"/>
|
||||
</g>
|
||||
<g id="bat1" display="none">
|
||||
<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-6z"/>
|
||||
</g>
|
||||
<g id="bat2" display="none">
|
||||
<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-6z"/>
|
||||
</g>
|
||||
<g id="bat3" display="none">
|
||||
<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-6z"/>
|
||||
</g>
|
||||
<g id="bat4" display="none">
|
||||
<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>
|
||||
</svg>
|
||||
</div>
|
||||
<ul id="navbar" class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#tab-wifi">WiFi</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#tab-audio">Audio + LMS</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#tab-firmware">Firmware</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#tab-syslog">Syslog</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#tab-commands">System</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#tab-nvs">NVS editor</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#tab-credits">Credits</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div id="message"></div>
|
||||
|
||||
<div id="content">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active show" id="tab-wifi">
|
||||
<div id="wifi">
|
||||
<div id="wifi-status">
|
||||
<h2>Connected to:</h2>
|
||||
<section id="connected-to">
|
||||
<div class="ape"><div class="w0"><div class="pw"><span></span></div></div></div>
|
||||
</section>
|
||||
</div>
|
||||
<h2>Manual connect</h2>
|
||||
<section id="manual_add">
|
||||
<div class="ape">ADD (HIDDEN) SSID</div>
|
||||
</section>
|
||||
<h2>or choose a network...
|
||||
<button type="button" id="updateAP" class="btn btn-info btn-sm">Update</button>
|
||||
</h2>
|
||||
<section id="wifi-list">
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div id="connect_manual">
|
||||
<header>
|
||||
<h1>Enter Details</h1>
|
||||
</header>
|
||||
<h2>DHCP host name</h2>
|
||||
<section id="wifi-list">
|
||||
<input id="dhcp-name2" type="text" placeholder="" value="squeezeamp">
|
||||
</section>
|
||||
<h2>Manual Connection</h2>
|
||||
<section>
|
||||
<input id="manual_ssid" type="text" placeholder="SSID" value="">
|
||||
<input id="manual_pwd" type="password" placeholder="Password" value="">
|
||||
</section>
|
||||
<div class="buttons">
|
||||
<input id="manual_join" type="button" class="btn btn-success" value="Join" data-connect="manual" />
|
||||
<input id="manual_cancel" type="button" class="btn btn-danger" value="Cancel"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="connect">
|
||||
<header>
|
||||
<h1>Connect to network</h1>
|
||||
</header>
|
||||
<h2>DHCP host name</h2>
|
||||
<section id="wifi-list">
|
||||
<input id="dhcp-name1" type="text" placeholder="" value="squeezeamp">
|
||||
</section>
|
||||
<h2>Password for <span id="ssid-pwd"></span></h2>
|
||||
<section>
|
||||
<input id="pwd" type="password" placeholder="Password" value="">
|
||||
</section>
|
||||
<div class="buttons">
|
||||
<input id="join" type="button" class="btn btn-success" value="Join" />
|
||||
<input id="cancel" type="button" class="btn btn-danger" value="Cancel"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="connect-wait">
|
||||
<header>
|
||||
<h1>Please wait...</h1>
|
||||
</header>
|
||||
<h2>Connecting to <span id="ssid-wait"></span></h2>
|
||||
<section>
|
||||
<div id="loading">
|
||||
<div class="spinner"><div class="double-bounce1"></div><div class="double-bounce2"></div></div>
|
||||
<p class="tctr">You may lose wifi access while the esp32 recalibrates its radio. Please wait until your device automatically reconnects. This can take up to 30s.</p>
|
||||
</div>
|
||||
<div id="connect-success">
|
||||
<h3 class="gr">Success!</h3>
|
||||
</div>
|
||||
<div id="connect-fail">
|
||||
<h3 class="rd">Connection failed</h3>
|
||||
<p class="tctr">Please double-check wifi password if any and make sure the access point has good signal.</p>
|
||||
</div>
|
||||
</section>
|
||||
<div class="buttons">
|
||||
<input id="ok-connect" type="button" value="OK" class="btn btn-success" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="connect-details">
|
||||
<div id="connect-details-wrap">
|
||||
<header>
|
||||
<h1></h1>
|
||||
</header>
|
||||
<h2></h2>
|
||||
<section>
|
||||
<div class="buttons">
|
||||
<input id="disconnect" type="button" value="Disconnect" class="btn btn-danger"/>
|
||||
</div>
|
||||
</section>
|
||||
<h2>IP Address</h2>
|
||||
<section>
|
||||
<div class="ape brdb">IP Address:<div id="ip" class="fr"></div></div>
|
||||
<div class="ape brdb">Subnet Mask:<div id="netmask" class="fr"></div></div>
|
||||
<div class="ape">Default Gateway:<div id="gw" class="fr"></div></div>
|
||||
</section>
|
||||
<div class="buttons">
|
||||
<input id="ok-details" type="button" value="Back" class="btn btn-success" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="diag-disconnect" class="diag-box">
|
||||
<div class="diag-box-win">
|
||||
<p>Are you sure you would like to disconnect from this wifi?</p>
|
||||
<div class="buttons">
|
||||
<input id="no-disconnect" type="button" value="No" class="btn btn-success" />
|
||||
<input id="yes-disconnect" type="button" value="Yes" class="btn btn-danger" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- wifi -->
|
||||
|
||||
<div class="tab-pane fade" id="tab-audio">
|
||||
<div id="audioout">
|
||||
<h1>Audio output</h1>
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="i2s" name="audio" class="custom-control-input" checked='checked' />
|
||||
<label for="i2s" class="custom-control-label">I2S</label>
|
||||
</div>
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="spdif" name="audio" class="custom-control-input" />
|
||||
<label for="spdif" class="custom-control-label">SPDIF</label>
|
||||
</div>
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="bt" name="audio" class="custom-control-input" />
|
||||
<label for="bt" class="custom-control-label">Bluetooth</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="btsinkdiv">
|
||||
<input id="btsink" type="text" value="BT sink name" />
|
||||
</div>
|
||||
<div>
|
||||
<h1>Player name</h1>
|
||||
<input id="player" type="text" value="squeezelite" />
|
||||
</div>
|
||||
<div>
|
||||
<h1>Optional setting (e.g. for LMS IP address)</h1>
|
||||
<input id="optional" type="text" value="" placeholder="-s 192.168.0.1" />
|
||||
</div>
|
||||
|
||||
<div class="buttons">
|
||||
<input id="generate-command" type="button" class="btn btn-success" value="Generate" />
|
||||
</div>
|
||||
|
||||
<h1>Squeezelite command to run</h1>
|
||||
<section id="command-list">
|
||||
<textarea id="autoexec1" maxlength="120">squeezelite -o I2S -b 500:2000 -d all=info -C 30 - W</textarea>
|
||||
</section>
|
||||
<div class="buttons">
|
||||
<input id="save-autoexec1" type="button" class="btn btn-success" value="Save" />
|
||||
</div>
|
||||
|
||||
<h1>Start Squeezelite (toggle to activate changes)</h1>
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" id="autoexec-cb" checked="checked">
|
||||
<label class="custom-control-label" for="autoexec-cb"></label>
|
||||
</div>
|
||||
<br />
|
||||
</div> <!-- audio -->
|
||||
|
||||
<div class="tab-pane fade" id="tab-firmware">
|
||||
<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> <!-- firmware -->
|
||||
<div class="tab-pane fade" id="tab-commands">
|
||||
<table class="table table-hover" id="commands-list-table">
|
||||
<tbody id="commands-list">
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- system -->
|
||||
|
||||
<div class="tab-pane fade" id="tab-syslog">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Timestamp</th>
|
||||
<th scope="col">Message</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="syslogTable">
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="buttons">
|
||||
<input id="clear-syslog" type="button" class="btn btn-danger btn-sm" value="Clear" />
|
||||
</div>
|
||||
</div> <!-- syslog -->
|
||||
|
||||
<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="Save" />
|
||||
</div>
|
||||
</div> <!-- nvs -->
|
||||
|
||||
<div class="tab-pane fade" id="tab-credits">
|
||||
<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>
|
||||
This app would not be possible without the following libraries:
|
||||
</p>
|
||||
<ul>
|
||||
<li>squeezelite, © 2012-2019, Adrian Smith and Ralph Irving. Licensed under the GPL License.</li>
|
||||
<li>esp32-wifi-manager, © 2017-2019, Tony Pottier. Licensed under the MIT License.</li>
|
||||
<li>SpinKit, © 2015, Tobias Ahlin. Licensed under the MIT License.</li>
|
||||
<li>jQuery, The jQuery Foundation. Licensed under the MIT License.</li>
|
||||
<li>cJSON, © 2009-2017, Dave Gamble and cJSON contributors. Licensed under the MIT License.</li>
|
||||
<li>esp32-rotary-encoder, © 2011-2019, David Antliff and Ben Buxton. Licensed under the GPL License.</li>
|
||||
<li>tarablessd1306, © 2017-2018, Tara Keeling. Licensed under the MIT license.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2>Show NVS Editor</h2>
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" id="show-nvs" checked="checked">
|
||||
<label class="custom-control-label" for="show-nvs"></label>
|
||||
</div>
|
||||
</div> <!-- credits -->
|
||||
</div>
|
||||
<footer class="footer"><span id="foot-fw"></span><span id="foot-wifi"></span></footer>
|
||||
<iframe width="0" height="0" border="0" name="dummyframe" id="dummyframe"></iframe>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
{"ssid":"zodmgbbq","ip":"192.168.1.119","netmask":"255.255.255.0","gw":"192.168.1.1","urc":0}
|
||||
19
components/wifi-manager/webapp/.babelrc
Normal file
19
components/wifi-manager/webapp/.babelrc
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"presets": [
|
||||
"@babel/preset-env",
|
||||
"@babel/typescript"
|
||||
],
|
||||
"env": {
|
||||
"production": {
|
||||
"presets": [
|
||||
"minify"
|
||||
]
|
||||
}
|
||||
},
|
||||
"plugins": [
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator",
|
||||
"@babel/plugin-proposal-optional-chaining",
|
||||
"@babel/plugin-transform-runtime",
|
||||
|
||||
],
|
||||
}
|
||||
1
components/wifi-manager/webapp/.eslintcache
Normal file
1
components/wifi-manager/webapp/.eslintcache
Normal file
@@ -0,0 +1 @@
|
||||
[{"C:\\Users\\sle11\\Documents\\VSCode\\squeezelite-esp32\\components\\wifi-manager\\webapp\\src\\js\\test.js":"1","C:\\Users\\sle11\\Documents\\VSCode\\squeezelite-esp32\\components\\wifi-manager\\webapp\\src\\js\\custom.js":"2"},{"size":4775,"mtime":1608244817341,"results":"3","hashOfConfig":"4"},{"size":52524,"mtime":1608525668984,"results":"5","hashOfConfig":"4"},{"filePath":"6","messages":"7","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"8"},"1lj4yrw",{"filePath":"9","messages":"10","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\sle11\\Documents\\VSCode\\squeezelite-esp32\\components\\wifi-manager\\webapp\\src\\js\\test.js",[],[],"C:\\Users\\sle11\\Documents\\VSCode\\squeezelite-esp32\\components\\wifi-manager\\webapp\\src\\js\\custom.js",[]]
|
||||
27
components/wifi-manager/webapp/.eslintrc
Normal file
27
components/wifi-manager/webapp/.eslintrc
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"parser": "babel-eslint",
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2020,
|
||||
"ecmaFeatures": {
|
||||
"modules": true
|
||||
}
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"jquery": true
|
||||
} ,
|
||||
"rules": {
|
||||
"no-tabs": "off",
|
||||
"semi": 0,
|
||||
"comma-dangle": 0,
|
||||
"require-jsdoc": ["off", {
|
||||
"require": {
|
||||
"FunctionDeclaration": true,
|
||||
"MethodDefinition": false,
|
||||
"ClassDeclaration": false
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
18
components/wifi-manager/webapp/.eslintrc.json.back
Normal file
18
components/wifi-manager/webapp/.eslintrc.json.back
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"jquery": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"globals": {
|
||||
"Atomics": "readonly",
|
||||
"SharedArrayBuffer": "readonly"
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
}
|
||||
}
|
||||
4
components/wifi-manager/webapp/.gitignore
vendored
Normal file
4
components/wifi-manager/webapp/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
.DS_Store
|
||||
.idea
|
||||
package-lock.json
|
||||
12
components/wifi-manager/webapp/.vscode/launch.json
vendored
Normal file
12
components/wifi-manager/webapp/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Debug",
|
||||
"preLaunchTask": "webpack: dev server",
|
||||
"sourceMaps": true,
|
||||
"trace": true
|
||||
}
|
||||
]
|
||||
}
|
||||
42
components/wifi-manager/webapp/.vscode/tasks.json
vendored
Normal file
42
components/wifi-manager/webapp/.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
// {
|
||||
// "label": "build",
|
||||
// "command": "webpack --config webpack/webpack.prod.js",
|
||||
// "type": "shell",
|
||||
// "group": { "kind": "build", "isDefault": true },
|
||||
// "isBackground": true
|
||||
// },
|
||||
|
||||
{
|
||||
"type": "npm",
|
||||
"label": "webpack: dev server",
|
||||
"script": "dev",
|
||||
"promptOnClose": true,
|
||||
"isBackground": true,
|
||||
"problemMatcher": {
|
||||
"owner": "webpack",
|
||||
"severity": "error",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "ERROR in (.*)",
|
||||
"file": 1
|
||||
},
|
||||
{
|
||||
"regexp": "\\((\\d+),(\\d+)\\):(.*)",
|
||||
"line": 1,
|
||||
"column": 2,
|
||||
"message": 3
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": "Compiling\\.\\.\\.",
|
||||
"endsPattern": "Compiled successfully\\."
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright (c) 2017-2019 Tony Pottier
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 AndyKorek
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -18,12 +19,3 @@ 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
|
||||
*/
|
||||
|
||||
|
||||
204
components/wifi-manager/webapp/README.md
Normal file
204
components/wifi-manager/webapp/README.md
Normal file
@@ -0,0 +1,204 @@
|
||||
<h2 align="center">Boilerplate - Bootstrap v4 - SASS - JQuery - WebPack</h2>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://webpack.js.org/"><img alt="Webpack" src="https://img.shields.io/badge/Webpack-4.41.6-%238DD6F9.svg"></a>
|
||||
<a href="https://babeljs.io/"><img alt="Webpack" src="https://img.shields.io/badge/Babel%2FCore-7.8.4-%23f5da55.svg"></a>
|
||||
<a href="https://www.npmjs.com/package/gulp-sass"><img alt="node-sass" src="https://img.shields.io/badge/node--sass-v4.13.1-ff69b4.svg"></a>
|
||||
<a href="https://jquery.com/"><img src="https://img.shields.io/badge/jQuery-3.3.1-blue.svg" alt="jquery"></a>
|
||||
<a href="https://lodash.com/"><img src="https://img.shields.io/badge/lodash-4.17.15-blue.svg" alt="jquery"></a>
|
||||
<a href="https://popper.js.org/"><img src="https://img.shields.io/badge/popper.js-2.0.6-blue.svg" alt="popper.js"></a>
|
||||
<a href="https://eslint.org/"><img src="https://img.shields.io/badge/es--lint-5.15.1-%23463fd4.svg" alt="eslint"></a>
|
||||
<a href="https://fontawesome.com/"><img alt="Font Awesome" src="https://img.shields.io/badge/Font--Awesome-5.12.1-blue.svg"></a>
|
||||
<a href="https://icons8.com/line-awesome"><img alt="Line Awesome" src="https://img.shields.io/badge/Line%20Awesome-1.3.0-green"></a>
|
||||
</p>
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
<p align="center">
|
||||
<em>
|
||||
SASS
|
||||
· Babel
|
||||
· Bootstrap
|
||||
· JQuery
|
||||
· PopperJS
|
||||
· Font Awesome
|
||||
</em>
|
||||
</p>
|
||||
|
||||
This Webpack4-Sass Boilerplate contains the following features:
|
||||
|
||||
- Webpack4 & Dev-Server
|
||||
- TypeScript 3.7.5
|
||||
- Babel ES6 Compiler
|
||||
- Bootstrap v4 - with Theme Support
|
||||
- Font Awesome v5.7
|
||||
- Animate.css Library v3.7.2
|
||||
- JQuery v3.3.1
|
||||
- PopperJS v2
|
||||
- _lodash
|
||||
- concentrate and minify JavaScript.
|
||||
- Compile, minify, Autoprefix SASS.
|
||||
- Optimize and Cache Images
|
||||
- Preconfigured BootsWatch Template (YETI & Slate)
|
||||
- Linting for your TS, JS and SASS
|
||||
|
||||
## Features
|
||||
|
||||
### Webpack Loaders & Plugins
|
||||
|
||||
This project contains the following loaders & plugins:
|
||||
|
||||
- `node-sass` for compiling sass (SCSS)
|
||||
- `babel-loader` for compiling ES6 code
|
||||
- `babel-eslint && eslint-loader` for Linting your .js
|
||||
- `tslint` for Linting your .ts
|
||||
- `lodash-webpack-plugin` create smaller Lodash builds by replacing feature sets of modules with noop, identity, or simpler alternatives.
|
||||
- `webpack-dev-server` for serving & Hot-Reloading
|
||||
- `css-loader` for compressing css
|
||||
- `sass-loader` for compressing and loading scss & sass
|
||||
- `url- & file-loader` for loading and optimizing images
|
||||
- `xml and csv loader` for loading data files
|
||||
- `html-loader` for loading & optimizing html files
|
||||
- `clean-webpack-plugin` for keeping your dist folder clean
|
||||
- `favicons-webpack-plugin` generate favicons form your "logo.png"
|
||||
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Dependencies
|
||||
|
||||
Make sure these are installed first.
|
||||
|
||||
- [Node.js](http://nodejs.org)
|
||||
- [Webpack](https://webpack.js.org/guides/installation/)
|
||||
|
||||
`npm install --g webpack`
|
||||
|
||||
<hr/>
|
||||
|
||||
### Quick Start
|
||||
|
||||
1. Clone the repo :
|
||||
`git clone https://github.com/AndyKorek/webpack-boilerplate-sass-ts-bootstrap4-fontawesome.git`
|
||||
2. In bash/terminal/command line, `cd ` into project directory.
|
||||
3. Run `npm i` to install required dependencies.
|
||||
|
||||
4. Run the Dev Server with (with Hot Reloading) `npm run dev`
|
||||
|
||||
<hr/>
|
||||
|
||||
### Build the Production Folder
|
||||
`npm run build`
|
||||
|
||||
This will:
|
||||
|
||||
- Bundle and Minify SASS(scss) to css & Hash and Cash it
|
||||
- generate GZip and Brodli Compressed Assets
|
||||
- Bundle and Minify JS
|
||||
- Optimize Images
|
||||
- Optimize HTML
|
||||
- generate Favicons
|
||||
|
||||
<hr/>
|
||||
|
||||
## Documentation
|
||||
|
||||
### Workflow structure
|
||||
|
||||
`src` - > source directory
|
||||
|
||||
`dist` -> build directory
|
||||
|
||||
|
||||
```
|
||||
|
||||
├── src
|
||||
│ ├── assets
|
||||
│ │ └── images
|
||||
│ ├── fonts
|
||||
│ ├── sass
|
||||
│ │ ├── layout
|
||||
| | | └── _features.scss
|
||||
│ │ ├── setup
|
||||
| | | └── _normalize.scss
|
||||
│ │ ├── themes
|
||||
| | | ├── _slate.scss
|
||||
| | | └── _yeti.scss
|
||||
│ │ ├── utils
|
||||
| | | ├── _mixins.scss
|
||||
| | | └── _variables.scss
|
||||
│ │ ├── _globals.scss
|
||||
│ │ ├── _headings.scss
|
||||
│ │ ├── _typography.scss
|
||||
│ │ ├── _vendor.scss
|
||||
│ │ └── main.scss
|
||||
│ ├── ts
|
||||
│ │ ├── custom.ts
|
||||
│ │ ├── line-awesome.ts
|
||||
│ │ ├── vendor.ts
|
||||
│ |── .htaccess
|
||||
│ |── 404.html
|
||||
│ |── index.html
|
||||
│ └── index.ts
|
||||
|
||||
|
||||
|
||||
├── dist
|
||||
│ ├── assets
|
||||
│ │ ├── images
|
||||
│ │ └──
|
||||
│ ├── css
|
||||
│ │ ├── vendors.[contenthash].css
|
||||
│ │ └── main.contenthash].css
|
||||
│ ├── js
|
||||
│ │ ├── main.[contenthash].js
|
||||
│ │ ├── runtime.[contenthash].js
|
||||
│ │ └── vendors.[contenthash].js
|
||||
│ │
|
||||
│ └── index.html
|
||||
|
||||
```
|
||||
### Loading the Features you need
|
||||
|
||||
in `src/js/vendor/_boostrap.js` uncomment all Features you need
|
||||
|
||||
put your custom js to `src/js/_custom.js`
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
### Instructions
|
||||
|
||||
- Add `sass`(.scss) files to `src/_scss` folder.
|
||||
|
||||
- Make sure you import the scss file in `main.scss`
|
||||
```
|
||||
@import "filename";
|
||||
```
|
||||
- Add your assets to `src/assets/`
|
||||
|
||||
- Add `images` to `src/assets/images`
|
||||
|
||||
## TODO list
|
||||
|
||||
- [x] Bootstrap 4
|
||||
- [x] Webpack 4
|
||||
- [x] Jquery
|
||||
- [x] PopperJS v2
|
||||
- [x] Include ES-Lint
|
||||
- [x] Font-Awesome
|
||||
- [x] Assets Loader
|
||||
- [x] Separated location for Bundled Files
|
||||
- [x] Adding EsLint
|
||||
- [ ] Code Optimising
|
||||
- [x] Uglify and Minify JS with Terser
|
||||
|
||||
## Licence
|
||||
|
||||
Code released under the [MIT License](https://github.com/AndyKorek/webpack4_boilerplate/blob/master/LICENSE).
|
||||
|
||||
*</> with* :heart: *from Germany*
|
||||
24
components/wifi-manager/webapp/config/.stylelintrc
Normal file
24
components/wifi-manager/webapp/config/.stylelintrc
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"extends": "stylelint-config-standard",
|
||||
"rules": {
|
||||
"no-duplicate-selectors": true,
|
||||
"indentation": null,
|
||||
"color-hex-case": "lower",
|
||||
"color-hex-length": "long",
|
||||
"selector-combinator-space-after": "never",
|
||||
"declaration-block-trailing-semicolon": "always",
|
||||
"declaration-colon-space-before": "never",
|
||||
"declaration-colon-newline-after": null,
|
||||
"comment-whitespace-inside": "always",
|
||||
"comment-empty-line-before": null,
|
||||
"selector-pseudo-class-parentheses-space-inside": "always",
|
||||
"selector-list-comma-newline-after": null,
|
||||
"media-feature-range-operator-space-before": "always",
|
||||
"media-feature-range-operator-space-after": "always",
|
||||
"media-feature-parentheses-space-inside": "always",
|
||||
"media-feature-colon-space-before": "always",
|
||||
"media-feature-colon-space-after": "always",
|
||||
"no-eol-whitespace": null,
|
||||
"no-missing-end-of-source-newline": null,
|
||||
"number-leading-zero": "never" }
|
||||
}
|
||||
3
components/wifi-manager/webapp/debug.log
Normal file
3
components/wifi-manager/webapp/debug.log
Normal file
@@ -0,0 +1,3 @@
|
||||
[1211/165128.604:ERROR:directory_reader_win.cc(43)] FindFirstFile: Le chemin d<>acc<63>s sp<73>cifi<66> est introuvable. (0x3)
|
||||
[1212/063417.746:ERROR:directory_reader_win.cc(43)] FindFirstFile: Le chemin d<>acc<63>s sp<73>cifi<66> est introuvable. (0x3)
|
||||
[1213/063413.475:ERROR:directory_reader_win.cc(43)] FindFirstFile: Le chemin d<>acc<63>s sp<73>cifi<66> est introuvable. (0x3)
|
||||
@@ -8,5 +8,6 @@
|
||||
{"ssid":"The Shah 5GHz-2","chan":1,"rssi":-90,"auth":3},
|
||||
{"ssid":"SINGTEL-1D28 (2G)","chan":11,"rssi":-91,"auth":3},
|
||||
{"ssid":"dlink-F864","chan":1,"rssi":-92,"auth":4},
|
||||
{"ssid":"dlink-74F0","chan":1,"rssi":-93,"auth":4}
|
||||
{"ssid":"dlink-74F0","chan":1,"rssi":-93,"auth":4},
|
||||
{"ssid":"MyTestSSID","chan":2,"rssi":-53,"auth":4}
|
||||
]
|
||||
617
components/wifi-manager/webapp/mock/commands.json
Normal file
617
components/wifi-manager/webapp/mock/commands.json
Normal file
@@ -0,0 +1,617 @@
|
||||
{
|
||||
"commands": [{
|
||||
"help": "WiFi",
|
||||
"hascb": true,
|
||||
"argtable": [{
|
||||
"datatype": "Fast|Comprehensive",
|
||||
"glossary": "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.",
|
||||
"longopts": "scanmode",
|
||||
"checkbox": false,
|
||||
"hasvalue": true,
|
||||
"mincount": 0,
|
||||
"maxcount": 1
|
||||
}],
|
||||
"hint": " [--scanmode=Fast|Comprehensive]",
|
||||
"name": "cfg-syst-wifi"
|
||||
}, {
|
||||
"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
|
||||
}],
|
||||
"hint": " [--BT_Speaker] [--AirPlay] [-t Disabled|Telnet Only|Telnet and Serial]",
|
||||
"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": "Bureau-OLED",
|
||||
"glossary": "New Name",
|
||||
"longopts": "name",
|
||||
"shortopts": "n",
|
||||
"checkbox": false,
|
||||
"hasvalue": true,
|
||||
"mincount": 0,
|
||||
"maxcount": 1
|
||||
}],
|
||||
"hint": " [-n Bureau-OLED]",
|
||||
"name": "cfg-syst-name"
|
||||
}, {
|
||||
"help": "Get version of chip and SDK",
|
||||
"hascb": false,
|
||||
"name": "version"
|
||||
}, {
|
||||
"help": "Reboot system",
|
||||
"hascb": false,
|
||||
"name": "restart"
|
||||
}, {
|
||||
"help": "Reboot system to Recovery",
|
||||
"hascb": false,
|
||||
"name": "recovery"
|
||||
}, {
|
||||
"help": "Reboot system to Squeezelite",
|
||||
"hascb": false,
|
||||
"name": "restart_ota"
|
||||
}, {
|
||||
"help": "General Audio Options",
|
||||
"hascb": true,
|
||||
"argtable": [{
|
||||
"datatype": "Headphones|Subwoofer",
|
||||
"glossary": "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.",
|
||||
"longopts": "jack_behavior",
|
||||
"shortopts": "j",
|
||||
"checkbox": false,
|
||||
"hasvalue": true,
|
||||
"mincount": 0,
|
||||
"maxcount": 1
|
||||
}],
|
||||
"hint": " [-j Headphones|Subwoofer]",
|
||||
"name": "cfg-audio-general"
|
||||
}, {
|
||||
"help": "Bluetooth Audio Output Options",
|
||||
"hascb": true,
|
||||
"argtable": [{
|
||||
"datatype": "name",
|
||||
"glossary": "Bluetooth audio device name. This applies when output mode is Bluetooth",
|
||||
"longopts": "sink_name",
|
||||
"shortopts": "n",
|
||||
"checkbox": false,
|
||||
"hasvalue": true,
|
||||
"mincount": 1,
|
||||
"maxcount": 1
|
||||
}, {
|
||||
"datatype": "pin",
|
||||
"glossary": "Bluetooth security/pin code. Usually 0000. This applies when output mode is Bluetooth",
|
||||
"longopts": "pin_code",
|
||||
"shortopts": "p",
|
||||
"checkbox": false,
|
||||
"hasvalue": true,
|
||||
"mincount": 1,
|
||||
"maxcount": 1
|
||||
}],
|
||||
"hint": " -n name -p pin",
|
||||
"name": "cfg-audio-bt_source"
|
||||
}, {
|
||||
"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 GPIO level. Checked=HIGH, Unchecked=LOW",
|
||||
"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": "SPDIF Options",
|
||||
"hascb": true,
|
||||
"argtable": [{
|
||||
"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
|
||||
}, {
|
||||
"glossary": "Clear configuration",
|
||||
"longopts": "clear",
|
||||
"checkbox": true,
|
||||
"hasvalue": false,
|
||||
"mincount": 0,
|
||||
"maxcount": 1
|
||||
}],
|
||||
"hint": " --clock=<n> --wordselect=<n> --data=<n> [--clear]",
|
||||
"name": "cfg-hw-spdif"
|
||||
}, {
|
||||
"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": "Clear configuration",
|
||||
"longopts": "clear",
|
||||
"checkbox": true,
|
||||
"hasvalue": false,
|
||||
"mincount": 0,
|
||||
"maxcount": 1
|
||||
}],
|
||||
"hint": " [-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": "1|2",
|
||||
"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 1|2] [--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|ST7735|ST7789|ILI9341|>",
|
||||
"glossary": "Driver",
|
||||
"longopts": "driver",
|
||||
"shortopts": "d",
|
||||
"checkbox": false,
|
||||
"hasvalue": true,
|
||||
"mincount": 0,
|
||||
"maxcount": 1
|
||||
}, {
|
||||
"datatype": "1|4",
|
||||
"glossary": "Bit Depth (only for SSD1326 displays)",
|
||||
"longopts": "depth",
|
||||
"shortopts": "p",
|
||||
"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": 1,
|
||||
"maxcount": 1
|
||||
}, {
|
||||
"datatype": "<n>",
|
||||
"glossary": "Height",
|
||||
"longopts": "height",
|
||||
"shortopts": "h",
|
||||
"checkbox": false,
|
||||
"hasvalue": true,
|
||||
"mincount": 1,
|
||||
"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": "SPI Only. Bus Speed (Default 8000000). SPI interface can work up to 26MHz~40MHz",
|
||||
"longopts": "speed",
|
||||
"shortopts": "s",
|
||||
"checkbox": false,
|
||||
"hasvalue": true,
|
||||
"mincount": 0,
|
||||
"maxcount": 1
|
||||
}, {
|
||||
"datatype": "<n>",
|
||||
"glossary": "SPI Only. CS GPIO (for SPI displays)",
|
||||
"longopts": "cs",
|
||||
"shortopts": "b",
|
||||
"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
|
||||
}, {
|
||||
"datatype": "<n>",
|
||||
"glossary": "Reset GPIO",
|
||||
"longopts": "reset",
|
||||
"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|ST7735|ST7789|ILI9341|>] [-p 1|4] [-a <n>] -w <n> -h <n> [--hf] [--vf] [-s <n>] [-b <n>] [-b <n>] [--reset=<n>] [--clear]",
|
||||
"name": "cfg-hw-display"
|
||||
}],
|
||||
"values": {
|
||||
"cfg-syst-wifi": {
|
||||
"scanmode": "Fast"
|
||||
},
|
||||
"cfg-syst-services": {
|
||||
"BT_Speaker": true,
|
||||
"AirPlay": true,
|
||||
"telnet": "Telnet Only"
|
||||
},
|
||||
"cfg-syst-name": {
|
||||
"name": "Bureau-OLED"
|
||||
},
|
||||
"cfg-audio-general": {
|
||||
"jack_behavior": "Subwoofer"
|
||||
},
|
||||
"cfg-audio-bt_source": {
|
||||
"sink_name": "SMSL BT4.2",
|
||||
"pin_code": "0000"
|
||||
},
|
||||
"cfg-hw-dac": {
|
||||
"clock": 33,
|
||||
"wordselect": 25,
|
||||
"data": 32,
|
||||
"model_name": "I2S"
|
||||
},
|
||||
"cfg-hw-spdif": {
|
||||
},
|
||||
"cfg-hw-i2c": {
|
||||
"speed": 400000
|
||||
},
|
||||
"cfg-hw-spi": {
|
||||
"data": 4,
|
||||
"clk": 5,
|
||||
"dc": 18,
|
||||
"host": 1
|
||||
},
|
||||
"cfg-hw-display": {
|
||||
"width": 256,
|
||||
"height": 64,
|
||||
"reset": 21,
|
||||
"driver": "SSD1322",
|
||||
"cs": 19,
|
||||
"speed": 16000000,
|
||||
"type": "SPI",
|
||||
"rotate": false,
|
||||
"hf": false,
|
||||
"vf": false
|
||||
}
|
||||
}
|
||||
}
|
||||
343
components/wifi-manager/webapp/mock/config.json
Normal file
343
components/wifi-manager/webapp/mock/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
|
||||
}
|
||||
}
|
||||
}
|
||||
78
components/wifi-manager/webapp/mock/messages.json
Normal file
78
components/wifi-manager/webapp/mock/messages.json
Normal file
@@ -0,0 +1,78 @@
|
||||
[{
|
||||
"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": "Wifi connected",
|
||||
"type": "MESSAGING_INFO",
|
||||
"class": "MESSAGING_CLASS_SYSTEM",
|
||||
"sent_time": 141256,
|
||||
"current_time": 147319
|
||||
},
|
||||
{
|
||||
"message": "[{\n\t\t\"name\":\t\"SMSL BT4.2\",\n\t\t\"rssi\":\t-64\n\t}]",
|
||||
"type": "MESSAGING_INFO",
|
||||
"class": "MESSAGING_CLASS_BT",
|
||||
"sent_time": 6245,
|
||||
"current_time": 6364
|
||||
}, {
|
||||
"message": "[{\n\t\t\"name\":\t\"SMSL BT4.2\",\n\t\t\"rssi\":\t-129\n\t}]",
|
||||
"type": "MESSAGING_INFO",
|
||||
"class": "MESSAGING_CLASS_BT",
|
||||
"sent_time": 6259,
|
||||
"current_time": 6364
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
90
components/wifi-manager/webapp/mock/messages_testing.json
Normal file
90
components/wifi-manager/webapp/mock/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
|
||||
}
|
||||
]
|
||||
1
components/wifi-manager/webapp/mock/scan.json
Normal file
1
components/wifi-manager/webapp/mock/scan.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
16
components/wifi-manager/webapp/mock/status-messages.json
Normal file
16
components/wifi-manager/webapp/mock/status-messages.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"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,
|
||||
"bt_status": 0,
|
||||
"ssid": "MyTestSSID",
|
||||
"ip": "192.168.10.225",
|
||||
"netmask": "255.255.255.0",
|
||||
"gw": "192.168.10.1"
|
||||
}
|
||||
18
components/wifi-manager/webapp/mock/status.json
Normal file
18
components/wifi-manager/webapp/mock/status.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"project_name": "dev-server",
|
||||
"version": "webpack",
|
||||
"recovery": 1,
|
||||
"Jack": "1",
|
||||
"Voltage": 0,
|
||||
"disconnect_count": 0,
|
||||
"avg_conn_time": 0,
|
||||
"is_i2c_locked": false,
|
||||
"urc": 0,
|
||||
"bt_status": 0,
|
||||
"bt_sub_status": 0,
|
||||
"rssi": -59,
|
||||
"ssid": "MyTestSSID",
|
||||
"ip": "192.168.10.225",
|
||||
"netmask": "255.255.255.0",
|
||||
"gw": "192.168.10.1"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user