ESP-12E boards -> Some fundamental questions

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
neuromanc
Posts: 5
Joined: Thu Jan 05, 2017 1:52 pm
Contact:

ESP-12E boards -> Some fundamental questions

Post by neuromanc » Wed Jan 11, 2017 9:28 pm

Hi,

I recently got hands on a ESP-12E based board, seemingly produced by doit.am. I flashed it with MicroPython 1.8.6 on Windows. That seemed to have worked; I can connect to the REPL via COM4 and can run python code on it.

I have some major problems with it, which I cannot seem to solve on my own:

1.
Shouldn't there be a way to copy files to the board via USB file transfer? I've read in the pyboard docs that there can be files transfered to the board with the regular windows explorer (as it were a usb flash drive); Is this not the case with the ESP8266 boards?

2.
On macOS, on connecting the board to my computer, I expected that a ttyUSB* device file would show up under `/dev`. That is not happening; Shouldn't it? I have no idea how to connect to it otherwise.

3.
Is there a way to find out which I/O ports are available? I know there are some PINs connected to the esp8266, but I cannot find documentation on the website of the manufacturer.

The boards full name is `ESP12E Devkit V2`, made by doit.am. It looks like this: https://images-na.ssl-images-amazon.com ... L1200_.jpg

Sorry if this is some basic stuff I'm asking, but I'm really new to this esp8266 and MicroPython in general, and I'm having a hard time getting some useful information and documentation (useful for me) on the board. I've read some of the MicroPython docs on the ESP8266. The PINs mentioned in the docs are the names from the ESP8266 CPU, but I have no idea how to find out which PINs on the board (see image above) are connected to which of the ports of the CPU.

I hope someone finds the time to read this :)

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: ESP-12E boards -> Some fundamental questions

Post by mcauser » Wed Jan 11, 2017 11:09 pm

1. The ESP8266 chip does not have native USB support, unlike the STM32 that powers the pyboards. If the ESP8266 could be mounted as a usb device would be a software only implementation. I haven't come across any. There are tools that can assist you with copying files, webrepl, ampy, adding files to the /scripts or /modules dir before compiling/writing flash.

2. How are you connecting it? The ESP8266 does not have a built in usb-serial chip. You are probably using a CH304G or CP1204? Most likely you do not have the driver installed for the usb-serial chip. Have a look for a little black IC near the USB socket and check its markings.

3. On a bare ESP-12F, some of the pins need to be pulled high/low to boot the device in the desired boot mode. Some of the pins are connected to the SPI flash (bottom row), which generally don't get used unless you are debugging / updating the flash directly.
The WeMos D1 Mini is a popular breakout board for an ESP-12F.
https://www.wemos.cc/product/d1-mini.html
The specs and schematic shows which pins are connected to which breakout, and which have resistors etc.

Your board looks a lot like a generic NodeMCU board.
https://www.seeedstudio.com/NodeMCU-v2- ... -2415.html
Essentially a bigger version of the WeMos D1 Mini, with more pins broken out.
Google image search for "NodeMCU pins" and you should find all you need.
The board design has been copied a number of times from different manufacturers.
There will be colour variations, smt component alignment, branding, etc.
Essentially though, they are all just breadboard friendly ESP8266 breakout boards.

Theres a difference between ESP8266 pins and breakout board pins.
Different board manufacturers may call them different things, but they all map to ESP pins, generally referred to as GPIOn
eg. on the WeMos D1 Mini, the breakout D1 and D2 pins point to ESP8266 GPIO5 and GPIO4. You need to refer to the board documentation/schematics to know which pin maps to which.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: ESP-12E boards -> Some fundamental questions

Post by deshipu » Thu Jan 12, 2017 9:09 am

All NodeMCU boards use the same pin mapping: https://nodemcu.readthedocs.io/en/maste ... ules/gpio/ (the D* is what is written on the board's silkscreen, the GPIO* is what number you use in MicroPython).

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: ESP-12E boards -> Some fundamental questions

Post by Roberthh » Thu Jan 12, 2017 2:37 pm

Obviously your board has a serial to USB chip, since you could talk with it on Windows/COM4. The picture you point at shows a CH304G device. Like @mcauser told, you might have to install a driver for that on Mac O X, and then the name will be some /etc/tty.....
The tool provided by the MicroPython team is webrepl, which allow both a console and file transfer through WiFi. It requires python and a standard web browser, so it's pretty generic. You might have to start it in the REPL prompt with:

Code: Select all

import webrepl
webrepl.start()
These statements are in boot.py, but commented out for the daily build.
But, as mentioned by @mcauser, a few other tools exist, made by happy hackers like you&me.

Kind Regards

User avatar
neuromanc
Posts: 5
Joined: Thu Jan 05, 2017 1:52 pm
Contact:

Re: ESP-12E boards -> Some fundamental questions

Post by neuromanc » Thu Jan 12, 2017 10:11 pm

@mcauser: Thanks for your extensive reply.

@deshipu: That is very good to know, thanks.

I found the description of the chip on my board, it is a CH340G. I found a driver here: http://kig.re/2014/12/31/how-to-use-ard ... emite.html . This one works on macOS Sierra and the device appears as `/dev/tty.wchusbserial1410` on my system. This might be useful for future readers. Connecting to it works with `screen /dev/tty.wchusbserial1410 115200`. Oh, and this is a good schematic I found: https://cdn.instructables.com/F6P/HETC/ ... CT2100.jpg

@Roberthh: That is also good to know, thank you very much. I wondered why the web repl was not accessible after I flashed the controller. I will try that out, too. Although for now I'm happy I can now access the serial console and fiddle around with the breakout pins.

Thanks @all again.

Have a great day :)
Last edited by neuromanc on Fri Jan 13, 2017 3:05 pm, edited 1 time in total.

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: ESP-12E boards -> Some fundamental questions

Post by mcauser » Thu Jan 12, 2017 11:47 pm

It should be `115200`not `11520`
FYI - on my MacBook Pro, the left side USB is /dev/tty.wchusbserial1410 and the right side is /dev/tty.wchusbserial1420.
I downloaded my CH340G driver from here: https://www.wemos.cc/downloads

User avatar
neuromanc
Posts: 5
Joined: Thu Jan 05, 2017 1:52 pm
Contact:

Re: ESP-12E boards -> Some fundamental questions

Post by neuromanc » Fri Jan 13, 2017 3:05 pm

mcauser wrote:It should be `115200`not `11520`
FYI - on my MacBook Pro, the left side USB is /dev/tty.wchusbserial1410 and the right side is /dev/tty.wchusbserial1420.
I downloaded my CH340G driver from here: https://www.wemos.cc/downloads
Yes, that's correct. Thanks, I fixed it in the post above.

Post Reply