Dilbert66 / esphome-vistaECP

This is an implementation of an ESPHOME custom component and ESP Library to interface directly to a Safewatch/Honeywell/Ademco Vista 15/20 alarm system using the ECP interface and very inexpensive ESP8266/ESP32 modules .
GNU Lesser General Public License v2.1
129 stars 21 forks source link

Building, but not booting. #52

Closed knifesk closed 3 years ago

knifesk commented 3 years ago

Hey guys, I had to rebuild my HomeAssistant instance and finally I decided to give ESPHome a Try... this is like the 10th time I rebuild the YAML, folder, wipe, clean and try again with the same results...

I have the NodeMCU connected via USB into the home asssitant pc, and I flashed via USB.. while it's building, flashing and starting.. the latter fails 10 times pretty quick and then the chip goes into safe mode. I think the lib is crashing.. maybe it's becase new versions of arduino or ESPHome? I'm a pretty experienced developer, but C++ and low level things are not my thing... so, I can't quite make heads or tails of this.

I tried to do the least modifictaions possible and still couldn't get it to work... Here's the log of the flash/boot process.. any hints are appreciated.

INFO Running:  platformio run -d /config/esphome/vistaalarm
Processing vistaalarm (board: nodemcuv2; framework: arduino; platform: platformio/espressif8266@2.6.2)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20704.0 (2.7.4) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - toolchain-xtensa 2.40802.200502 (4.8.2)
Library Manager: Installing Update
Library Manager: Already installed, built-in library
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/ECPSoftwareSerial.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/debug/vistaPrint.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/api/api_connection.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/api/api_pb2.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/api/api_pb2_service.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/api/api_server.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/api/list_entities.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/api/proto.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/api/subscribe_state.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/api/user_services.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/api/util.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/binary_sensor/automation.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/binary_sensor/binary_sensor.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/binary_sensor/filter.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/logger/logger.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/ota/ota_component.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/restart/restart_switch.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/switch/automation.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/switch/switch.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/template/binary_sensor/template_binary_sensor.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/template/switch/template_switch.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/template/text_sensor/template_text_sensor.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/text_sensor/text_sensor.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/wifi/wifi_component.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/wifi/wifi_component_esp32.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/components/wifi/wifi_component_esp8266.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/core/application.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/core/application_esp32.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/core/application_esp8266.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/core/color.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/core/component.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/core/controller.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/core/esphal.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/core/helpers.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/core/log.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/core/preferences.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/core/scheduler.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/esphome/core/util.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/main.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/src/vista.cpp.o
Generating LD script /data/vistaalarm/.pioenvs/vistaalarm/ld/local.eagle.app.v6.common.ld
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/BearSSLHelpers.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/CertStoreBearSSL.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/ESP8266WiFi.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/ESP8266WiFiAP.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/ESP8266WiFiGratuitous.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/ESP8266WiFiMulti.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/ESP8266WiFiSTA.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/ESP8266WiFiScan.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/WiFiClient.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/WiFiServer.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/ESP8266WiFi/WiFiUdp.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib189/ESPAsyncTCP-esphome/AsyncPrinter.cpp.o
Archiving /data/vistaalarm/.pioenvs/vistaalarm/lib4d9/libESP8266WiFi.a
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib189/ESPAsyncTCP-esphome/ESPAsyncTCP.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib189/ESPAsyncTCP-esphome/ESPAsyncTCPbuffer.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib189/ESPAsyncTCP-esphome/SyncClient.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib189/ESPAsyncTCP-esphome/tcp_axtls.c.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib0d3/ESP8266mDNS/ESP8266mDNS.cpp.o
Archiving /data/vistaalarm/.pioenvs/vistaalarm/lib189/libESPAsyncTCP-esphome.a
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib0d3/ESP8266mDNS/ESP8266mDNS_Legacy.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib0d3/ESP8266mDNS/LEAmDNS.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib0d3/ESP8266mDNS/LEAmDNS_Control.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib0d3/ESP8266mDNS/LEAmDNS_Helpers.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib0d3/ESP8266mDNS/LEAmDNS_Structs.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/lib0d3/ESP8266mDNS/LEAmDNS_Transfer.cpp.o
Archiving /data/vistaalarm/.pioenvs/vistaalarm/libFrameworkArduinoVariant.a
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/Crypto.cpp.o
Archiving /data/vistaalarm/.pioenvs/vistaalarm/lib0d3/libESP8266mDNS.a
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/Esp-frag.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/Esp-version.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/Esp.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/FS.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/FSnoop.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/HardwareSerial.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/IPAddress.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/MD5Builder.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/Print.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/Schedule.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/StackThunk.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/Stream.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/StreamString.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/Tone.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/TypeConversion.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/Updater.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/WMath.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/WString.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/abi.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/base64.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/cbuf.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/cont.S.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/cont_util.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_app_entry_noextra4k.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_eboot_command.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_features.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_flash_quirks.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_flash_utils.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_i2s.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_main.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_noniso.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_phy.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_postmortem.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_si2c.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_sigma_delta.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_spi_utils.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_timer.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_waveform.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_wiring.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_wiring_analog.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_wiring_digital.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_wiring_pulse.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_wiring_pwm.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/core_esp8266_wiring_shift.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/crc32.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/debug.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/flash_hal.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/gdb_hooks.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/heap.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/libb64/cdecode.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/libb64/cencode.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/libc_replacements.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/sntp-lwip2.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/spiffs/spiffs_cache.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/spiffs/spiffs_check.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/spiffs/spiffs_gc.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/spiffs/spiffs_hydrogen.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/spiffs/spiffs_nucleus.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/spiffs_api.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/sqrt32.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/time.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/uart.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/umm_malloc/umm_info.c.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/umm_malloc/umm_integrity.c.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/umm_malloc/umm_local.c.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/umm_malloc/umm_malloc.cpp.o
Compiling /data/vistaalarm/.pioenvs/vistaalarm/FrameworkArduino/umm_malloc/umm_poison.c.o
Archiving /data/vistaalarm/.pioenvs/vistaalarm/libFrameworkArduino.a
Linking /data/vistaalarm/.pioenvs/vistaalarm/firmware.elf
Building /data/vistaalarm/.pioenvs/vistaalarm/firmware.bin
Retrieving maximum program size /data/vistaalarm/.pioenvs/vistaalarm/firmware.elf
Checking size /data/vistaalarm/.pioenvs/vistaalarm/firmware.elf
RAM:   [====      ]  43.9% (used 35924 bytes from 81920 bytes)
Flash: [====      ]  38.3% (used 399912 bytes from 1044464 bytes)
Creating BIN file "/data/vistaalarm/.pioenvs/vistaalarm/firmware.bin" using "/root/.platformio/packages/framework-arduinoespressif8266/bootloaders/eboot/eboot.elf" and "/data/vistaalarm/.pioenvs/vistaalarm/firmware.elf"
========================= [SUCCESS] Took 21.41 seconds =========================
INFO Successfully compiled program.
INFO Running:  esptool.py --before default_reset --after hard_reset --baud 460800 --chip esp8266 --port /dev/ttyUSB0 write_flash 0x0 /data/vistaalarm/.pioenvs/vistaalarm/firmware.bin
esptool.py v3.1
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: a4:cf:12:ef:8a:5a
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00062fff...
Compressed 404064 bytes to 277927...
Wrote 404064 bytes (277927 compressed) at 0x00000000 in 6.4 seconds (effective 506.8 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
[21:02:22][I][logger:170]: Log initialized
[21:02:22][C][ota:378]: There have been 0 suspected unsuccessful boot attempts.
[21:02:22][I][app:029]: Running through setup()...
[21:02:22][D][text_sensor:015]: 'vistaalarm System Status': Sending state 'online'
[21:02:22][D][binary_sensor:036]: 'vistaalarm AC': Sending state ON
[21:02:22][D][text_sensor:015]: 'vistaalarm Front door': Sending state 'C'
[21:02:22][D][text_sensor:015]: 'vistaalarm Garage door': Sending state 'C'
[21:02:22][D][text_sensor:015]: 'vistaalarm Back door': Sending state 'C'
[21:02:22][D][text_sensor:015]: 'vistaalarm Living room window': Sending state 'C'
[21:02:22][D][text_sensor:015]: 'vistaalarm Dining room window': Sending state 'C'
[21:02:22][D][text_sensor:015]: 'vistaalarm Family room window LF': Sending state 'C'
[21:02:22][D][text_sensor:015]: 'vistaalarm Family room window RF': Sending state 'C'
[21:02:22][D][text_sensor:015]: 'vistaalarm Basement windows': Sending state 'C'
[21:02:22][D][text_sensor:015]: 'vistaalarm Basement windows9': Sending state 'C'
[21:02:22][D][text_sensor:015]: 'vistaalarm Basement windows10': Sending state 'C'
[21:02:22][D][text_sensor:015]: 'vistaalarm zone 17': Sending state 'C'
[21:02:22][C][wifi:037]: Setting up WiFi...
[21:02:22][D][wifi:380]: Starting scan...
[21:02:22]
[21:02:22]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[21:02:22]
[21:02:22]Exception (28):
WARNING Exception type: Access to invalid address: LOAD (wild pointer?)
[21:02:22]epc1=0x40211a71 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
INFO Need to fetch platformio IDE-data, please stand by
INFO Running:  platformio run -d /config/esphome/vistaalarm -t idedata
WARNING Decoded 0x40211a71: Vista::getExtBytes()
[21:02:22]
[21:02:22]>>>stack>>>
WARNING Found stack trace! Trying to decode it
[21:02:22]
[21:02:22]ctx: cont
[21:02:22]sp: 3ffffb40 end: 3fffffc0 offset: 0190
[21:02:22]3ffffcd0:  00000000 4bc6a7f0 000000b4 00000000  
[21:02:22]3ffffce0:  3fff38dc 3fff0188 3fff0188 40211c09  
WARNING Decoded 0x40211c09: Vista::handle()
[21:02:22]3ffffcf0:  3ffe88a7 3fff1830 40100b42 84189374  
WARNING Decoded 0x40100b42: millis
[21:02:22]3ffffd00:  00000000 00000000 00000000 00000000  
[21:02:22]3ffffd10:  3fff38dc 3fff0188 3fff35dc 4020d532  
WARNING Decoded 0x4020d532: vistaECPHome::update()
[21:02:22]3ffffd20:  00000000 3fff402c 3ffffd60 3fff4f50  
[21:02:22]3ffffd30:  00000020 3fff4f0c 00000020 401014db  
WARNING Decoded 0x401014db: free
[21:02:22]3ffffd40:  00000000 4bc6a7f0 000000b4 3fff00e4  
[21:02:22]3ffffd50:  00000004 3fff402c 3fff00f0 40226a19  
WARNING Decoded 0x40226a19: operator delete(void*) at /workdir/repo/gcc/libstdc++-v3/libsupc++/del_op.cc:48
[21:02:22]3ffffd60:  00000000 3fff4f0c 3fff00f0 4020c258  
WARNING Decoded 0x4020c258: void std::vector<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >, std::allocator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > > >::_M_emplace_back_aux<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > >(std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >&&)
[21:02:22]3ffffd70:  00000002 00000003 3fff00e4 00000000  
[21:02:22]3ffffd80:  3fff4df4 3fff402c 3fff00e4 4021d8ec  
WARNING Decoded 0x4021d8ec: std::_Function_handler<void (), esphome::PollingComponent::call_setup()::{lambda()#1}>::_M_invoke(std::_Any_data const&) at component.cpp
[21:02:22]3ffffd90:  3fff3b0c 3fff402c 3fff00e4 40100570  
WARNING Decoded 0x40100570: esphome::Scheduler::call()
[21:02:22]3ffffda0:  3fff3088 3fff4e9c 3fff3034 3fff4e9c  
[21:02:22]3ffffdb0:  00000000 0000002a 00000020 00000000  
[21:02:22]3ffffdc0:  000000b4 3fff4074 0000ea60 40209fd9  
WARNING Decoded 0x40209fd9: std::pair<esphome::Component**, int> std::get_temporary_buffer<esphome::Component*>(int)
[21:02:22]3ffffdd0:  3fff4e9c 0000002b 3fff00e4 00000100  
[21:02:22]3ffffde0:  3fff173c 0000002a 3fff00e4 4020af7a  
WARNING Decoded 0x4020af7a: esphome::Application::setup()
[21:02:22]3ffffdf0:  3fff4e9c 0000002b 00000020 40101512  
WARNING Decoded 0x40101512: malloc
[21:02:22]3ffffe00:  00000100 3fff2fdc 3fff3088 4020a320  
WARNING Decoded 0x4020a320: esphome::Application::register_component_(esphome::Component*)
[21:02:22]3ffffe10:  3fff3a8c 00000000 00000030 3fff029c  
[21:02:22]3ffffe20:  3fff00e4 3fff3a8c 00000001 4020ffd4  
WARNING Decoded 0x4020ffd4: setup
[21:02:22]3ffffe30:  3fff1910 00000000 00000000 3fff1930  
[21:02:22]3ffffe40:  00000000 00000000 00000000 4021ef98  
WARNING Decoded 0x4021ef98: precache
[21:02:22]3ffffe50:  00000000 4021ef98 00000000 4021ef98  
WARNING Decoded 0x4021ef98: precache
WARNING Decoded 0x4021ef98: precache
[21:02:22]3ffffe60:  00000000 4021ef98 00000000 4021ef98  
WARNING Decoded 0x4021ef98: precache
WARNING Decoded 0x4021ef98: precache
[21:02:22]3ffffe70:  00000000 00000000 3fff1880 00000000  
[21:02:22]3ffffe80:  00000000 3fff18a0 00000000 00000000  
[21:02:22]3ffffe90:  00000000 4021ef98 00000000 4021ef98  
WARNING Decoded 0x4021ef98: precache
WARNING Decoded 0x4021ef98: precache
[21:02:22]3ffffea0:  00000000 4021ef98 00000000 4021ef98  
WARNING Decoded 0x4021ef98: precache
WARNING Decoded 0x4021ef98: precache
[21:02:22]3ffffeb0:  00000000 4021ef98 00000000 00000000  
WARNING Decoded 0x4021ef98: precache
[21:02:23]3ffffec0:  3fff27f4 3fff27f8 3fff27f8 4020e594  
WARNING Decoded 0x4020e594: std::_Function_handler<std::vector<esphome::Component*, std::allocator<esphome::Component*> > (), setup::{lambda()#3}>::_M_invoke(std::_Any_data const&) at main.cpp
[21:02:23]3ffffed0:  3fff2c1c 3fff2c20 3fff2c20 3fffff78  
[21:02:23]3ffffee0:  00000001 feefeffe feefeffe 3fff34d4  
[21:02:23]3ffffef0:  3fff345c 3fff32ac 3fff3204 3fff3154  
[21:02:23]3fffff00:  3fff23d4 3fff2f24 3fff2e9c 3fff2de4  
[21:02:23]3fffff10:  3fff2d2c 3fff2c5c 3fff2b94 3fff2acc  
[21:02:23]3fffff20:  3fff29dc 3fff2924 3fff284c 3fff277c  
[21:02:23]3fffff30:  3fff26d4 3fff262c 3fff2590 3fff24e8  
[21:02:23]3fffff40:  3fff2448 3fff2330 3fff2270 3fff21b8  
[21:02:23]3fffff50:  3fff20f8 3fff2030 3fff1f70 3fff1ec8  
[21:02:23]3fffff60:  3fff1e70 3fff1d80 3fff1cc0 3fff1c18  
[21:02:23]3fffff70:  3fff1b48 3fff1aa0 3fff3574 feefeffe  
[21:02:23]3fffff80:  3fff34d4 00000090 000000a0 feefeffe  
[21:02:23]3fffff90:  feefeffe feefeffe feefeffe 3fff05d4  
[21:02:23]3fffffa0:  3fffdad0 00000000 3fff0594 4021b174  
WARNING Decoded 0x4021b174: loop_wrapper() at core_esp8266_main.cpp
[21:02:23]3fffffb0:  feefeffe feefeffe 3ffe84f4 401009b9  
WARNING Decoded 0x401009b9: cont_wrapper
[21:02:23]<<<stack<<<
[21:02:23]
[21:02:23]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Dilbert66 commented 3 years ago

Interesting. Might be an effect of the esphome latest version. I'll upgrade and try it out. Your debug code is helpful as it points to the getextbytes where the error occurs. I'll look into it as well

Dilbert66 commented 3 years ago

I do see one issue. I have a bug in my bounds checking for an arrary index (not compensating for an increment) so if the receive buffer goes beyond the initialized array, this could cause an error. Don't think it would create the error above but it all depends on what is stored at the address above the array that is being overwritten.

Edit: Never mind. The code is correct. Brain fart.

This still doesnt explain why you are getting that error since the array is large enough in normal operation not to overflow. Perhaps you are getting spurious data. Is your wiring correct to the alarm system? It could also be related to an issue with the 8266 new library itself. It works fine on the esp32 which I just tried now. I will have to switch chips and try out the esp8266 later.

Edit: did find an invalid array bounds check so fixed it and pushed to dev. Don't think it's your issue but who knows.

knifesk commented 3 years ago

I'm not even reaching the point of connecting the esp to the panel. I already had everything installed and I need to remove the module from the socket in order to flash it... I tried connecting it after it went into safe mode, but I couldn't debug it while it's up in the cabinet. Obviously I couldn't make it work, so I went back to the computer and tried again... Shouldn't it boot anyway if it's not connected to the panel?

On Thu, Aug 19, 2021, 21:42 Alain Turbide @.***> wrote:

I do see one issue. I have a bug in my bounds checking for an arrary index (not compensating for an increment) so if the receive buffer goes beyond the initialized array, this could cause an error. Don't think it would create the error above but it all depends on what is stored at the address above the array that is being overwritten. Anyhow, I will fix that.

This still doesnt explain why you are getting that error since the array is large enough in normal operation not to overflow. Perhaps you are getting spurious data. Is your wiring correct to the alarm system? It could also be related to an issue with the 8266 itself. It works fine on the esp32 which I just tried now. I will have to switch chips and try out the esp8266 later.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Dilbert66/esphome-vistaECP/issues/52#issuecomment-902345965, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRO3FM7N2PCIKTRLK4MQDT5WQF5ANCNFSM5CPH7DLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

Dilbert66 commented 3 years ago

It will boot fine without panel connection. I updated my test platform to the latest epshome version and can't see any issues. At this point I really don't have a solution to offer.

Dilbert66 commented 3 years ago

Can you post your yaml config?

knifesk commented 3 years ago

First thing of all: Thanks for your time man! I really appreciate you take time off your own in order to help me.

I'll attach the YAML at the end. At first I added a couple zones (11 and 12) and also removed 1...3 and 5..8 (the wired ones) since my entire setups is wireless and the only wired sensor I have isn't wired yet, but I'm planning to wire it at z4.... as things were not running at all I restored the entire yaml to the original one and tried to change as little as possible, but it still not running... This is the last version I tried before reaching for help. I'm gonna give it another try with a freshly cloned repo... I'll report back in a couple minutes..

As a sidenote: thing was working just fine with the MQTT example before trying the ESP version.. is there any chance that the flash isn't wiping entirely? I've read several times that if the entire flash isn't wiped it might cause issues.

#for documentation see project at https://github.com/Dilbert66/esphome-VistaECP
substitutions:
  systemName: "vistaalarm"
  accessCode: !secret access_code #Only comes into effect if needed for arming and quickarm is not set
  keypadAddr: "17" #set this to an unused keypad address slot. Make sure to enable it in  your vista panel programming

  ##esp32
  #rxPin: "22" #GPIO pin to use for data receive (yellow line) 
  #txPin: "21" #GPIO pin to use for data transmit (green line)
  #monitorPin: "18" #GPIO pin to use for monitoring module traffic such as RF or Expanders . Set to -1 to disable

  ##esp8266
  rxPin: "5" #GPIO pin to use for data receive (yellow line) 
  txPin: "4" #GPIO pin to use for data transmit (green line)
  monitorPin: "-1" #GPIO pin to use for monitoring module traffic such as RF or Expanders . Set to -1 to disable

  # module addresses:
  # 07 4229 zone expander  zones 9-16
  # 08 4229 zone expander zones 17-24
  # 09 4229 zone expander zones 25-32
  # 10 4229 zone expander zones 33-40
  # 11 4229 zone expander zones 41 48
  # 12 4204 relay module  
  # 13 4204 relay module
  # 14 4204 relay module
  # 15 4204 relay module

  expanderAddr1: "0" # 1st zone expander emulator (4229) address to use . Set to 0 to disable. 
  expanderAddr2: "0" # 2nd expander emulator address to use . Set to 0 to disable. 

  relayAddr1: "0" # relay module emulation (4204) addresses. Set to 0 to disable
  relayAddr2: "0"
  relayAddr3: "0"
  relayAddr4: "0"

  TTL: "30000"  # time  to live  in ms for zone/fire status before expiring;
  quickArm: "false"
  lrrSupervisor: "false" # set to true if we don't have an LRR monitoring supervisor we can emulate one to get the statuses

globals:
  #persistent storage variables
  - id: zoneStates  #persistant storage for zone states in case of reboot
    type: int
    restore_value: yes
  - id: zoneAlarms  #persistant storage for zone states in case of reboot
    type: int
    restore_value: yes
  - id: zoneBypass  #persistant storage for zone states in case of reboot
    type: int
    restore_value: yes
  - id: zoneChecks  #persistant storage for zone states in case of reboot
    type: int
    restore_value: yes
  - id: lrrCode  #persistant storage for last lrr message in case of reboot
    type: int
    restore_value: yes

esphome:
  name: $systemName
  #platform: ESP32
  #board: nodemcu-32s
  platform: ESP8266
  board: nodemcuv2

  # subdirectory where library *.h and *.cpp are placed 
  includes:
    - vistaEcpInterface/

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  ap:
    ssid: "$systemName"
    password: !secret ap_password

logger:
  baud_rate: 115200
  level: DEBUG

api:
  password: !secret api_password

ota:
  password: !secret ota_password
  safe_mode: True

  #status_led:
  # pin:
  #  number: D4
  # inverted: yes

custom_component:
  - lambda: |-
      auto VistaECP = new vistaECPHome($keypadAddr,$rxPin,$txPin,$monitorPin);
      VistaECP->accessCode="$accessCode";
      VistaECP->quickArm=$quickArm;
      VistaECP->expanderAddr1=$expanderAddr1; //zone expander
      VistaECP->expanderAddr2=$expanderAddr2;
      VistaECP->relayAddr1=$relayAddr1; //relay module
      VistaECP->relayAddr2=$relayAddr2;
      VistaECP->relayAddr3=$relayAddr3;
      VistaECP->relayAddr4=$relayAddr4;
      VistaECP->lrrSupervisor=$lrrSupervisor;
      VistaECP->TTL=$TTL;
      VistaECP->debug=1;
      VistaECP->onSystemStatusChange([&](std::string statusCode) {
         id(system_status).publish_state(statusCode);
      });
      VistaECP->onLrrMsgChange([&](std::string msg) {
          id(m1).publish_state(msg);
      });
      VistaECP->onRfMsgChange([&](std::string msg) {
          id(rf1).publish_state(msg);
      });
      VistaECP->onLine1DisplayChange([&](std::string msg) {
          id(l1).publish_state(msg);
      });
      VistaECP->onLine2DisplayChange([&](std::string msg) {
          id(l2).publish_state(msg);
      });
      VistaECP->onBeepsChange([&](std::string beeps) {
          id(beep1).publish_state(beeps);
      });
      VistaECP->onStatusChange([&](sysState led,bool open) {
        switch(led) {
          case sfire: id(fire).publish_state(open);break;
          case salarm: id(alarm1).publish_state(open);break;
          case strouble: id(trouble).publish_state(open);break;
          case sarmedstay: id(stay).publish_state(open);break;
          case sarmedaway: id(away).publish_state(open);break;
          case sinstant: id(instant).publish_state(open);break;
          case sready: id(ready).publish_state(open);break;
          case sac: id(ac).publish_state(open);break;
          case sbypass: id(bypass).publish_state(open);break;
          case schime: id(chime).publish_state(open);break;
          case sbat: id(bat).publish_state(open);break;
          case scheck: id(check).publish_state(open);break;
          case sarmednight: id(night).publish_state(open);break;
          case sarmed: id(armed).publish_state(open);break;
          default: break;
          }
      });
      VistaECP->onZoneStatusChange([&](uint8_t zone, std::string open) {
        switch (zone) {
          case 1: id(z1).publish_state(open); break;
          case 2: id(z2).publish_state(open); break;
          case 3: id(z3).publish_state(open); break;
          case 4: id(z4).publish_state(open); break;
          case 5: id(z5).publish_state(open); break;
          case 6: id(z6).publish_state(open); break;
          case 7: id(z7).publish_state(open); break;
          case 8: id(z8).publish_state(open); break;

          case 9: id(z9).publish_state(open); break;
          case 10: id(z10).publish_state(open); break;

          case 17: id(z17).publish_state(open); break;
        }
      }); //you can add more zones above . Also add the text sensor entry below

      VistaECP->onRelayStatusChange([&](uint8_t addr,uint8_t zone,bool open) {
       switch(addr) {
       case 12: switch (zone) {
                  case 1: id(r1).publish_state(open); break;
                  case 2: id(r2).publish_state(open); break;
                }
                break;
        case 13: break;
        }
      });  //add as many case and switch statements as needed to control your binary sensor outputs
      return {VistaECP};

binary_sensor:
  #- platform: gpio  #example use of pin d8 as a zone trigger port for the emulated zone expander
  #  pin: D8
  #  id: pind8
  #  device_class: window
  # on_press:       #zone,on/off
  #   - lambda: |-
  #       vista.setExpFault(17,1);
  #  on_release:
  #    - lambda: |-
  #       vista.setExpFault(17,0);

  #system status indicator definitions
  - platform: template
    id: trouble
    name: "$systemName Trouble"
    device_class: problem

  - platform: template
    id: bypass
    name: "$systemName Bypass"

  - platform: template
    id: away
    name: "$systemName Away"

  - platform: template
    id: armed
    name: "$systemName Armed"

  - platform: template
    id: stay
    name: "$systemName Stay"

  - platform: template
    id: instant
    name: "$systemName Instant"

  - platform: template
    id: night
    name: "$systemName Night"

  - platform: template
    id: ac
    name: "$systemName AC"
    device_class: plug

  - platform: template
    id: chime
    name: "$systemName Chime"

  - platform: template
    id: check
    name: "$systemName Check"
    device_class: problem

  - platform: template
    id: alarm1
    name: "$systemName Alarm"

  - platform: template
    id: bat
    name: "$systemName Battery"
    device_class: problem

  - platform: template
    id: fire
    device_class: smoke
    name: "$systemName Fire"

  - platform: template
    id: ready
    name: "$systemName Ready"
    #device_class: problem

    #relay module channels add as many as you need.  To hide, comment out the name: attribute
  - platform: template
    id: r1
    name: "$systemName Relay1"

  - platform: template
    id: r2
    name: "$systemName Relay2"

    #zone definitions.  Add more (also add to the switch statment above). To hide, comment out the name: attribute
text_sensor:
  #zone definitions
  - platform: template
    id: z1
    name: "$systemName Front door"

  - platform: template
    id: z2
    name: "$systemName Garage door"

  - platform: template
    id: z3
    name: "$systemName Back door"

  - platform: template
    id: z4
    name: "$systemName Living room window"

  - platform: template
    id: z5
    name: "$systemName Dining room window"

  - platform: template
    id: z6
    name: "$systemName Family room window LF"

  - platform: template
    id: z7
    name: "$systemName Family room window RF"

  - platform: template
    id: z8
    name: "$systemName Basement windows"

  - platform: template
    id: z9
    name: "$systemName Basement windows9"

  - platform: template
    id: z10
    name: "$systemName Basement windows10"

  - platform: template
    id: z17
    name: "$systemName zone 17"

    #system status
  - platform: template
    id: system_status
    name: "$systemName System Status"
    icon: "mdi:shield"

  - platform: template
    id: m1
    name: "$systemName Lrr Msg"
    icon: "mdi:alert-box"

  - platform: template
    id: rf1
    name: "$systemName RF Msg"
    icon: "mdi:alert-box"

  - platform: template
    id: l1
    name: "$systemName Line1"

  - platform: template
    id: l2
    name: "$systemName Line2"

  - platform: template
    id: beep1
    name: "$systemName Beeps"

switch:
  - platform: template
    name: "$systemName Connection"
    id: connection_status_switch
    lambda: |-
      return vista.keybusConnected;
    icon: "mdi:shield-link-variant"
    turn_on_action:
      - switch.toggle: restart_switch
    turn_off_action:
      - lambda: |-
          disconnectVista();
  - platform: restart
    id: restart_switch
Dilbert66 commented 3 years ago

Ok, i see the issue. You have the monitor pin set at -1 to disable but yet, my code is still trying to read an invalid disabled pin. The serial code should not allow that and technically my getextbyte routine should not be called. Initially the code used a #DEFINE to enable or disable the monitor code but I switched to using a yaml configuration.

I'll fix the code. For now, you can set a valid pin for the monitor pin config. (even if you don't have it hooked up) so that the code will at least run.

Dilbert66 commented 3 years ago

Pushed corrected version.

knifesk commented 3 years ago

Yes sir! that was it! It's booting now! Does it make any difference to have it enabled and not connected? I'm not planning to use it anyway...

I need to do some other stuff rn, but as soon as I finish with my things I'll rebuild all the YAML as I intend to use it and re-connect the module to the panel. I'll be back later! I promise I'll bring a couple pics to show off hehe :)

Thanks for your time man, you're the best. I promised a couple months ago to make some contributions to the project, I'm planning to cleanup the codebase and see if I can improve something :D

Cheers!

Dilbert66 commented 3 years ago

Best to leave it at -1 so you don't pick up errant bits. The monitor pin is really useful for those that have RF devices as it will pick up various states from those devices. Also on/off status will be detected immediately since the code will use the device response to decided if the sensor is off or on.