I'm using the ESPhapled2866 example with no modification, Everything works fine. However, when I add the initial value code to my sketch I still get the light button active and once I press it the ESP keeps restarting:
Here is the code I modified:
if(hapservice){
Serial.println("notify hap");
//getting on/off characteristic
homekit_characteristic_t * ch= homekit_service_characteristic_by_type(hapservice, HOMEKIT_CHARACTERISTIC_ON);
INIT_CHARACHTERISTIC_VAL(bool,ch,false);
if(ch){
Serial.println("found characteristic");
if(ch->value.bool_value!=val){ //wil notify only if different
ch->value.bool_value=val;
homekit_characteristic_notify(ch,ch->value);
}
}
}
I'm using the ESPhapled2866 example with no modification, Everything works fine. However, when I add the initial value code to my sketch I still get the light button active and once I press it the ESP keeps restarting: Here is the code I modified:
Here is the serial output: