BertB wrote:
..............
You probably use a NodeMCU or a Esp-12 E or F? Pins 9 and 10 are special use.
Somewhere I read you can only use them in ESP-12D
This article explains a bit about GPIO9 & GPIO10
http://smarpl.com/content/esp8266-esp-2 ... and-gpio10 e
If GPIO9 and GPIO10 can be used depends on the mode the ESP is being flashed.
In the IDE the board 'Generic ESP8266 Module' has a option to choose between DIO and QIO mode. In DIO mode GPIO9 and GPIO10 are available.
I tested a ESP201 module which have pin 9 and 10 broken out. If flashed in QIO mode, connecting a device to one of them make the module crash but when flashed in DIO mode I can use GPIO 10 as data input line for a DHT22 module. The DHT has a pullup of 4k7 onboard. When I use it on GPIO9 the module crashes , I do not know the reason.
The same happens with the NodeMCU board, in the IDE one cannot choose DIO or QIO, but it seems that DIO is the normal mode for this module and I can confirm that it behaves the same as the ESP-201 flashed in DIO mode. So GPIO10 can be used for the DHT22 and using GPIO9 makes the board crash.
Maybe GPIO9 can be used as an OUTPUT with external pullup, I have not tested that.
edit:
I did not scroll down on that page, to free pin 9 and 10 a hardware modification is also needed.
That it worked for me on GPIO10 is no guarantee that it is stable.
So for normal users: do not use GPIO9 or GPIO10 unless the board is modified.