Yurik72 / ESPHap

ESP32/ESP8266 Arduino library for native Apple Homekit Accessory Protocol (HAP)
MIT License
265 stars 60 forks source link

Initial value bool error with INIT_CHARACHTERISTIC_VAL(bool,ch,false); #48

Closed chrwh closed 3 years ago

chrwh commented 3 years ago

Hi,

When I try to implement initial value from the library API description, I get and bool and ch not declared error?

Optinally you can set a default (initial) value to be informed Apple about initial state

homekit_characteristic_t * ch= homekit_service_characteristic_by_type(hapservice, HOMEKIT_CHARACTERISTIC_ON); INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF

I get this error:

EspHapSwitch8266_Double_Web:146:27: error: expected primary-expression before 'bool' INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF ^ EspHapSwitch8266_Double_Web:146:32: error: 'ch' was not declared in this scope INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF ^ EspHapSwitch8266_Double_Web:146:40: error: 'INIT_CHARACHTERISTIC_VAL' was not declared in this scope INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF

Best regards, Christian

Yurik72 commented 3 years ago

1.Use latest version or version tagged v1.0.7

  1. Check what is ch in your code. It should be valid pointer to (homekit_characteristic_t *)

Any other question, please attach full sketch

chrwh commented 3 years ago

Hi,

I'm using v.1.0.7

I now also see and unprotected wifi ESP-E4061A, when finished pairing a setting up a new device, that give access to 192.168.4.1 ?? and evrybody can lok into that?

Here is the hole sketch look for //test

/// BASIC CONFIGURATION

define ENABLE_WIFI_MANAGER // if we want to have built-in wifi configuration

                         // Otherwise direct connect ssid and pwd will be used
                         // for Wifi manager need extra library //https://github.com/tzapu/WiFiManager

define ENABLE_WEB_SERVER //if we want to have built in web server /site

define ENABLE_OTA //if Over the air update need , ENABLE_WEB_SERVER must be defined first

include

ifdef ESP32

include

endif

ifdef ESP8266

include

include

include "coredecls.h"

endif

ifdef ENABLE_WEB_SERVER

ifdef ESP8266

include

ESP8266WebServer server(80);

endif

ifdef ESP32

include

WebServer server(80);

endif

endif

if defined(ESP32) && defined(ENABLE_OTA)

include

endif

ifdef ENABLE_WEB_SERVER

include "spiffs_webserver.h"

bool isWebserver_started=false;

endif

const int relay_gpio=2; const int relay1_gpio=0;

ifdef ENABLE_WIFI_MANAGER

include //https://github.com/tzapu/WiFiManager

endif

const char HOSTNAME="my_thing"; const char ssid = "ssid"; const char* password = "pass";

extern "C"{

include "homeintegration.h"

}

ifdef ESP8266

include "homekitintegrationcpp.h"

endif

homekit_service_t hapservice={0}; homekit_service_t hapservice_CD={0};

String pair_file_name="/pair.dat";

void switch_callback(homekit_characteristic_t ch, homekit_value_t value, void context); void switch1_callback(homekit_characteristic_t ch, homekit_value_t value, void context);

//Web server section

define ENABLE_OTA //if OTA need

include "spiffs_webserver.h"

bool getSwitchVal(){ if(hapservice){ homekit_characteristic_t * ch= homekit_service_characteristic_by_type(hapservice, HOMEKIT_CHARACTERISTIC_ON); if(ch){ return ch->value.bool_value; } }

if(hapservice_CD){
  homekit_characteristic_t * ch= homekit_service_characteristic_by_type(hapservice_CD, HOMEKIT_CHARACTERISTIC_ON);
  if(ch){
    return ch->value.bool_value;
  }
}
return false;

}

void setup() {

ifdef ESP8266

disable_extra4k_at_link_time();

endif

Serial.begin(115200); delay(10);

ifdef ESP32

 if (!SPIFFS.begin(true)) {
  // Serial.print("SPIFFS Mount failed");
 }

endif

ifdef ESP8266

 if (!SPIFFS.begin()) {
  Serial.print("SPIFFS Mount failed");
 }

endif

Serial.print("Free heap: ");
Serial.println(system_get_free_heap_size());

pinMode(relay_gpio, OUTPUT);

pinMode(relay1_gpio, OUTPUT);

init_hap_storage();

set_callback_storage_change(storage_changed);

/// We will use for this example only one accessory (possible to use a several on the same esp)
//Our accessory type is light bulb , apple interface will proper show that
hap_setbase_accessorytype(homekit_accessory_category_switch);
/// init base properties
hap_initbase_accessory_service("doswitch","Fun","0","dSwitch","1.54");

//we will add only one light bulb service and keep pointer for nest using hapservice= hap_add_switch_service("AUX",switch_callback,(void)&relay_gpio); hapservice_CD= hap_add_switch_service("CD",switch1_callback,(void)&relay1_gpio);

//test

//homekit_characteristic_t * ch = homekit_service_characteristic_by_type(hapservice, HOMEKIT_CHARACTERISTIC_ON); //INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF

// homekit_characteristic_t * ch1= homekit_service_characteristic_by_type(hapservice_CD, HOMEKIT_CHARACTERISTIC_ON); //INIT_CHARACHTERISTIC_VAL(bool,ch1,false); // will inform apple that lights is OFF //end test

ifdef ENABLE_WIFI_MANAGER

startwifimanager();

else

WiFi.mode(WIFI_STA);
WiFi.begin((char*)ssid, (char*)password);
 while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
}

endif

Serial.println(PSTR("WiFi connected"));
Serial.println(PSTR("IP address: "));
Serial.println(WiFi.localIP());

hap_init_homekit_server();   

ifdef ENABLE_WEB_SERVER

String strIp=String(WiFi.localIP()[0]) + String(".") + String(WiFi.localIP()[1]) + String(".") + String(WiFi.localIP()[2]) + String(".") + String(WiFi.localIP()[3]);

ifdef ESP8266

if(hap_homekit_is_paired()){

endif

Serial.println(PSTR("Setting web server")); SETUP_FILEHANDLES server.on("/get", handleGetVal); server.on("/set", handleSetVal);
server.begin(); Serial.println(String("Web site http://")+strIp);
Serial.println(String("File system http://")+strIp+String("/browse")); Serial.println(String("Update http://")+strIp+String("/update"));
isWebserver_started=true;

ifdef ESP8266

}else Serial.println(PSTR("Web server is NOT SET, waiting for pairing"));

endif

endif

}

void handleGetVal(){ server.send(200, FPSTR(TEXT_PLAIN), getSwitchVal()?"1":"0"); } void handleSetVal(){ if (server.args() !=2){ server.send(505, FPSTR(TEXT_PLAIN), "Bad args"); return; } //to do analyze if(server.arg("var") == "ch1"){ if(hapservice){

  homekit_characteristic_t * ch= homekit_service_characteristic_by_type(hapservice, HOMEKIT_CHARACTERISTIC_ON);
  if(ch){
    set_switch(server.arg("val")=="true");
  }
}

}

if(server.arg("var") == "ch2"){
if(hapservice_CD){

  homekit_characteristic_t * ch= homekit_service_characteristic_by_type(hapservice_CD, HOMEKIT_CHARACTERISTIC_ON);
  if(ch){
    set_switch1(server.arg("val")=="true");
  }
}

} } void loop() {

ifdef ESP8266

hap_homekit_loop();

endif

if(isWebserver_started) server.handleClient();

}

void init_hap_storage(){ Serial.print("init_hap_storage");

File fsDAT=SPIFFS.open(pair_file_name, "r");

if(!fsDAT){ Serial.println("Failed to read pair.dat"); SPIFFS.format();

} int size=hap_get_storage_size_ex(); char* buf=new char[size]; memset(buf,0xff,size); if(fsDAT) fsDAT.readBytes(buf,size);

hap_init_storage_ex(buf,size); if(fsDAT) fsDAT.close(); delete []buf;

} void storage_changed(char * szstorage,int bufsize){

SPIFFS.remove(pair_file_name); File fsDAT=SPIFFS.open(pair_file_name, "w+"); if(!fsDAT){ Serial.println("Failed to open pair.dat"); return; } fsDAT.write((uint8_t*)szstorage, bufsize);

fsDAT.close(); } //can be used for any logic, it will automatically inform Apple about state changes

void set_switch(bool val){ Serial.println(String("set_switch:")+String(val?"True":"False")); digitalWrite(relay_gpio, val?HIGH:LOW); //we need notify apple about changes

if(hapservice){ Serial.println("notify hap"); //getting on/off characteristic homekit_characteristic_t * ch= homekit_service_characteristic_by_type(hapservice, HOMEKIT_CHARACTERISTIC_ON); if(ch){

    if(ch->value.bool_value!=val){  //wil notify only if different
      ch->value.bool_value=val;
      homekit_characteristic_notify(ch,ch->value);
    }
}

} }

void switch_callback(homekit_characteristic_t ch, homekit_value_t value, void context) { Serial.println("switch_callback"); set_switch(ch->value.bool_value); }

void set_switch1(bool val){ Serial.println(String("set_switch1:")+String(val?"True":"False")); digitalWrite(relay1_gpio, val?HIGH:LOW); //we need notify apple about changes

if(hapservice_CD){ Serial.println("notify hap"); //getting on/off characteristic homekit_characteristic_t * ch= homekit_service_characteristic_by_type(hapservice_CD, HOMEKIT_CHARACTERISTIC_ON); if(ch){

    if(ch->value.bool_value!=val){  //wil notify only if different
      ch->value.bool_value=val;
      homekit_characteristic_notify(ch,ch->value);
    }
}

} }

void switch1_callback(homekit_characteristic_t ch, homekit_value_t value, void context) { Serial.println("switch1_callback"); set_switch1(ch->value.bool_value); }

ifdef ENABLE_WIFI_MANAGER

void startwifimanager() { WiFiManager wifiManager;

if (!wifiManager.autoConnect(HOSTNAME, NULL)) { ESP.restart(); delay(1000); } }

endif

Yurik72 commented 3 years ago

Hi, About I now also see and unprotected wifi ESP-E4061A, when finished pairing a setting up a new device, that give access to 192.168.4.1 ?? and evrybody can lok into that?

This is not related to this library and standard behaviour of WiFi manager, It's properly documented Definetelly thgs can happen when ESP not able to connect to your Wifi network and i't started in configuration mode.
So, problem could be

  1. Device can't properly connect to your Wifi network , weak signal , what ever
  2. You have upload a new scetch with option clear ESP. Means all data lost
chrwh commented 3 years ago

Hi, Can you provide any further help on how to use the below, I can't make it work? homekit_characteristic_t * ch= homekit_service_characteristic_by_type(hapservice, HOMEKIT_CHARACTERISTIC_ON); INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF Best regards, Christian

Yurik72 commented 3 years ago

Yes, but could you explain what is not working, compilation, behaviour... As well please attach a log

chrwh commented 3 years ago

I get this error, if you try to compile the code about (right now the lines are masked out //)

I get this error:

EspHapSwitch8266_Double_Web:146:27: error: expected primary-expression before 'bool' INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF ^ EspHapSwitch8266_Double_Web:146:32: error: 'ch' was not declared in this scope INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF ^ EspHapSwitch8266_Double_Web:146:40: error: 'INIT_CHARACHTERISTIC_VAL' was not declared in this scope INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF

What I want, is the outputs to be OFF when power is initial turned on

Yurik72 commented 3 years ago

Ok,

  1. Send me a full sketch
  2. Which version you are using, please check . INIT_CHARACHTERISTIC_VAL implemented not so far

From: chrwh notifications@github.com Sent: Wednesday, February 17, 2021 12:45 PM To: Yurik72/ESPHap ESPHap@noreply.github.com Cc: Yurik72 yurik.kovalenko@gmail.com; State change state_change@noreply.github.com Subject: Re: [Yurik72/ESPHap] Initial value bool error with INIT_CHARACHTERISTIC_VAL(bool,ch,false); (#48)

I get this error, if you try to compile the code about (right now the lines are masked out //)

I get this error:

EspHapSwitch8266_Double_Web:146:27: error: expected primary-expression before 'bool' INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF ^ EspHapSwitch8266_Double_Web:146:32: error: 'ch' was not declared in this scope INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF ^ EspHapSwitch8266_Double_Web:146:40: error: 'INIT_CHARACHTERISTIC_VAL' was not declared in this scope INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF

What I want, is the outputs to be OFF when power is initial turned on

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Yurik72/ESPHap/issues/48#issuecomment-780468769 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKDREXNZHOGZC32TXFNYMXDS7OMZTANCNFSM4XH735BQ . https://github.com/notifications/beacon/AKDREXJI6DMSRFIV4FB57R3S7OMZTA5CNFSM4XH735B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF2CQEII.gif

chrwh commented 3 years ago

Hi,

I use V.1.0.7 (if I look in the library.properties file it says 1.0.3) but I downloaded from here https://github.com/Yurik72/ESPHap/releases/tag/v1.0.7

Atteched the full sketch, look around line 157, they are masked out // at the moment

Thanks and best regards,

Christian

Fra: Yurik72 notifications@github.com Sendt: 17. februar 2021 12:17 Til: Yurik72/ESPHap ESPHap@noreply.github.com Cc: chrwh chwh@c.dk; Author author@noreply.github.com Emne: Re: [Yurik72/ESPHap] Initial value bool error with INIT_CHARACHTERISTIC_VAL(bool,ch,false); (#48)

Ok,

  1. Send me a full sketch
  2. Which version you are using, please check . INIT_CHARACHTERISTIC_VAL implemented not so far

From: chrwh <notifications@github.com mailto:notifications@github.com > Sent: Wednesday, February 17, 2021 12:45 PM To: Yurik72/ESPHap <ESPHap@noreply.github.com mailto:ESPHap@noreply.github.com > Cc: Yurik72 <yurik.kovalenko@gmail.com mailto:yurik.kovalenko@gmail.com >; State change <state_change@noreply.github.com mailto:state_change@noreply.github.com > Subject: Re: [Yurik72/ESPHap] Initial value bool error with INIT_CHARACHTERISTIC_VAL(bool,ch,false); (#48)

I get this error, if you try to compile the code about (right now the lines are masked out //)

I get this error:

EspHapSwitch8266_Double_Web:146:27: error: expected primary-expression before 'bool' INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF ^ EspHapSwitch8266_Double_Web:146:32: error: 'ch' was not declared in this scope INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF ^ EspHapSwitch8266_Double_Web:146:40: error: 'INIT_CHARACHTERISTIC_VAL' was not declared in this scope INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF

What I want, is the outputs to be OFF when power is initial turned on

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Yurik72/ESPHap/issues/48#issuecomment-780468769 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKDREXNZHOGZC32TXFNYMXDS7OMZTANCNFSM4XH735BQ . https://github.com/notifications/beacon/AKDREXJI6DMSRFIV4FB57R3S7OMZTA5CNFSM4XH735B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF2CQEII.gif

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Yurik72/ESPHap/issues/48#issuecomment-780486795 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUAINVSEFOQYTZ75UAHB4LS7OQSLANCNFSM4XH735BQ . https://github.com/notifications/beacon/ABUAINWH4BMLDHQDZA2DG4TS7OQSLA5CNFSM4XH735B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF2CURCY.gif

Yurik72 commented 3 years ago

I do not see any attachments,

Check your Library folder ESPHap If file homeintegration.h contains

define INIT_CHARACHTERISTIC_VAL

From: chrwh notifications@github.com Sent: Wednesday, February 17, 2021 1:53 PM To: Yurik72/ESPHap ESPHap@noreply.github.com Cc: Yurik72 yurik.kovalenko@gmail.com; State change state_change@noreply.github.com Subject: Re: [Yurik72/ESPHap] Initial value bool error with INIT_CHARACHTERISTIC_VAL(bool,ch,false); (#48)

Hi,

I use V.1.0.7 (if I look in the library.properties file it says 1.0.3) but I downloaded from here https://github.com/Yurik72/ESPHap/releases/tag/v1.0.7

Atteched the full sketch, look around line 157, they are masked out // at the moment

Thanks and best regards,

Christian

Fra: Yurik72 <notifications@github.com mailto:notifications@github.com > Sendt: 17. februar 2021 12:17 Til: Yurik72/ESPHap <ESPHap@noreply.github.com mailto:ESPHap@noreply.github.com > Cc: chrwh <chwh@c.dk mailto:chwh@c.dk >; Author <author@noreply.github.com mailto:author@noreply.github.com > Emne: Re: [Yurik72/ESPHap] Initial value bool error with INIT_CHARACHTERISTIC_VAL(bool,ch,false); (#48)

Ok,

  1. Send me a full sketch
  2. Which version you are using, please check . INIT_CHARACHTERISTIC_VAL implemented not so far

From: chrwh <notifications@github.com mailto:notifications@github.com%20%3cmailto:notifications@github.com mailto:notifications@github.com > Sent: Wednesday, February 17, 2021 12:45 PM To: Yurik72/ESPHap <ESPHap@noreply.github.com mailto:ESPHap@noreply.github.com%20%3cmailto:ESPHap@noreply.github.com mailto:ESPHap@noreply.github.com > Cc: Yurik72 <yurik.kovalenko@gmail.com mailto:yurik.kovalenko@gmail.com%20%3cmailto:yurik.kovalenko@gmail.com mailto:yurik.kovalenko@gmail.com >; State change <state_change@noreply.github.com mailto:state_change@noreply.github.com%20%3cmailto:state_change@noreply.github.com mailto:state_change@noreply.github.com > Subject: Re: [Yurik72/ESPHap] Initial value bool error with INIT_CHARACHTERISTIC_VAL(bool,ch,false); (#48)

I get this error, if you try to compile the code about (right now the lines are masked out //)

I get this error:

EspHapSwitch8266_Double_Web:146:27: error: expected primary-expression before 'bool' INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF ^ EspHapSwitch8266_Double_Web:146:32: error: 'ch' was not declared in this scope INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF ^ EspHapSwitch8266_Double_Web:146:40: error: 'INIT_CHARACHTERISTIC_VAL' was not declared in this scope INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF

What I want, is the outputs to be OFF when power is initial turned on

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Yurik72/ESPHap/issues/48#issuecomment-780468769 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKDREXNZHOGZC32TXFNYMXDS7OMZTANCNFSM4XH735BQ . https://github.com/notifications/beacon/AKDREXJI6DMSRFIV4FB57R3S7OMZTA5CNFSM4XH735B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF2CQEII.gif

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Yurik72/ESPHap/issues/48#issuecomment-780486795 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUAINVSEFOQYTZ75UAHB4LS7OQSLANCNFSM4XH735BQ . https://github.com/notifications/beacon/ABUAINWH4BMLDHQDZA2DG4TS7OQSLA5CNFSM4XH735B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF2CURCY.gif

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Yurik72/ESPHap/issues/48#issuecomment-780504972 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKDREXKTWROFXQ7TPELGHMLS7OUY5ANCNFSM4XH735BQ . https://github.com/notifications/beacon/AKDREXILGSAA5BGZ2PUJWZ3S7OUY5A5CNFSM4XH735B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF2CY7DA.gif

chrwh commented 3 years ago

Argh I forgot to attach it. You can see the code above in the thread on GitHub.

Best regards

Christian

Den 17. feb. 2021 kl. 14.48 skrev Yurik72 notifications@github.com:

 I do not see any attachments,

Check your Library folder ESPHap If file homeintegration.h contains

define INIT_CHARACHTERISTIC_VAL

From: chrwh notifications@github.com Sent: Wednesday, February 17, 2021 1:53 PM To: Yurik72/ESPHap ESPHap@noreply.github.com Cc: Yurik72 yurik.kovalenko@gmail.com; State change state_change@noreply.github.com Subject: Re: [Yurik72/ESPHap] Initial value bool error with INIT_CHARACHTERISTIC_VAL(bool,ch,false); (#48)

Hi,

I use V.1.0.7 (if I look in the library.properties file it says 1.0.3) but I downloaded from here https://github.com/Yurik72/ESPHap/releases/tag/v1.0.7

Atteched the full sketch, look around line 157, they are masked out // at the moment

Thanks and best regards,

Christian

Fra: Yurik72 <notifications@github.com mailto:notifications@github.com > Sendt: 17. februar 2021 12:17 Til: Yurik72/ESPHap <ESPHap@noreply.github.com mailto:ESPHap@noreply.github.com > Cc: chrwh <chwh@c.dk mailto:chwh@c.dk >; Author <author@noreply.github.com mailto:author@noreply.github.com > Emne: Re: [Yurik72/ESPHap] Initial value bool error with INIT_CHARACHTERISTIC_VAL(bool,ch,false); (#48)

Ok,

  1. Send me a full sketch
  2. Which version you are using, please check . INIT_CHARACHTERISTIC_VAL implemented not so far

From: chrwh <notifications@github.com mailto:notifications@github.com%20%3cmailto:notifications@github.com mailto:notifications@github.com > Sent: Wednesday, February 17, 2021 12:45 PM To: Yurik72/ESPHap <ESPHap@noreply.github.com mailto:ESPHap@noreply.github.com%20%3cmailto:ESPHap@noreply.github.com mailto:ESPHap@noreply.github.com > Cc: Yurik72 <yurik.kovalenko@gmail.com mailto:yurik.kovalenko@gmail.com%20%3cmailto:yurik.kovalenko@gmail.com mailto:yurik.kovalenko@gmail.com >; State change <state_change@noreply.github.com mailto:state_change@noreply.github.com%20%3cmailto:state_change@noreply.github.com mailto:state_change@noreply.github.com > Subject: Re: [Yurik72/ESPHap] Initial value bool error with INIT_CHARACHTERISTIC_VAL(bool,ch,false); (#48)

I get this error, if you try to compile the code about (right now the lines are masked out //)

I get this error:

EspHapSwitch8266_Double_Web:146:27: error: expected primary-expression before 'bool' INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF ^ EspHapSwitch8266_Double_Web:146:32: error: 'ch' was not declared in this scope INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF ^ EspHapSwitch8266_Double_Web:146:40: error: 'INIT_CHARACHTERISTIC_VAL' was not declared in this scope INIT_CHARACHTERISTIC_VAL(bool,ch,false); // will inform apple that lights is OFF

What I want, is the outputs to be OFF when power is initial turned on

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Yurik72/ESPHap/issues/48#issuecomment-780468769 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKDREXNZHOGZC32TXFNYMXDS7OMZTANCNFSM4XH735BQ . https://github.com/notifications/beacon/AKDREXJI6DMSRFIV4FB57R3S7OMZTA5CNFSM4XH735B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF2CQEII.gif

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Yurik72/ESPHap/issues/48#issuecomment-780486795 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUAINVSEFOQYTZ75UAHB4LS7OQSLANCNFSM4XH735BQ . https://github.com/notifications/beacon/ABUAINWH4BMLDHQDZA2DG4TS7OQSLA5CNFSM4XH735B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF2CURCY.gif

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Yurik72/ESPHap/issues/48#issuecomment-780504972 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKDREXKTWROFXQ7TPELGHMLS7OUY5ANCNFSM4XH735BQ . https://github.com/notifications/beacon/AKDREXILGSAA5BGZ2PUJWZ3S7OUY5A5CNFSM4XH735B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF2CY7DA.gif

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

chrwh commented 3 years ago

Just checked, the "#define INIT_CHARACHTERISTIC_VAL" is not in the homeintegration.h file, So the link you refere to here as being V.1.0.7 is not it's V.1.0.3 https://github.com/Yurik72/ESPHap/releases/tag/v1.0.7, I now downloaded from the from page, and it can now compile, but with many warining. When trying to access the webserver it crashes and reboots. This is run in a ESP8266-01 1mb. File is now attached EspHapSwitch8266_Double_Web 1.zip

chrwh commented 3 years ago

Updtate: Completely wiped the ESP-01, and it seems to work now. Still getting a lot of compile warnings in regards to Wolfssl?

Yurik72 commented 3 years ago

Ok , good news, warning appears in wolfssl you are right, but you do not see any impact

Sent from my iPhone

On 20 Feb 2021, at 13:04, chrwh notifications@github.com wrote:

 Updtate: Completely wiped the ESP-01, and it seems to work now. Still getting a lot of compile warnings in regards to Wolfssl?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

chrwh commented 3 years ago

So far no impact with the Wolfssl errors