Hi everyone,
I am having a simple siren automation on ESP32 Wroom. I want to run the siren for a minute or a little longer. Five seconds after starting the script ESP32 reboots. The logs don’t have much useful information for debugging.
output:
- platform: ledc
pin: 13
id: buzzer
switch:
- platform: output
output: buzzer
name: "Door Alarm"
script:
- id: siren
then:
- lambda: |-
auto b = id(buzzer);
b->turn_on();
b->set_level(0.1);
for (int i = 0; i < 10; i++) {
b->update_frequency(2000);
delay(500);
b->update_frequency(2500);
delay(500);
}
b->turn_off();
binary_sensor:
- platform: gpio
pin:
number: 4
name: "Door opened"
device_class: tamper
on_state:
then:
- script.execute: siren
[20:29:59][V][ledc.output:114]: Setting duty: 65535 on channel 0
[20:29:59][V][ledc.output:114]: Setting duty: 6554 on channel 0
[20:29:59][D][ledc.output:055]: Calculating resolution bit-depth for frequency 2000.000000
[20:29:59][D][ledc.output:060]: Resolution calculated as 15
[20:29:59][V][ledc.output:191]: Using Arduino API - Trying to define channel, frequency and bit depth...
[20:29:59][V][ledc.output:198]: Trying initialize channel 0 with frequency 2000.0 and bit depth of 15...
[20:29:59][V][ledc.output:203]: Configured frequency: 1996 with bit depth: 15
[20:29:59][V][ledc.output:114]: Setting duty: 3277 on channel 0
[20:30:00][D][ledc.output:055]: Calculating resolution bit-depth for frequency 2500.000000
[20:30:00][D][ledc.output:060]: Resolution calculated as 14
[20:30:00][V][ledc.output:191]: Using Arduino API - Trying to define channel, frequency and bit depth...
[20:30:00][V][ledc.output:198]: Trying initialize channel 0 with frequency 2500.0 and bit depth of 14...
[20:30:00][V][ledc.output:203]: Configured frequency: 2500 with bit depth: 14
[20:30:00][V][ledc.output:114]: Setting duty: 1638 on channel 0
[20:30:00][D][ledc.output:055]: Calculating resolution bit-depth for frequency 2000.000000
[20:30:00][D][ledc.output:060]: Resolution calculated as 15
[20:30:01][V][ledc.output:191]: Using Arduino API - Trying to define channel, frequency and bit depth...
[20:30:01][V][ledc.output:198]: Trying initialize channel 0 with frequency 2000.0 and bit depth of 15...
[20:30:01][V][ledc.output:203]: Configured frequency: 1996 with bit depth: 15
[20:30:01][V][ledc.output:114]: Setting duty: 3277 on channel 0
[20:30:01][D][ledc.output:055]: Calculating resolution bit-depth for frequency 2500.000000
[20:30:01][D][ledc.output:060]: Resolution calculated as 14
[20:30:01][V][ledc.output:191]: Using Arduino API - Trying to define channel, frequency and bit depth...
[20:30:01][V][ledc.output:198]: Trying initialize channel 0 with frequency 2500.0 and bit depth of 14...
[20:30:01][V][ledc.output:203]: Configured frequency: 2500 with bit depth: 14
[20:30:01][V][ledc.output:114]: Setting duty: 1638 on channel 0
[20:30:02][D][ledc.output:055]: Calculating resolution bit-depth for frequency 2000.000000
[20:30:02][D][ledc.output:060]: Resolution calculated as 15
[20:30:02][V][ledc.output:191]: Using Arduino API - Trying to define channel, frequency and bit depth...
[20:30:02][V][ledc.output:198]: Trying initialize channel 0 with frequency 2000.0 and bit depth of 15...
[20:30:02][V][ledc.output:203]: Configured frequency: 1996 with bit depth: 15
[20:30:02][V][ledc.output:114]: Setting duty: 3277 on channel 0
[20:30:02][D][ledc.output:055]: Calculating resolution bit-depth for frequency 2500.000000
[20:30:02][D][ledc.output:060]: Resolution calculated as 14
[20:30:02][V][ledc.output:191]: Using Arduino API - Trying to define channel, frequency and bit depth...
[20:30:02][V][ledc.output:198]: Trying initialize channel 0 with frequency 2500.0 and bit depth of 14...
[20:30:02][V][ledc.output:203]: Configured frequency: 2500 with bit depth: 14
[20:30:02][V][ledc.output:114]: Setting duty: 1638 on channel 0
[20:30:03][D][ledc.output:055]: Calculating resolution bit-depth for frequency 2000.000000
[20:30:03][D][ledc.output:060]: Resolution calculated as 15
[20:30:03][V][ledc.output:191]: Using Arduino API - Trying to define channel, frequency and bit depth...
[20:30:03][V][ledc.output:198]: Trying initialize channel 0 with frequency 2000.0 and bit depth of 15...
[20:30:03][V][ledc.output:203]: Configured frequency: 1996 with bit depth: 15
[20:30:03][V][ledc.output:114]: Setting duty: 3277 on channel 0
[20:30:03][D][ledc.output:055]: Calculating resolution bit-depth for frequency 2500.000000
[20:30:03][D][ledc.output:060]: Resolution calculated as 14
[20:30:03][V][ledc.output:191]: Using Arduino API - Trying to define channel, frequency and bit depth...
[20:30:03][V][ledc.output:198]: Trying initialize channel 0 with frequency 2500.0 and bit depth of 14...
[20:30:03][V][ledc.output:203]: Configured frequency: 2500 with bit depth: 14
[20:30:03][V][ledc.output:114]: Setting duty: 1638 on channel 0
[20:30:04][D][ledc.output:055]: Calculating resolution bit-depth for frequency 2000.000000
[20:30:04][D][ledc.output:060]: Resolution calculated as 15
[20:30:04][V][ledc.output:191]: Using Arduino API - Trying to define channel, frequency and bit depth...
[20:30:04][V][ledc.output:198]: Trying initialize channel 0 with frequency 2000.0 and bit depth of 15...
[20:30:04][V][ledc.output:203]: Configured frequency: 1996 with bit depth: 15
[20:30:04][V][ledc.output:114]: Setting duty: 3277 on channel 0
[20:30:04][D][ledc.output:055]: Calculating resolution bit-depth for frequency 2500.000000
[20:30:04][D][ledc.output:060]: Resolution calculated as 14
[20:30:04][V][ledc.output:191]: Using Arduino API - Trying to define channel, frequency and bit depth...
[20:30:04][V][ledc.output:198]: Trying initialize channel 0 with frequency 2500.0 and bit depth of 14...
[20:30:04][V][ledc.output:203]: Configured frequency: 2500 with bit depth: 14
[20:30:04][V][ledc.output:114]: Setting duty: 1638 on channel 0
WARNING door-alarm @ 192.168.4.225: Connection error occurred: [Errno 104] Connection reset by peer
INFO Processing unexpected disconnect from ESPHome API for door-alarm @ 192.168.4.225
WARNING Disconnected from API
INFO Successfully connected to door-alarm @ 192.168.4.225 in 0.009s
INFO Successful handshake with door-alarm @ 192.168.4.225 in 0.111s