A Guide To Using ESP8266 With TEENSY 3

Status
Not open for further replies.
Yes, I did all of the obvious things. I bought these ESP8266 chips from aliexpress.com. I am beginning to wonder if they are bad or something.

When using one of the Teensy programs I get a z or an r on start up depending on the baud rate, but no response from any AT command.
I have some ESP8266-12 boards sold by Adafruit. PCB's silksecreen is Adafruit.
https://www.adafruit.com/search?q=esp8266&b=1

I connected an FTDI USB/Serial 3.3V to the board and after a few minutes of flailing, my dumb terminal program (Bray's term) at 9600 baud was talking to the Lua interpreter. I then tried one of the lightweight IDEs (browser based). Nice. So I had some example code and my own first "hello world" via WiFi working in a few minutes.

I didn't try AT commands. Just dumb terminal talking to Lua at first. Lua is doing that lower layer.

I have yet to re-flash it for using C.
For HLL's I prefer Javascript or Python to Lua. But these aren't flushed out yet for the ESP8266, as I read. These make for a fun/fast rapid app, esp. if one has used the language in the past as I have. Not so, Lua.

As I read, the -12 has 4MB of flash in which they put layer 2.5 of 802.11b/g/n and some sort of thread/task manager and the core API code. The newer (TBA) ESP32 increases the RAM to 400KB.

I've been doing much the same with the Particle.io Photon board. Same SoC concept with fenced-off user code that can be uploaded, and same, an on-chip file system for storing these and libraries for the HLLs for use when they "require xxx" or equivalent.
 
Last edited:
I got the Adafruit ESP8266-12 Huzzah to work too.

4MB of flash in which they put layer 2.5 of 802.11b/g/n and some sort of thread/task manager and the core API code

This is likely the part I am messing up. I have no idea how to "properly" flash the right code onto the ESP8266 chip. That is, I can flash a .bin file I find on some github page, but I doubt it has the proper layers of stuff to make the dang thing work properly. I could use some help here (I am definitely NOT a software guy)...
 
Last edited:
I just tried the lua script and esptool IDE and could not get my board to respond. Don't know what I am doing wrong. Maybe the hardware is faulty.
 
get yourself a Buspirate to communicate to a serial TTL UART. Cheap and very simple configuration of port setting through a simple interactive menu instead of tinkering by building a new image install it run it change compile download etc : save you a great amount of time

http://dangerousprototypes.com/docs/Bus_Pirate
 
Ok, if found the initial baudrate. Its 74880 (<- no typo!). After that it switches to 115200. Thats for the Espressif official firmware.
I'd try that !

If it does not work, i'd try something completely different: Try to flash the firmware to one of your bought boards, to proove that you're doing it correctly.
It makes no sense to test anything more witrh your board when you're not sure that the flashing works.
Then, i remember that there is a config in the ESP which tells it the freq of the Crystal, the speed of the Flash and so on. Did you write that config ?

I'd use this tool for your "virgin" ESP:
Espflash.png
http://bbs.espressif.com/viewtopic.php?f=57&t=433
 
Last edited:
After reset, it prints @74880 Baud:
Code:
 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 816, room 16 
tail 0
chksum 0x8d
load 0x3ffe8000, len 788, room 8 
tail 12
chksum 0xcf
ho 0 tail 12 room 4
load 0x3ffe8314, len 288, room 12 
tail 4
chksum 0xcf
csum 0xcf

2nd boot version : 1.2
  SPI Speed      : 80MHz
  SPI Mode       : QIO
  SPI Flash Size : 16Mbit
jump to run user1

After that, the baudrate changes to 115200, suddenly.
At this stage, it prints "ready" with the new baudrate.

For Runmode:
GPIO0 = HI
GPIO2 = HI
GPIO15 = LO
RST = HI

To RESET:
RST = LO
delay(5);
RST = HI

For other Pullups/Pulldowns (Chip_E and so on) see the OLIMEX-Schematic!

You need to flash the "2nd boot" and "user1" (from the quoted text above), i think.
I i understand it correctly, it should print the text above, even if the external flash is empty !
 
Last edited:
How do you hook up a virgin ESP at hardware level in order to get the above results Frank?
 
I don't have a virgin ESP.
I think this text is from the 1st stage-bootloader which is already in the ESP.
So it should print at minimum the above text til "2nd boot".
The 2nd stage then is in the external flash, which is written with the common flash-utilities.

Onehorse said, he successfully flashed it (=external flash chip), so this means that the 1st stage bootloader must be working.
 
okeee, got you.

than flashing (as suggested before) a version that does work might be the best option for @onehorse and go grom there: make little increments in terms of adding new functionallity step by step.

Sounds like the ESP can be completely standalone IOT board?
 
For the ones that uses https://github.com/esp8266/Arduino
Currently the Arduino IDE board manager item for ESP8266 seems not working in Arduino 1.66 IDE, I had to use the GIT method to install the current release from GITHUB that has some workarounds for 1.66 (sigh,not compatible backward to 1.65).

About Flashing ESP8266,
- I've buy at list 20 modules from ebay from many different vendors, different modules (ESP3,ESP12,ESP7...), some arrived completely blank with flash unformatted. With some module I had to flash chip several times, for some reason it gives only garbages but at the end all worked (by flashing 2 or 3 times, I suspect was a supply problem).
- One thing I've learned is that TX and RX pin seems 5V tolerant, but ONLY RX/TX pins! (accordly datasheet)
- Another lesson, in theory it's possible flash the module by using an USB->Serial adapter supply (3V3) since during flashing the ESP consume <80ma but this not always true, again, with some module, the flashing process was performed correctly but at the end I got only garbage, have to repeat the flashing process with external 3V3 stable supply.
- Some schematics uses direct 3V3 as pullup but since ESP8266 has no internal protection in any pin (apart RST,RX and TX) maybe better use a 10K resistor.
- And last, the ESP8266 seems very sensitive to supply voltage, be sure you using 3V3 and not 3V2 or 3V4!

Have to say that around this chip there's a lot of confusion, there's tons of pages on the net and I've see many wirings where pins ore pullup or not, this probably because some vendor provide internal pullup resistors (or pulldown) on pcb. In some ESP12 module I have I need to provide constantly pull up/down and never leave floating or it just won't work.
Really happy to find this thread, maybe for the first time there's a reference for using this chip!

onehorse
Believe me, I had hard time with this chip, for many days nothing worked so I was sure to fried something until I found that I missed a pullup/pulldown or just the supply was not correct (this most of the times...) but at the end every single module come alive so double check everithing and keep trying!

frank
The baudrate was one of the things drive me mad, in 20 modules I got 74880,115200 and 9600 (randomly), this due of the firmware they put inside. I solved by reflashing all modules so I can expect the same values.
I've noticed that The lower-level bootloader it's inside the ESP but flash has to be correctly formatted and prepared or module it's unresponsive, I had some module where the flash was totally blank! Connecting a terminal give only stream of nonsense at every reset, The amount of nonsense output it's random, may vary a lot and most noticeable at 9600, this is clear sign that flash it's not formatted or unproper flashing.
 
Last edited:
Wellll I have to admit that I have been in the same situation where ut was obvious that an I2C chip had to ad least ACK it's address on the bus but the component seem to be dead in the water: it turn out to be that I numbered the pins the wrong way ....... :mad:
 
Thanks all for the input. I will definitely try the 74880 baud rate. I tried a bunch of them and occasionally I would get one or two weird characters, sometimes a little more weird characters on start up. Maybe the chip was trying to tell me something and I just couldn't read it.

I used the NodeMCU tool to flash lots of thing; an AT bin file, a firmware file I got from the expressif page, etc. I just don't know what I am doing. I also used the expressif ESP Flash Tool but after successful flashing I could get no response. What's a config file? In this case, I need a step-by-step tutorial and I haven't found one that I can understand and execute.

I am sure the enable is pulled high, GPIO15 low, GPIO0 and 2 high all by 10 k or 4K7 resistors, the voltage regulator I use to independently power the chip puts out 3V3 at 500 mA if required and I pull GPIO0 low to flash. NodeMCU claims the flash process is successful, the tx light on the board and the tx/rx lights on the ftdi-to-serial flash and blink during chip flashing, etc. Everything looks like it should work but nothing does.

I am ready to give up on this chip but I am willing to try one more set of experiments (change the baud rate) and I have a proposal:

Anyone who wants a free ESP8266 Teensy add-on board from me may have one for the asking if you will figure out how to program it, get it working, and teach me how to do it. PM me if interested.
 
Last edited:
With "config-file", i meant the additional configuration you have to do in the that expressif ESP Flash Tool. Flash-size & speed, crystal..
 
Well, if the flashing is successful, it should work !
Don't try the "nodemcu" for testing, use the AT-version from espressif!!
 
Thanks Frank,

I thought you might take me up on it. I might send you two just to be sure.

Your PM space is full!

Kris
 
oops.. ok, i just deleted some msgs..
I really think that your board is ok. You said you flashed it, at the tool said it was successful.
So, the "only" problem must be something with the files or addresses.. i'm sure that we find that problem !
 
Kris did you scan the links I posted? A tutorial, notes on config and a different flash tool are topics I saw.

I just mailed stuff to Frank today. 3 weeks maybe before he sees it.
 
Status
Not open for further replies.
Back
Top