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
124 stars 21 forks source link

vistaECP MQTT Example: 'kpaddr' was not declared in this scope #79

Closed dennislv closed 1 year ago

dennislv commented 1 year ago

Hello all. I'm trying to compile the vistaECP example from the MQTT folder. I copied the vistaECP.ino into a folder with everything from src/ECPSoftwareSerial/. Leaving everything as-is, it throws the following error. Am I missing a file? Thanks in advance

W:\vistaECP\vistaECP.ino: In function 'void loop()':
vistaECP:526:30: error: 'kpaddr' was not declared in this scope
       int kpaddrbit=0x01 << (kpaddr - 16);
                              ^
exit status 1
'kpaddr' was not declared in this scope
Dilbert66 commented 1 year ago

ah yes, I reconfigured the main code but did not retest the mqtt example. Change kpaddr to kpAddr and see if that works.

dennislv commented 1 year ago

Same result

W:\vistaECP\vistaECP.ino: In function 'void loop()':
vistaECP:526:30: error: 'kpAddr' was not declared in this scope
       int kpaddrbit=0x01 << (kpAddr - 16);
                              ^
exit status 1
'kpAddr' was not declared in this scope
Dilbert66 commented 1 year ago

You do have vista.cpp and vista.h in your program directory correct?

dennislv commented 1 year ago

I believe so. I copied the vistaECP.ino from the mqtt directory, and the others from src/ECPSoftwareSerial/

image

Dilbert66 commented 1 year ago

ah, that code was in transition. Delete these two lines from vistaecp.ino: (lines 526,527)

      int kpaddrbit=0x01 << (vista.kpAddr - 16);
      if (!(vista.cbuf[3] & kpaddrbit)) return; // not addressed to this keypad  

You might want to try the dev branch. That code has better multi partition support.

dennislv commented 1 year ago

That got rid of the error. I'll give the dev branch a try. Thank you for your help!