Page 1 of 1

ESP-WROOM-02U pin definition

Posted: 16 Sep 2019, 14:51
by pmayer
Hey,

I've just build an ESP8266 OneWire Gateway (https://twitter.com/pregopm/status/1161749689336811520) and plan to use it with EspEasy. It works great, but as I'm using the ESP-WROOM-02(U) modules - which I like for their availability and reliability - something could not be right.

I currently flashed "ESP_Easy_mega-20190409_normal_WROOM02_2M.bin" and my onewire-level-shifter is connected to IO5 according to this pinout diagram:
Image

The problem now is, that I have to set the onewire-pi to GPIO4/D1 to get it to work - albeit it is connected to IO5.
Also the I2C is set up for GPIO4/5 which seems not be right for the WROOM-02, according to the Espressif-Datasheet (https://www.espressif.com/sites/default ... eet_en.pdf - section 3.4) this should be IO14 (SCL) and IO2 (SDA).

//edit: The WROOM-02 and WROOM-02U have the same pinout. The only difference is, that the 02 has a PCB antenna and the 02U has an u.FL-connector.

Could you tell me the correct pin definition for the WROOM-modules?
Any input on this matter is appreciated. Thank you!

//edit:
I've just flashed a blink example using the "Generic ESP8266 Module" from ESP Arduino core V2.5.2 and GPIO5 is there where the pinout from above states. So, which board definition is used for the binary releases?

Code: Select all

void setup() {
  pinMode(5, OUTPUT);
}

void loop() {
  digitalWrite(5, HIGH); 
  delay(1000);                
  digitalWrite(5, LOW);   
  delay(1000);                 
}
Cheers,
Patrik

Re: ESP-WROOM-02U pin definition

Posted: 16 Sep 2019, 17:12
by TD-er
Indeed, the datasheet mentions IO14 (SCL), IO2 (SDA)
I must say, it does make sense to use IO2 for SDA, since I2C communication is often done with pull-up resistors and GPIO2 has to be pulled up at boot.

I have no idea why it should be so different compared to other ESP8266 boards. As far as I know, the board is using a normal ESP8266 only housed in a different form factor module and with non-standard 2M flash.

We just use this configuration in platformio.ini:

Code: Select all

[espWroom2M]
board_build.flash_mode    = dout
board_build.f_cpu         = ${common.board_build.f_cpu}
board_upload.maximum_size = 1044464
board                     = esp_wroom_02
build_unflags             = ${common.build_unflags}
build_flags               = -Wl,-Tesp8266.flash.2m.ld
That config does not look very different from other boards, as can be seen here: https://github.com/platformio/platform- ... om_02.json

I suggest to change the config in ESPeasy to match the functions on your schematic.
You can also change the pins for I2C.
Maybe also do a reboot after changing all pins to what you need, to make sure the input/output states are what they need to be.

Re: ESP-WROOM-02U pin definition

Posted: 16 Sep 2019, 18:25
by pmayer
Thank you very much for your answer.
TD-er wrote: 16 Sep 2019, 17:12 I suggest to change the config in ESPeasy to match the functions on your schematic.
You can also change the pins for I2C.
Maybe also do a reboot after changing all pins to what you need, to make sure the input/output states are what they need to be.
That's what I already do. As I'm not using I2C here this doesn't matter but the external LED for Status is selected. Surprisingly this PIN definition is correct. Could there be some mixup between 4/5? Maybe something that got fixed since April?

I saw that there is not even a WROOM-02 board definition in the ESP-Arduino-Core. We are using the WROOM module in some customer projects and had to write our own board file, but for PlattformIO. Maybe we should do a pull request.

For sure I will test the current binary as soon as I have time and will get back here.

Re: ESP-WROOM-02U pin definition

Posted: 17 Sep 2019, 00:09
by TD-er
Please do and if you find something definitive, please let me know.
I think I do have one of these somewhere in the drawer, mounted on a TTGO board I think.
So not entirely sure the pin mapping is entirely clear on that one, but we'll see then.

Re: ESP-WROOM-02U pin definition

Posted: 20 Sep 2019, 15:19
by pmayer
OMG! I made a mistake... the onewire pin _is_ wired to GPIO4... damn. So sorry for the confusion. I messed up V0.1 and V0.2 of the schematics as I've changed the pin with the new revision. Checked V0.2 schematics against V0.1 hardware while testing...

The pin definition is obviously correct and the I2C pin's can easily be changed for the ESP-WROOM-02.

@TD-er, thanks for your patience.

Cheers,
Patrik