Compare commits
No commits in common. "08c47f00f8076aff1a00eb1bd70f04db9a6a6551" and "d76b897eb2586268ae119e697c533cfa0bc85ba8" have entirely different histories.
08c47f00f8
...
d76b897eb2
|
|
@ -1,65 +1 @@
|
||||||
**/build
|
**/build
|
||||||
|
|
||||||
# Zephyr build directories
|
|
||||||
build/
|
|
||||||
build-*/
|
|
||||||
*/build/
|
|
||||||
**/build/
|
|
||||||
|
|
||||||
# Zephyr out-of-tree build directories
|
|
||||||
out-of-tree-build/
|
|
||||||
|
|
||||||
# Files generated by the build system
|
|
||||||
zephyr.elf
|
|
||||||
zephyr.bin
|
|
||||||
zephyr.hex
|
|
||||||
zephyr.map
|
|
||||||
zephyr.strip
|
|
||||||
zephyr.lst
|
|
||||||
zephyr.asm
|
|
||||||
zephyr.stat
|
|
||||||
zephyr.a
|
|
||||||
zephyr.o
|
|
||||||
*.o
|
|
||||||
*.a
|
|
||||||
*.so
|
|
||||||
*.so.*
|
|
||||||
*.dll
|
|
||||||
*.exe
|
|
||||||
|
|
||||||
# Cmake
|
|
||||||
CMakeCache.txt
|
|
||||||
CMakeFiles/
|
|
||||||
cmake_install.cmake
|
|
||||||
CTestTestfile.cmake
|
|
||||||
compile_commands.json
|
|
||||||
|
|
||||||
# Kconfig generated files
|
|
||||||
.config
|
|
||||||
.config.old
|
|
||||||
autoconf.h
|
|
||||||
|
|
||||||
# Doxygen
|
|
||||||
doxygen/
|
|
||||||
|
|
||||||
# west
|
|
||||||
.west/
|
|
||||||
west.yml.bak
|
|
||||||
|
|
||||||
# Editor-specific files
|
|
||||||
.vscode/
|
|
||||||
.idea/
|
|
||||||
*.swp
|
|
||||||
*~
|
|
||||||
*.bak
|
|
||||||
*.orig
|
|
||||||
|
|
||||||
# Python
|
|
||||||
__pycache__/
|
|
||||||
*.pyc
|
|
||||||
|
|
||||||
# Mac OS X
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Windows
|
|
||||||
Thumbs.db
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 6e669cfc4e400c3ef6e55c16401788ce0d804577
|
|
||||||
|
|
@ -7,12 +7,12 @@
|
||||||
compatible = "st,vnd7050aj";
|
compatible = "st,vnd7050aj";
|
||||||
status = "okay";
|
status = "okay";
|
||||||
|
|
||||||
input0-gpios = <&gpiob 3 GPIO_ACTIVE_HIGH>;
|
input0-gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>;
|
||||||
input1-gpios = <&gpiob 4 GPIO_ACTIVE_HIGH>;
|
input1-gpios = <&gpiob 9 GPIO_ACTIVE_HIGH>;
|
||||||
select0-gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>;
|
select0-gpios = <&gpiob 5 GPIO_ACTIVE_HIGH>;
|
||||||
select1-gpios = <&gpiob 9 GPIO_ACTIVE_HIGH>;
|
select1-gpios = <&gpiob 6 GPIO_ACTIVE_HIGH>;
|
||||||
sense-enable-gpios = <&gpiob 6 GPIO_ACTIVE_HIGH>;
|
sense-enable-gpios = <&gpiob 4 GPIO_ACTIVE_HIGH>;
|
||||||
fault-reset-gpios = <&gpiob 5 GPIO_ACTIVE_LOW>;
|
fault-reset-gpios = <&gpiob 3 GPIO_ACTIVE_LOW>;
|
||||||
io-channels = <&adc1 1>;
|
io-channels = <&adc1 1>;
|
||||||
r-sense-ohms = <1500>;
|
r-sense-ohms = <1500>;
|
||||||
k-vcc = <4000>;
|
k-vcc = <4000>;
|
||||||
|
|
|
||||||
|
|
@ -1,106 +0,0 @@
|
||||||
# ===================================================================
|
|
||||||
# ESPHome Configuration
|
|
||||||
# CAN-Bus Master für ein Bewässerungssystem auf Basis des ESP32-C6
|
|
||||||
#
|
|
||||||
# Version 10: Finale Korrektur der Lambda-Signatur gemäß Dokumentation
|
|
||||||
# ===================================================================
|
|
||||||
|
|
||||||
esphome:
|
|
||||||
name: can-bridge
|
|
||||||
friendly_name: Irrigation can bridge
|
|
||||||
|
|
||||||
esp32:
|
|
||||||
board: esp32-c6-devkitm-1
|
|
||||||
framework:
|
|
||||||
type: esp-idf # Erforderlich für den ESP32-C6
|
|
||||||
|
|
||||||
# --- Netzwerk & Sicherheit ---
|
|
||||||
wifi:
|
|
||||||
ssid: !secret wifi_ssid
|
|
||||||
password: !secret wifi_password
|
|
||||||
fast_connect: true
|
|
||||||
|
|
||||||
api:
|
|
||||||
encryption:
|
|
||||||
key: !secret api_key
|
|
||||||
|
|
||||||
ota:
|
|
||||||
platform: esphome
|
|
||||||
password: !secret ota_password
|
|
||||||
|
|
||||||
logger:
|
|
||||||
|
|
||||||
web_server:
|
|
||||||
|
|
||||||
# --- Globale Variablen ---
|
|
||||||
globals:
|
|
||||||
- id: ventil_2_can_state
|
|
||||||
type: int
|
|
||||||
initial_value: '0' # Startet als "geschlossen"
|
|
||||||
|
|
||||||
# --- CAN-Bus Konfiguration ---
|
|
||||||
canbus:
|
|
||||||
- platform: esp32_can
|
|
||||||
id: my_can_bus
|
|
||||||
tx_pin: GPIO5
|
|
||||||
rx_pin: GPIO4
|
|
||||||
bit_rate: 125kbps
|
|
||||||
can_id: 0x000 # Erforderlich, um Parser-Fehler zu beheben.
|
|
||||||
on_frame:
|
|
||||||
# Horcht nur auf die Statusmeldung von Knoten 2 (ID 0x422)
|
|
||||||
- can_id: 0x422
|
|
||||||
then:
|
|
||||||
- lambda: |-
|
|
||||||
if (x.size() < 1) {
|
|
||||||
ESP_LOGW("on_can_frame", "Received empty Frame for ID 0x422");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int received_state = x[0];
|
|
||||||
id(ventil_2_can_state) = received_state;
|
|
||||||
ESP_LOGD("on_can_frame", "Received state from Valve 2: %i", received_state);
|
|
||||||
- valve.template.publish:
|
|
||||||
id: ventil_2
|
|
||||||
current_operation: !lambda |-
|
|
||||||
int state = id(ventil_2_can_state);
|
|
||||||
if (state == 2) {
|
|
||||||
return VALVE_OPERATION_OPENING;
|
|
||||||
} else if (state == 3) {
|
|
||||||
return VALVE_OPERATION_CLOSING;
|
|
||||||
} else {
|
|
||||||
return VALVE_OPERATION_IDLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
# --- Home Assistant Entitäten ---
|
|
||||||
valve:
|
|
||||||
- platform: template
|
|
||||||
name: "Ventil 2"
|
|
||||||
id: ventil_2
|
|
||||||
|
|
||||||
# Diese Lambda meldet nur den binären End-Zustand (offen/geschlossen)
|
|
||||||
lambda: |-
|
|
||||||
if (id(ventil_2_can_state) == 0) {
|
|
||||||
return VALVE_CLOSED;
|
|
||||||
} else if (id(ventil_2_can_state) == 1) {
|
|
||||||
return VALVE_OPEN;
|
|
||||||
} else {
|
|
||||||
return NAN;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Aktionen zum Steuern des Ventils
|
|
||||||
open_action:
|
|
||||||
- canbus.send:
|
|
||||||
canbus_id: my_can_bus
|
|
||||||
can_id: 0x210
|
|
||||||
data: [0x02, 0x01]
|
|
||||||
|
|
||||||
close_action:
|
|
||||||
- canbus.send:
|
|
||||||
canbus_id: my_can_bus
|
|
||||||
can_id: 0x210
|
|
||||||
data: [0x02, 0x00]
|
|
||||||
|
|
||||||
stop_action:
|
|
||||||
- canbus.send:
|
|
||||||
canbus_id: my_can_bus
|
|
||||||
can_id: 0x210
|
|
||||||
data: [0x02, 0x03]
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
source /home/edi/zephyrproject/.venv/bin/activate && source /home/edi/zephyrproject/zephyr/zephyr-env.sh && rm -r build ;west build -p always -b esp32c6_devkitc/esp32c6/hpcore apps/gateway -D CMAKE_OBJCOPY=/home/edi/zephyr-sdk-0.17.1/riscv64-zephyr-elf/bin/riscv64-zephyr-elf-objcopy;
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
source /home/edi/zephyrproject/.venv/bin/activate && \
|
||||||
|
source /home/edi/zephyrproject/zephyr/zephyr-env.sh && \
|
||||||
|
rm -r build ;west build --sysbuild -p always -b esp32c6_devkitc/esp32c6/hpcore apps/gateway -D CMAKE_OBJCOPY=/home/edi/zephyr-sdk-0.17.1/riscv64-zephyr-elf/bin/riscv64-zephyr-elf-objcopy;
|
||||||
Binary file not shown.
Loading…
Reference in New Issue