Closed kunjal83 closed 5 years ago
I think you should be able to do that the normal way: gpio_enable(1, GPIO_OUTPUT)
(where 1
is TX pin)
This doesnt work out in case of ESp8266-12F.
when I write const int toggle_gpio5 = 5;
and gpio_enable(toggle_gpio5, GPIO_INPUT);
, this specifically activates GPIO5 on this chip.
Do you think, we need to additional add anything more here?
this specifically activates GPIO5 on this chip.
What does that mean?!
apologies if thats confusing. What i meant was, based on your comment, gpio_enable(1, GPIO_OUTPUT)
, writing const int toggle_gpio5 = 5;
and gpio_enable(toggle_gpio5, GPIO_INPUT);
should ideally activate GPIO14 but here it activates GPIO5.
gpio_enable(5, GPIO_INPUT)
activates GPIO5?! What a surprise!
I am surprised as well and that was the reason to start this thread.
Try using gpio_enable(14, GPIO_INPUT)
Thats activates GPIO14
Exactly! Here you go!
Yes, but here we go back to my original question, how do I activate the non-GPIO pins for IO related operations?
I would say: you can not repurpose non-GPIO pins. Here is detailed pinout diagram, you can see that most pins are GPIO pins, except for power/ground ones, chip enable, reset, ADC and two reserved pins.
No problem. On another note, how can I put the ESP to sleep? I think there are 2 sleep modes, Light Sleep and Deep Sleep. Any thoughts?
No experiments were made so far. As far as I know, deep sleep does not preserve memory state, that means that it's like reboot of device. Also it will be disconnected from network and HomeKit controllers won't be able to communicate with it (will be "Unreachable").
Not sure about Light sleep and Modem sleep. It seems from description, that it should be possible to use Light sleep without loosing connectivity.
Let me experiment this weekend and feedback.
@maximkulkin, can you quickly confirm if the framework has setup for sleep already done? if yes, can you point me to the library please?
Not sure what kind of setup you expect.
i am talking about the below 2 command. I am unable to find anything in the current library related to these commands.
wifi_fpm_open(); wifi_fpm_do_sleep(26843455);
IMO this is not something HomeKit framework should care about. Moreover, those functions do not exist in esp-open-rtos.
No problem. I will try and see what can be done.
Seems like original issue was resolved, closing this issue
I have tried checking the library and has also checked the issues but not sure if anyone has assigned the Non-IO Pins to change its function as IO. For Example, Tx and Rx Pins. Default function of these pins is to be used as Receiver and Transmitter. However, can we change the function for them as IO pins and use them?
I am aware them how to do it when writing sketch Arduino but not sure here.
Thanks.