maximkulkin / esp-homekit-demo

Demo of Apple HomeKit accessory server library
MIT License
803 stars 233 forks source link

build exampls/esp32/button #375

Closed coffice12 closed 3 years ago

coffice12 commented 3 years ago

connect io0 buttonand gnd

click button No response

What's wrong?

renandw commented 3 years ago

you defined GPIO 0 as your "BUTTON_PIN"?

maximkulkin commented 3 years ago

@renandw The firmware already defines that. Not sure what is happening. @coffice12 Can you provide logs?

nick-nick-32 commented 3 years ago

Hi guys,

I’m totally noob on this platform, so I will perhaps say something wrong but, I faced the same issue and it seems there is a typo in components > common > button > port.c

For the ESP-IDF part, which is used for ESP32 if I’m not wrong, the my_gpio_enable function set the GPIO as output instead of input.

I gave a try to add

 gpio_set_direction(button_gpio, GPIO_MODE_INPUT);

directly in app_main of examples > esp32 > button > main > main.c and I’m now able the see logs when button pushed.

Hopes it can help…

coffice12 commented 3 years ago

搞定!谢谢你了!thins!!