mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-04-20 11:02:14 +02:00
Merge pull request #13 from shailensobhee/main
minor edits to see the GPIO pins on ESP32-C6-WROOM-1
This commit is contained in:
commit
e82417475b
15 changed files with 497 additions and 61 deletions
45
.gitignore
vendored
45
.gitignore
vendored
|
|
@ -1,19 +1,40 @@
|
||||||
|
# IDE and Tooling
|
||||||
.theia/
|
.theia/
|
||||||
|
.vscode/
|
||||||
|
.claude/
|
||||||
|
.pio/
|
||||||
debug_custom.json
|
debug_custom.json
|
||||||
esp32.vsd
|
|
||||||
esp32s3.svd
|
|
||||||
debug.cfg
|
debug.cfg
|
||||||
|
|
||||||
|
# Hardware / SVD Files
|
||||||
|
esp32.vsd
|
||||||
|
esp32s3.svd
|
||||||
|
|
||||||
|
# Build, Logs and Output Folders
|
||||||
|
build/
|
||||||
|
data/
|
||||||
|
logs/
|
||||||
|
managed_components/
|
||||||
|
|
||||||
|
# ESP-IDF Specific
|
||||||
|
sdkconfig
|
||||||
|
sdkconfig.old
|
||||||
|
sdkconfig.*
|
||||||
|
|
||||||
|
# Binary and Archive Files
|
||||||
|
*.elf
|
||||||
|
elf_archive/
|
||||||
|
coredump_report.txt
|
||||||
|
coredump.bin
|
||||||
|
|
||||||
|
# Project Specific / Generated Source
|
||||||
|
src/SomfyController.ino.cpp
|
||||||
|
|
||||||
|
# Ignore Somfy INO/Bin files
|
||||||
SomfyController.ino.XIAO_ESP32S3.bin
|
SomfyController.ino.XIAO_ESP32S3.bin
|
||||||
SomfyController.ino.esp32c3.bin
|
SomfyController.ino.esp32c3.bin
|
||||||
SomfyController.ino.esp32s2.bin
|
SomfyController.ino.esp32s2.bin
|
||||||
.vscode/
|
|
||||||
.pio/
|
# Temporary and Backup Files
|
||||||
.claude/
|
*.orig
|
||||||
data/
|
*.bak
|
||||||
build/
|
|
||||||
coredump_report.txt
|
|
||||||
coredump.bin
|
|
||||||
logs/
|
|
||||||
elf_archive/
|
|
||||||
src/SomfyController.ino.cpp
|
|
||||||
|
|
|
||||||
3
CMakeLists.txt
Normal file
3
CMakeLists.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
cmake_minimum_required(VERSION 3.16.0)
|
||||||
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
|
project(ESPSomfy-RTS)
|
||||||
32
app_version.py
Normal file
32
app_version.py
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
import os
|
||||||
|
Import("env")
|
||||||
|
|
||||||
|
# Define the folder and filename
|
||||||
|
DATA_FOLDER = "data-src"
|
||||||
|
FILENAME = "appversion"
|
||||||
|
|
||||||
|
# Construct the full path: /your/project/path/data-src/appversion
|
||||||
|
project_dir = env.get("PROJECT_DIR")
|
||||||
|
version_file_path = os.path.join(project_dir, DATA_FOLDER, FILENAME)
|
||||||
|
|
||||||
|
# Default fallback if something goes wrong
|
||||||
|
version = "0.0.0"
|
||||||
|
|
||||||
|
if os.path.exists(version_file_path):
|
||||||
|
try:
|
||||||
|
with open(version_file_path, "r") as f:
|
||||||
|
version = f.read().strip()
|
||||||
|
# Clean output for the PlatformIO console
|
||||||
|
print(f"--- SUCCESS: Found version {version} in {version_file_path} ---")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"--- ERROR: could not read version file: {e} ---")
|
||||||
|
else:
|
||||||
|
print(f"--- ERROR: File NOT FOUND at {version_file_path} ---")
|
||||||
|
|
||||||
|
# Apply to the build environment
|
||||||
|
# We use escaped quotes so C++ treats it as a string literal "vX.X.X"
|
||||||
|
full_version_str = f'\\"v{version}\\"'
|
||||||
|
|
||||||
|
env.Append(CPPDEFINES=[
|
||||||
|
("FW_VERSION", full_version_str)
|
||||||
|
])
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
//var hst = '192.168.1.208';
|
/**
|
||||||
var hst = '192.168.1.152';
|
* hst is a development convenience variable: it's a hardcoded IP address used when the HTML file is opened directly
|
||||||
//var hst = '192.168.1.159';
|
* from the filesystem (i.e., file:// protocol) rather than served from the ESP32.
|
||||||
|
* Adapt the IP accordingly based on your router configuration.
|
||||||
|
**/
|
||||||
|
var hst = '192.168.178.20';
|
||||||
var _rooms = [{ roomId: 0, name: 'Home' }];
|
var _rooms = [{ roomId: 0, name: 'Home' }];
|
||||||
|
|
||||||
var errors = [
|
var errors = [
|
||||||
|
|
@ -1268,9 +1271,27 @@ class Security {
|
||||||
}
|
}
|
||||||
var security = new Security();
|
var security = new Security();
|
||||||
|
|
||||||
|
// let appVersion = 'v3.0.11'; // Default placeholder
|
||||||
|
async function getAppVersion() {
|
||||||
|
try {
|
||||||
|
const response = await fetch('/appversion');
|
||||||
|
if (!response.ok) throw new Error('File not found');
|
||||||
|
|
||||||
|
const data = await response.text();
|
||||||
|
appVersion = `v${data.trim()}`;
|
||||||
|
|
||||||
|
console.log("Loaded Version:", appVersion);
|
||||||
|
// Trigger any UI updates here
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error loading App version:", error);
|
||||||
|
appVersion = 'v3.0.11'; // Default placeholder
|
||||||
|
}
|
||||||
|
return appVersion;
|
||||||
|
}
|
||||||
|
|
||||||
class General {
|
class General {
|
||||||
initialized = false;
|
initialized = false;
|
||||||
appVersion = 'v3.0.11';
|
appVersion = getAppVersion();
|
||||||
reloadApp = false;
|
reloadApp = false;
|
||||||
init() {
|
init() {
|
||||||
if (this.initialized) return;
|
if (this.initialized) return;
|
||||||
|
|
@ -2795,16 +2816,17 @@ class Somfy {
|
||||||
document.getElementById('divLinkedShadeList').innerHTML = divCfg;
|
document.getElementById('divLinkedShadeList').innerHTML = divCfg;
|
||||||
}
|
}
|
||||||
pinMaps = [
|
pinMaps = [
|
||||||
{ name: '', maxPins: 39, inputs: [0, 1, 6, 7, 8, 9, 10, 11, 37, 38], outputs: [3, 6, 7, 8, 9, 10, 11, 34, 35, 36, 37, 38, 39] },
|
{ name: '', maxPins: 39, inputs: [], outputs: [] },
|
||||||
{ name: 's2', maxPins: 46, inputs: [0, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 45], outputs: [0, 19, 20, 26, 27, 28, 29, 30, 31, 32, 45, 46]},
|
{ name: 's2', maxPins: 46, inputs: [0, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 45], outputs: [0, 19, 20, 26, 27, 28, 29, 30, 31, 32, 45, 46]},
|
||||||
{ name: 's3', maxPins: 48, inputs: [19, 20, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32], outputs: [19, 20, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32] },
|
{ name: 's3', maxPins: 48, inputs: [19, 20, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32], outputs: [19, 20, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32] },
|
||||||
{ name: 'c3', maxPins: 21, inputs: [11, 12, 13, 14, 15, 16, 17, 18, 19, 20], outputs: [11, 12, 13, 14, 15, 16, 17, 21] }
|
{ name: 'c3', maxPins: 21, inputs: [11, 12, 13, 14, 15, 16, 17, 18, 19, 20], outputs: [11, 12, 13, 14, 15, 16, 17, 21] },
|
||||||
|
{ name: 'c6', maxPins: 23, inputs: [], outputs: [] }
|
||||||
];
|
];
|
||||||
|
|
||||||
loadPins(type, sel, opt) {
|
loadPins(type, sel, opt) {
|
||||||
while (sel.firstChild) sel.removeChild(sel.firstChild);
|
while (sel.firstChild) sel.removeChild(sel.firstChild);
|
||||||
let cm = document.getElementById('divContainer').getAttribute('data-chipmodel');
|
let cm = document.getElementById('divContainer').getAttribute('data-chipmodel');
|
||||||
let pm = this.pinMaps.find(x => x.name === cm) || { name: '', maxPins: 39, inputs: [0, 1, 6, 7, 8, 9, 10, 11, 37, 38], outputs: [3, 6, 7, 8, 9, 10, 11, 34, 35, 36, 37, 38, 39] };
|
let pm = this.pinMaps.find(x => x.name === cm) || { name: '', maxPins: 39, inputs: [], outputs: [] };
|
||||||
//console.log({ cm: cm, pm: pm });
|
//console.log({ cm: cm, pm: pm });
|
||||||
for (let i = 0; i <= pm.maxPins; i++) {
|
for (let i = 0; i <= pm.maxPins; i++) {
|
||||||
if (type.includes('in') && pm.inputs.includes(i)) continue;
|
if (type.includes('in') && pm.inputs.includes(i)) continue;
|
||||||
|
|
@ -4815,3 +4837,15 @@ class Firmware {
|
||||||
}
|
}
|
||||||
var firmware = new Firmware();
|
var firmware = new Firmware();
|
||||||
|
|
||||||
|
window.addEventListener('load', async () => {
|
||||||
|
// 1. Initialize your main application logic
|
||||||
|
// await init();
|
||||||
|
|
||||||
|
// 2. Fetch and display the app version
|
||||||
|
appVersion = await getAppVersion();
|
||||||
|
const spanAppVersion = document.getElementById('spanAppVersion');
|
||||||
|
spanAppVersion.innerText = `${appVersion.trim()}`;
|
||||||
|
|
||||||
|
console.log("Application fully loaded and version updated.");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
|
||||||
322
dependencies.lock
Normal file
322
dependencies.lock
Normal file
|
|
@ -0,0 +1,322 @@
|
||||||
|
dependencies:
|
||||||
|
chmorgan/esp-libhelix-mp3:
|
||||||
|
component_hash: cbb76089dc2c5749f7b470e2e70aedc44c9da519e04eb9a67d4c7ec275229e53
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=4.1.0'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.0.3
|
||||||
|
espressif/cbor:
|
||||||
|
component_hash: dad9ca860963e930366510a10b422b3125a4fb27b979712ed65efcbcd742de50
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=5.0'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 0.6.1~4
|
||||||
|
espressif/esp-dsp:
|
||||||
|
component_hash: 939e9c053487d6e7b7320a5cb761b2200e4b331730d6721668755ef76ab9f067
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=4.2'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.7.1
|
||||||
|
espressif/esp-modbus:
|
||||||
|
component_hash: 5d5e90b9e55721a8a194b301ad8102d4affb647f47b74cd413ff7d1ce2c1169c
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=4.3'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.0.18
|
||||||
|
espressif/esp-serial-flasher:
|
||||||
|
component_hash: dcc42a16712a1a636509cf0bf90e14032d7f2141784b533613b267b6aa318d52
|
||||||
|
dependencies: []
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
type: service
|
||||||
|
version: 0.0.11
|
||||||
|
espressif/esp-zboss-lib:
|
||||||
|
component_hash: 321883d142421f65009972408287441794250057668a11abbdfd8bec77c3309a
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=5.0'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.6.4
|
||||||
|
espressif/esp-zigbee-lib:
|
||||||
|
component_hash: fa0812e6743e2a7d999af9f44ccdcea17ccb1e80f98d6b2956f44687503a88fd
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=5.0'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.6.8
|
||||||
|
espressif/esp_diag_data_store:
|
||||||
|
component_hash: c1e5cf62f545d2b136db299f4df1b228b9840be5bc3410c9ad2d2a882b5c0d64
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=4.1'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.0.2
|
||||||
|
espressif/esp_diagnostics:
|
||||||
|
component_hash: 5ea8e8da8217ed9ed778db3973139e726e17cd27ef5cf6429c787d19226c79f3
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=4.1'
|
||||||
|
- name: espressif/rmaker_common
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
version: ~1.4.0
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.2.1
|
||||||
|
espressif/esp_insights:
|
||||||
|
component_hash: 4015c524b9955528f941268cf080174076b195800de910d061efc46113bc2e0c
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=4.1'
|
||||||
|
- name: espressif/cbor
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
rules:
|
||||||
|
- if: idf_version >=5.0
|
||||||
|
version: ~0.6
|
||||||
|
- name: espressif/esp_diag_data_store
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
version: 1.0.2
|
||||||
|
- name: espressif/esp_diagnostics
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
version: 1.2.1
|
||||||
|
- name: espressif/rmaker_common
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
version: ~1.4.0
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.2.2
|
||||||
|
espressif/esp_modem:
|
||||||
|
component_hash: f4fa6dab2496af2673a68881132bb7ce0f05bf62e30e5bd0d45b607066378a28
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=4.1'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 2.0.1
|
||||||
|
espressif/esp_rainmaker:
|
||||||
|
component_hash: f6fe458fc7a0102ee2879f0247da4b41419e6c07de12031f66e5e9454d25baaa
|
||||||
|
dependencies:
|
||||||
|
- name: espressif/esp_rcp_update
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
rules:
|
||||||
|
- if: idf_version >= 5.1
|
||||||
|
version: ~1.2.0
|
||||||
|
- name: espressif/esp_schedule
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
version: ~1.2.0
|
||||||
|
- name: espressif/esp_secure_cert_mgr
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
rules:
|
||||||
|
- if: idf_version >=4.3
|
||||||
|
version: ^2.2.1
|
||||||
|
- name: espressif/json_generator
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
version: ~1.1.1
|
||||||
|
- name: espressif/json_parser
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
version: ~1.0.3
|
||||||
|
- name: espressif/mdns
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
rules:
|
||||||
|
- if: idf_version >=5.0
|
||||||
|
version: ^1.2.0
|
||||||
|
- name: espressif/network_provisioning
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
rules:
|
||||||
|
- if: idf_version >= 5.1
|
||||||
|
version: ~1.0.0
|
||||||
|
- name: espressif/rmaker_common
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
version: ~1.4.6
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.5.2
|
||||||
|
espressif/esp_rcp_update:
|
||||||
|
component_hash: c10afbd54a17f27eed880e61262b161656e6d36ad63376c307f9273e99d0abcd
|
||||||
|
dependencies:
|
||||||
|
- name: espressif/esp-serial-flasher
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
version: ~0.0.0
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=5.0'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
type: service
|
||||||
|
version: 1.2.0
|
||||||
|
espressif/esp_schedule:
|
||||||
|
component_hash: e202a9c688f7f1ab601efb91d682e4bcfaebc508dcceee1a1e0a0d2d1ca75a26
|
||||||
|
dependencies:
|
||||||
|
- name: espressif/rmaker_common
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
version: ~1.4.2
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
type: service
|
||||||
|
version: 1.2.0
|
||||||
|
espressif/esp_secure_cert_mgr:
|
||||||
|
component_hash: 2587797e68395edb67f30a7f9a7ce6a529492fa5fa6468592e912bc7ea34dbae
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=4.3'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
type: service
|
||||||
|
version: 2.9.1
|
||||||
|
espressif/jsmn:
|
||||||
|
component_hash: d80350c41bbaa827c98a25b6072df00884e72f54885996fab4a4f0aebce6b6c3
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=4.3'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
type: service
|
||||||
|
version: 1.1.0
|
||||||
|
espressif/json_generator:
|
||||||
|
component_hash: 45033e1c199b13f1c8c1b544fb7d4e2df6a8e3071ebdcb1b22582b61a7974ff2
|
||||||
|
dependencies: []
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
type: service
|
||||||
|
version: 1.1.2
|
||||||
|
espressif/json_parser:
|
||||||
|
component_hash: d74b81729ad06ec11ff5eb5b1b0d7df1d00e6027fc11471f4b139c70dcf1b1e4
|
||||||
|
dependencies:
|
||||||
|
- name: espressif/jsmn
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
require: private
|
||||||
|
rules:
|
||||||
|
- if: idf_version >=5.0
|
||||||
|
version: ~1.1
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com
|
||||||
|
type: service
|
||||||
|
version: 1.0.3
|
||||||
|
espressif/libsodium:
|
||||||
|
component_hash: b51f5836f044d8b7fbb1784257605c47ff7356f701377b005912fe6a2f12db37
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=4.2'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.0.21
|
||||||
|
espressif/mdns:
|
||||||
|
component_hash: 1ebe3bd675bb9d1c58f52bc0b609b32f74e572b01c328f9e61282040c775495c
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=5.0'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.11.0
|
||||||
|
espressif/network_provisioning:
|
||||||
|
component_hash: ef2e10182fd1861e68b821491916327c25416ca7ae70e5a6e43313dbc71fe993
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=5.1'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.0.2
|
||||||
|
espressif/qrcode:
|
||||||
|
component_hash: 3b493771bc5d6ad30cbf87c25bf784aada8a08c941504355b55d6b75518ed7bc
|
||||||
|
dependencies: []
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 0.1.0~2
|
||||||
|
espressif/rmaker_common:
|
||||||
|
component_hash: a3a1df881278d0351fc850b77792fe8a196ddd6dcacbea203d606329cc6a0239
|
||||||
|
dependencies: []
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.4.6
|
||||||
|
idf:
|
||||||
|
source:
|
||||||
|
type: idf
|
||||||
|
version: 5.5.2
|
||||||
|
joltwallet/littlefs:
|
||||||
|
component_hash: dcea25bcef2de023f089f5f01e8d8c46ad1b8ffef75861ad5ffb4098555839df
|
||||||
|
dependencies:
|
||||||
|
- name: idf
|
||||||
|
require: private
|
||||||
|
version: '>=5.0'
|
||||||
|
source:
|
||||||
|
registry_url: https://components.espressif.com/
|
||||||
|
type: service
|
||||||
|
version: 1.20.4
|
||||||
|
direct_dependencies:
|
||||||
|
- chmorgan/esp-libhelix-mp3
|
||||||
|
- espressif/cbor
|
||||||
|
- espressif/esp-dsp
|
||||||
|
- espressif/esp-modbus
|
||||||
|
- espressif/esp-zboss-lib
|
||||||
|
- espressif/esp-zigbee-lib
|
||||||
|
- espressif/esp_diag_data_store
|
||||||
|
- espressif/esp_diagnostics
|
||||||
|
- espressif/esp_insights
|
||||||
|
- espressif/esp_modem
|
||||||
|
- espressif/esp_rainmaker
|
||||||
|
- espressif/libsodium
|
||||||
|
- espressif/mdns
|
||||||
|
- espressif/network_provisioning
|
||||||
|
- espressif/qrcode
|
||||||
|
- espressif/rmaker_common
|
||||||
|
- idf
|
||||||
|
- joltwallet/littlefs
|
||||||
|
manifest_hash: 3e908f06feb1567024342d2aa7f9257e07d7fd89e839fca4eec0522ea95a34de
|
||||||
|
target: esp32c6
|
||||||
|
version: 2.0.0
|
||||||
6
esp32_huge_app.csv
Normal file
6
esp32_huge_app.csv
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Name, Type, SubType, Offset, Size
|
||||||
|
nvs, data, nvs, 0x9000, 0x5000,
|
||||||
|
otadata, data, ota, 0xE000, 0x2000,
|
||||||
|
app0, app, factory, 0x10000, 0x300000,
|
||||||
|
spiffs, data, spiffs, 0x310000, 0xD0000,
|
||||||
|
coredump, data, coredump, 0x3E0000, 0x10000,
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
default_envs = esp32devdbg
|
default_envs = esp32devdbg
|
||||||
|
src_dir = src
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
platform = espressif32 @ 6.13.0
|
platform = espressif32 @ 6.13.0
|
||||||
|
|
@ -21,9 +22,9 @@ lib_deps =
|
||||||
esp32async/ESPAsyncWebServer@^3.10.3
|
esp32async/ESPAsyncWebServer@^3.10.3
|
||||||
esp32async/AsyncTCP@^3.4.10
|
esp32async/AsyncTCP@^3.4.10
|
||||||
extra_scripts =
|
extra_scripts =
|
||||||
|
pre:app_version.py
|
||||||
pre:minify.py
|
pre:minify.py
|
||||||
post:archive_elf.py
|
post:archive_elf.py
|
||||||
|
|
||||||
board_build.filesystem = littlefs
|
board_build.filesystem = littlefs
|
||||||
build_flags =
|
build_flags =
|
||||||
-DCORE_DEBUG_LEVEL=3
|
-DCORE_DEBUG_LEVEL=3
|
||||||
|
|
@ -55,12 +56,23 @@ board_build.partitions = esp32_3MB.csv
|
||||||
board = esp32-s3-devkitc-1
|
board = esp32-s3-devkitc-1
|
||||||
|
|
||||||
[env:esp32c6]
|
[env:esp32c6]
|
||||||
platform = https://github.com/mnowak32/platform-espressif32.git#boards/seeed_xiao_esp32c6
|
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
|
||||||
platform_packages =
|
|
||||||
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.4
|
|
||||||
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip
|
|
||||||
board = seeed_xiao_esp32c6
|
board = seeed_xiao_esp32c6
|
||||||
board_build.partitions = esp32_3MB.csv
|
build_type = debug
|
||||||
|
board_build.partitions = esp32_huge_app.csv
|
||||||
build_flags =
|
build_flags =
|
||||||
${env.build_flags}
|
${env.build_flags}
|
||||||
-I${platformio.packages_dir}/framework-arduinoespressif32/libraries/Network/src
|
-DCONFIG_FREERTOS_HZ=1000
|
||||||
|
-include "driver/gpio.h"
|
||||||
|
lib_deps =
|
||||||
|
; Low-Level libs, frameowrks and drivers
|
||||||
|
ESP32Async/AsyncTCP
|
||||||
|
https://github.com/Viproz/SmartRC-CC1101-Driver-Lib.git
|
||||||
|
; Commmunication Protocol
|
||||||
|
links2004/WebSockets
|
||||||
|
https://github.com/hmueller01/pubsubclient3.git
|
||||||
|
; Data-Parsing
|
||||||
|
bblanchon/ArduinoJson
|
||||||
|
; High-level wrappers/servers
|
||||||
|
ESP32Async/ESPAsyncWebServer
|
||||||
|
|
||||||
|
|
|
||||||
6
src/CMakeLists.txt
Normal file
6
src/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
# This file was automatically generated for projects
|
||||||
|
# without default 'CMakeLists.txt' file.
|
||||||
|
|
||||||
|
FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*)
|
||||||
|
|
||||||
|
idf_component_register(SRCS ${app_sources})
|
||||||
|
|
@ -158,7 +158,7 @@ bool ConfigSettings::begin() {
|
||||||
case esp_chip_model_t::CHIP_ESP32C3:
|
case esp_chip_model_t::CHIP_ESP32C3:
|
||||||
strcpy(this->chipModel, "c3");
|
strcpy(this->chipModel, "c3");
|
||||||
break;
|
break;
|
||||||
#ifdef CHIP_ESP32C6
|
#ifdef CONFIG_IDF_TARGET_ESP32C6
|
||||||
case esp_chip_model_t::CHIP_ESP32C6:
|
case esp_chip_model_t::CHIP_ESP32C6:
|
||||||
strcpy(this->chipModel, "c6");
|
strcpy(this->chipModel, "c6");
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,11 @@
|
||||||
#ifndef configsettings_h
|
#ifndef configsettings_h
|
||||||
#define configsettings_h
|
#define configsettings_h
|
||||||
#include "WResp.h"
|
#include "WResp.h"
|
||||||
#define FW_VERSION "v3.0.11"
|
|
||||||
|
#ifndef FW_VERSION
|
||||||
|
#define FW_VERSION "v3.0.11" // Fallback if app_version.py script fails
|
||||||
|
#endif
|
||||||
|
|
||||||
enum class conn_types_t : byte {
|
enum class conn_types_t : byte {
|
||||||
unset = 0x00,
|
unset = 0x00,
|
||||||
wifi = 0x01,
|
wifi = 0x01,
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,12 @@
|
||||||
#include <ESPmDNS.h>
|
#include <ESPmDNS.h>
|
||||||
#include <esp_task_wdt.h>
|
#include <esp_task_wdt.h>
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
|
||||||
|
// Only reset the WDT if the current task is actually subscribed.
|
||||||
|
// setConnected() is called from the WiFi event task which is not registered.
|
||||||
|
static inline void safe_wdt_reset() {
|
||||||
|
if (esp_task_wdt_status(NULL) == ESP_OK) esp_task_wdt_reset();
|
||||||
|
}
|
||||||
#include "ConfigSettings.h"
|
#include "ConfigSettings.h"
|
||||||
#include "ESPNetwork.h"
|
#include "ESPNetwork.h"
|
||||||
#include "Web.h"
|
#include "Web.h"
|
||||||
|
|
@ -230,7 +236,7 @@ void ESPNetwork::emitSockets(uint8_t num) {
|
||||||
this->emitHeap(num);
|
this->emitHeap(num);
|
||||||
}
|
}
|
||||||
void ESPNetwork::setConnected(conn_types_t connType) {
|
void ESPNetwork::setConnected(conn_types_t connType) {
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
this->connType = connType;
|
this->connType = connType;
|
||||||
this->connectTime = millis();
|
this->connectTime = millis();
|
||||||
connectRetries = 0;
|
connectRetries = 0;
|
||||||
|
|
@ -261,7 +267,7 @@ void ESPNetwork::setConnected(conn_types_t connType) {
|
||||||
#endif // CONFIG_IDF_TARGET_ESP32C6
|
#endif // CONFIG_IDF_TARGET_ESP32C6
|
||||||
// NET: Begin this in the startup.
|
// NET: Begin this in the startup.
|
||||||
//sockEmit.begin();
|
//sockEmit.begin();
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
|
|
||||||
if(this->connectAttempts == 1) {
|
if(this->connectAttempts == 1) {
|
||||||
if(this->connType == conn_types_t::wifi) {
|
if(this->connType == conn_types_t::wifi) {
|
||||||
|
|
@ -284,7 +290,7 @@ void ESPNetwork::setConnected(conn_types_t connType) {
|
||||||
settings.IP.dns1 = ETH.dnsIP(0);
|
settings.IP.dns1 = ETH.dnsIP(0);
|
||||||
settings.IP.dns2 = ETH.dnsIP(1);
|
settings.IP.dns2 = ETH.dnsIP(1);
|
||||||
}
|
}
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
JsonSockEvent *json = sockEmit.beginEmit("ethernet");
|
JsonSockEvent *json = sockEmit.beginEmit("ethernet");
|
||||||
json->beginObject();
|
json->beginObject();
|
||||||
json->addElem("connected", this->connected());
|
json->addElem("connected", this->connected());
|
||||||
|
|
@ -292,7 +298,7 @@ void ESPNetwork::setConnected(conn_types_t connType) {
|
||||||
json->addElem("fullduplex", ETH.fullDuplex());
|
json->addElem("fullduplex", ETH.fullDuplex());
|
||||||
json->endObject();
|
json->endObject();
|
||||||
sockEmit.endEmit();
|
sockEmit.endEmit();
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -326,7 +332,7 @@ void ESPNetwork::setConnected(conn_types_t connType) {
|
||||||
SSDP.setManufacturerURL(0, "https://github.com/rstrouse");
|
SSDP.setManufacturerURL(0, "https://github.com/rstrouse");
|
||||||
SSDP.setURL(0, "/");
|
SSDP.setURL(0, "/");
|
||||||
SSDP.setActive(0, true);
|
SSDP.setActive(0, true);
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
if(MDNS.begin(settings.hostname)) {
|
if(MDNS.begin(settings.hostname)) {
|
||||||
ESP_LOGI(TAG, "MDNS Responder Started: serverId=%s", settings.serverId);
|
ESP_LOGI(TAG, "MDNS Responder Started: serverId=%s", settings.serverId);
|
||||||
MDNS.addService("http", "tcp", 80);
|
MDNS.addService("http", "tcp", 80);
|
||||||
|
|
@ -339,11 +345,11 @@ void ESPNetwork::setConnected(conn_types_t connType) {
|
||||||
MDNS.addServiceTxt("espsomfy_rts", "tcp", "version", String(settings.fwVersion.name));
|
MDNS.addServiceTxt("espsomfy_rts", "tcp", "version", String(settings.fwVersion.name));
|
||||||
}
|
}
|
||||||
if(settings.ssdpBroadcast) {
|
if(settings.ssdpBroadcast) {
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
SSDP.begin();
|
SSDP.begin();
|
||||||
}
|
}
|
||||||
else if(SSDP.isStarted) SSDP.end();
|
else if(SSDP.isStarted) SSDP.end();
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
this->emitSockets();
|
this->emitSockets();
|
||||||
settings.printAvailHeap();
|
settings.printAvailHeap();
|
||||||
this->needsBroadcast = true;
|
this->needsBroadcast = true;
|
||||||
|
|
|
||||||
|
|
@ -4712,14 +4712,15 @@ void transceiver_config_t::load() {
|
||||||
this->SCKPin = 15;
|
this->SCKPin = 15;
|
||||||
this->CSNPin = 14;
|
this->CSNPin = 14;
|
||||||
break;
|
break;
|
||||||
#ifdef CHIP_ESP32C6
|
#ifdef CONFIG_IDF_TARGET_ESP32C6
|
||||||
case esp_chip_model_t::CHIP_ESP32C6:
|
case esp_chip_model_t::CHIP_ESP32C6:
|
||||||
this->TXPin = 13;
|
// Pinout applicable for the ESP32-C6-WROOM-1 module (ESP32-C6-DevKitC-1-N4)
|
||||||
this->RXPin = 12;
|
this->TXPin = 10;
|
||||||
this->MOSIPin = 16;
|
this->RXPin = 10;
|
||||||
this->MISOPin = 17;
|
this->MOSIPin = 7;
|
||||||
this->SCKPin = 15;
|
this->MISOPin = 2;
|
||||||
this->CSNPin = 14;
|
this->SCKPin = 6;
|
||||||
|
this->CSNPin = 0;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
|
|
@ -4878,15 +4879,6 @@ bool Transceiver::begin() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void Transceiver::loop() {
|
void Transceiver::loop() {
|
||||||
// Dispatch deferred frequency scan requests from the main task so that
|
|
||||||
// attachInterrupt/detachInterrupt cross-core IPCs don't race with WiFi.
|
|
||||||
if(_pendingScan >= 0) {
|
|
||||||
int8_t pending = _pendingScan;
|
|
||||||
_pendingScan = -1;
|
|
||||||
if(pending == 1) this->beginFrequencyScan();
|
|
||||||
else this->endFrequencyScan();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
somfy_rx_t rx;
|
somfy_rx_t rx;
|
||||||
if (noiseDetected && rxmode != 3 && this->config.noiseDetection) {
|
if (noiseDetected && rxmode != 3 && this->config.noiseDetection) {
|
||||||
if (millis() - noiseStart > 100) {
|
if (millis() - noiseStart > 100) {
|
||||||
|
|
|
||||||
|
|
@ -490,10 +490,6 @@ class Transceiver {
|
||||||
bool _received = false;
|
bool _received = false;
|
||||||
somfy_frame_t frame;
|
somfy_frame_t frame;
|
||||||
public:
|
public:
|
||||||
// -1 = none pending, 1 = beginFrequencyScan pending, 0 = endFrequencyScan pending.
|
|
||||||
// Set from the async_tcp task; consumed by loop() on the main task to avoid
|
|
||||||
// concurrent cross-core IPC races with the WiFi stack (EXCCAUSE_LOAD_PROHIBITED).
|
|
||||||
volatile int8_t _pendingScan = -1;
|
|
||||||
transceiver_config_t config;
|
transceiver_config_t config;
|
||||||
bool printBuffer = false;
|
bool printBuffer = false;
|
||||||
//bool toJSON(JsonObject& obj);
|
//bool toJSON(JsonObject& obj);
|
||||||
|
|
|
||||||
|
|
@ -2406,7 +2406,7 @@ void Web::begin() {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
asyncServer.on("/beginFrequencyScan", HTTP_GET, [](AsyncWebServerRequest *request) {
|
asyncServer.on("/beginFrequencyScan", HTTP_GET, [](AsyncWebServerRequest *request) {
|
||||||
somfy.transceiver._pendingScan = 1; // deferred to main task — see Transceiver::loop()
|
somfy.transceiver.beginFrequencyScan();
|
||||||
AsyncJsonResp resp;
|
AsyncJsonResp resp;
|
||||||
resp.beginResponse(request, g_async_content, sizeof(g_async_content));
|
resp.beginResponse(request, g_async_content, sizeof(g_async_content));
|
||||||
resp.beginObject();
|
resp.beginObject();
|
||||||
|
|
@ -2416,7 +2416,7 @@ void Web::begin() {
|
||||||
});
|
});
|
||||||
|
|
||||||
asyncServer.on("/endFrequencyScan", HTTP_GET, [](AsyncWebServerRequest *request) {
|
asyncServer.on("/endFrequencyScan", HTTP_GET, [](AsyncWebServerRequest *request) {
|
||||||
somfy.transceiver._pendingScan = 0; // deferred to main task — see Transceiver::loop()
|
somfy.transceiver.endFrequencyScan();
|
||||||
AsyncJsonResp resp;
|
AsyncJsonResp resp;
|
||||||
resp.beginResponse(request, g_async_content, sizeof(g_async_content));
|
resp.beginResponse(request, g_async_content, sizeof(g_async_content));
|
||||||
resp.beginObject();
|
resp.beginObject();
|
||||||
|
|
|
||||||
2
src/idf_component.yml
Normal file
2
src/idf_component.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
dependencies:
|
||||||
|
idf: '>=5.1'
|
||||||
Loading…
Add table
Add a link
Reference in a new issue