Uncategorized

ESP32 notes

3
1

It is possible to flash the ESP8266 12-F with the raspberry UART or I2C pins ? Has anyone ever done this? Thank you.

The problem for example here I can see 3.3V output of the raspberry is used, but this pin can just out a little current.

Edit: Also I try to use Arduino IDE to program the esp8266 from the raspberry, or it is possible to use arduino for only compiling the firmware and then upload the .hex file with esptool for example ? Or will the Arduino IDE recognize the serial port maybe ?

Could something like this work? (The problem is that I have a small level in electronics and so I’m not sure of this scheme that I realized after a few ̶h̶o̶u̶r̶s̶ days reading about this subject) enter image description here

  • About a year ago I tried to use Rpi to flash ESP8266. You might like to read how I did it: ( raspberrypi.org/forums/… ) – tlfong01 20 hours ago   
  • @tlfong01, Thank you I will read this. – Ephemeral 20 hours ago
  • @tlfong01, your answer is based on the NodeMCU module it’s right ? – Ephemeral 20 hours ago
  • I don’t see anything wrong with your wiring. That said, the ESP8266 I had with that kind of breakout (sans a micro USB jack) ended up bricked. >_< Which is when I started splurging an extra $2-3 for the nodeMCU style boards. – goldilocks 20 hours ago
  • @goldilocks, Yes and it must have saved you a lot of time because there is no need to solder each pin as on the 12-F … but I would like to learn the wiring UART, I2C and SPI and I find this more intuitive with the 12F where you have to do it yourself. – Ephemeral 20 hours ago
  • @goldilocks, Do you think I can use directly the 3.3V pin of the RPi for the ESP8266 Vcc ? – Ephemeral 19 hours ago
  • As long as there’s no 5V line going to it there’s no risk. The 3.3V dedicated power pins (not the GPIOs) should be sufficient if the Pi itself has enough power; you can get a clean amp out of it. – goldilocks 19 hours ago
  • @goldilocks, ok thank you, But I do not know why I’m afraid about the current limit provided by the RPi 3.3V output. – Ephemeral 19 hours ago
  • The power pins (again, to emphasize: not simply a GPIO set to “output”) are on the Pi’s 3.3V rail, so you’d be effectively sharing the power between them. This could lead to low voltage, but not necessarily. It is more or less the same thing as powering it via USB, which like I’ve said works. The wifi chip on the ESP can supposedly draw several amps, but I think that would be pretty unusual. – goldilocks 19 hours ago
  • @goldilocks, ok. thank you again for your time. I will try this. thank you. – Ephemeral 19 hours ago
  • 1
    @Ephemeral, well, the term “NodeMCU module” is a bit confusing. Let me see if I still remember why it is confusing. (1) NodeMCU is firmware, which helps you to code LUA, using one of a couple of NodeMCU IDEs you can choose . (2) You can use an “ESP8266 module” to write microPython, using Arduino IDE. In other words, most “ESP8266 modules” can use NodeMCU & IDE to write LUA code, or use Arduino IDE to write micrPython. – tlfong01 19 hours ago   
  • @tlfong01, thank you very much for these clarifications. – Ephemeral 19 hours ago
  • @tlfong01 Although more properly it is the firmware, there are ESP8266 boards that are branded “NodeMCU” (like, literally stamped on them), they have a big breakout (all or most of the most of what’s on the SoC, which is a lot, PWM, analog, etc.) with the micro USB jack. Interestingly, the ones I’ve gotten don’thave the nodeMCU firmware on them, they’ve got the OEM stuff. You have to download it and flash them. – goldilocks 19 hours ago
  • @goldilocks, yes, many ESP8266 boards are marked “NodeMCU“. One reason is to make it look classy and so can sell for a few dollars more. And those paying a few dollars more can mislead others that they know NodeMCU LUA and so get more respect than they deserve. I guess 99% (I am serious) of those buying NodeMCU boards do not use NodeMCU LUA, because the learning curve is extremely steep, and end up using Arduino IDE to write newbie friendly microPython. – tlfong01 18 hours ago    
  • There is another confusion about the “Arduino IDE”, which needs IntelPC/Win7/10 or, Rpi/Raspbian to run. The confusion is that you cannot run Arduino IDE in Arduino hardware.. In other words, Arduino IDE can be used to write C++ code to be run in Arduino hardware. But Arduino IDE can also be used to write microPython (but not LUA) to be run in ESP8266 hardware. To write LUA, you need two things: (1) NodeMCU firmware flashed in ESP8266, (2) IDE (eg, Esplorer for ESP12/32 or ChilliPepper for ESP32) . – tlfong01 6 hours ago   
  • @Ephemeral, your wiring picture includes a flashing step “hold down the .. switch” which confused me a bit, when I met this instruction in first learning how to flash. I vaguely remember that I googled schematics to find out what this means. My conclusion is that this step is only for old USB UART modules. I also wish to point out that many ESP01/02 related hardware/software/procedures are out of date when ESP12x came along. Similarly, many ESP12x skills and knowledge has become useless or even misleading when playing with ESP32 and ChilliPepper. – tlfong01 6 hours ago   
  • And it is not at all necessary to use Arduino IDE to learn microPython. I would recommend the following doc to start: (USB-serial converter, DTR and RTS pins ) .This doc clarifies many things, including the use of DTR and RTS pins in UART. And UART hardware troubleshooting. This reminds me that some very old ESP8266 flash cable even use FTDI (Well, I did use the FTDI when playing with Decimilla, my first Arduino toy. I did spent some 10 hours studying the FTDI theory and operation. And as I said, the old FTDI tricks learnt by the old dog (ie, me) must be unlearned before moving on, .. – tlfong01 5 hours ago    
  • @Ephemeral, for microPython newbies, I would recommend the following ESP32 module: (1) AliExpress LOLIN D32 V1.0.0 Wifi & Bluetooth ESP-WROOM-32 4 MB flash Arduino & MicroPython compatible – US$7 fr.aliexpress.com/item/32808551116.html (2) TaoBao CH340G-ESP32 WiFi + BlueBooth Module – CN¥29 item.taobao.com/… (3) WeMos D32 ESP-32 Wifi and BlueTooth board ESP32-WROOM-32 4MB R1 LiPo max 500mA, Arduino, MicroPython compatible (default firmware microPython) wiki.wemos.cc/products:d32:d32 – tlfong01 3 hours ago   
  • ERRATA – Earlier I mentioned that there is no need for an manual “upload switch”. Actually it is replaced by a “boot” switch which you need to press before uploading. My apologies for any confusion. But I am not very sure if there is a auto switch which automatically switches on when you use the uploader to upload something. – tlfong01 2 hours ago   
  • And in case you ask why I am suggesting to use ESP32 and not ESP826612, here are the references I read: (1) ESP32 vs ESP8266 – Pros and Cons – Sara Santos 2019may01 makeradvisor.com/esp32-vs-esp8266(2) ESP32 Pinout Reference: Which GPIO pins should you use? randomnerdtutorials.com/esp32-pinout-reference-gpios (3) Getting Started with the ESP32 Development Board randomnerdtutorials.com/getting-started-with-esp32 – tlfong01 2 hours ago   
  • Now I remember why the new boards does not need an upload/boot button. The reason is that the USB/UART board uses RTS and DTR signals. Rpi3 does not have these handshake signals. Only Rpi4 has them. This show the auto flash without upload button: penzu.com/p/628ce21f – tlfong01 17 mins ago   
  • But I am not too sure now. I read my old post to refresh my memory. I found that one ESP8266-12 module I tested has USB UART on board (no USB/UART cables need). Also on board is the 5V to 3V3 voltage regulator circuit (no external 3V3 power needed, all from USB 5V) But htere are still two buttons: reset, and flash! (1) raspberrypi.org/forums/… (2) raspberrypi.org/forums/… ) – tlfong01 2 mins ago    Edit   

4

It is possible to flash the ESP8266 12-F with the raspberry UART pins ? Has anyone ever done this?

I’ve used the USB ports for this with esptool.py.

esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py --port /dev/ttyUSB0 write_flash -fm dio 0x00000 nodemcu.bin

I use “nodeMCU” style boards that have a micro USB jack (so using a normal micro USB cable). I also thought hardware flow control, which the Pi UART conventionally lacks, was necessary, but looking around this is not be the case, you just have to hold CH_PD and/or some other line high. So it should be possible.

I’ve found the serial interface on the ESP a bit fussy — as in good ol’ minicom is not reliable with it, the best thing seems to be miniterm.py, which is part of the pyserial package.

  • Thank you for your reply. You use the usb port with additional FTDI for example ? – Ephemeral 21 hours ago
  • Thank you for your editing. – Ephemeral 21 hours ago
  • 1
    No, I use a micro USB cable directly; the nodeMCU ones are big breakouts with a jack on them. I may have used an FTDI cable at some point, I know I’ve had an ESP that required it (no jack on the breakout). – goldilocks 21 hours ago
  • Thank you it’s helpfull for understand. – Ephemeral 21 hours ago
  • Have you an idea of the minimum current for the flash boot mode or uart download mode or SDIO/SPI wifi mode please ? I cannot find this informations , I have read the datasheet. – Ephemeral21 hours ago
  • Pretty sure the ESP pins are all 3.3V, but some breakouts may include shifters. And don’t quote me on that 😉– goldilocks 21 hours ago
  • Thank you for your time and this informations. Yes also think the ESP8266 have 3.3V pinout but , his supply voltage is: Voltage 3.0V ~ 3.6VˈTypical 3.3VˈCurrent >500mA This information makes me think that it is not really tolerant … that’s what bores me actually. – Ephemeral 21 hours ago
  • typical current usage on ESP8266 less than 200mA, not more than 500mA @Ephemeral – Jaromanda X 8 hours ago

Your Answer

community wiki
Post Your Answer

Not the answer you’re looking for? Browse other questions tagged   or ask your own question.

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: