Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast
Results 51 to 75 of 117

Thread: A Guide To Using ESP8266 With TEENSY 3

  1. #51
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    Quote Originally Posted by onehorse View Post
    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 by stevech; 11-08-2015 at 02:38 AM.

  2. #52
    Senior Member onehorse's Avatar
    Join Date
    Apr 2014
    Location
    Danville, California
    Posts
    920
    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 by onehorse; 11-08-2015 at 04:09 AM.

  3. #53
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,375
    Quote Originally Posted by onehorse View Post
    I could use some help here ( I'm NOT a software guy)...
    Took me a couple readings to understand you weren't dismissing and insulting the people who might help you and I put in the ... I'm ... to read it ;-)

  4. #54
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,375
    Not sure if there are links here to a tool/binary/process you haven't tried that might work better:

    http://randomnerdtutorials.com/category/esp8266/page/2/

    Once you get something that works you'll be able to trust the hardware.

  5. #55
    Senior Member onehorse's Avatar
    Join Date
    Apr 2014
    Location
    Danville, California
    Posts
    920
    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.

  6. #56
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,375
    My link gave a different one if you made it to the bottom of that page there were three links I saw a worthy of a look.

    This one http://randomnerdtutorials.com/flash...using-windows/

    worked with this tool: NodeMCU Flasher for Windows ( forget if you use Windows ) and got LUA running that way, also an intro link and a Server running link

  7. #57
    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

  8. #58
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    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:
    Click image for larger version. 

Name:	Espflash.png 
Views:	121 
Size:	18.6 KB 
ID:	5463
    http://bbs.espressif.com/viewtopic.php?f=57&t=433
    Last edited by Frank B; 11-08-2015 at 09:33 AM.

  9. #59
    @onehorse Have you read http://www.instructables.com/id/Gett...e-connections/ ? Seems like they have to ground a few unexpected pins in order to get it running and some more odd or unexpected things

  10. #60
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    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 by Frank B; 11-08-2015 at 02:18 PM.

  11. #61
    How do you hook up a virgin ESP at hardware level in order to get the above results Frank?

  12. #62
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    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.

  13. #63
    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?

  14. #64
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    Sure.
    There are some projects. Try google:-)

  15. #65
    Senior Member sumotoy's Avatar
    Join Date
    Nov 2012
    Location
    Venezia, Italia
    Posts
    421
    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 by sumotoy; 11-08-2015 at 04:13 PM.

  16. #66
    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 .......

  17. #67
    Making your own C programs for the ESP8266 : https://youtu.be/pWo-ErpVZC4

    making an image and download from scratch : getting all the utilities etc etc etc

    @Frank : excelent suggestion to Use Google

  18. #68
    Senior Member onehorse's Avatar
    Join Date
    Apr 2014
    Location
    Danville, California
    Posts
    920
    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 by onehorse; 11-10-2015 at 08:45 PM.

  19. #69
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    With "config-file", i meant the additional configuration you have to do in the that expressif ESP Flash Tool. Flash-size & speed, crystal..

  20. #70
    Senior Member onehorse's Avatar
    Join Date
    Apr 2014
    Location
    Danville, California
    Posts
    920
    Yes, I did this. All seemed to work; maybe the baud rate will "fix" it!

  21. #71
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    Well, if the flashing is successful, it should work !
    Don't try the "nodemcu" for testing, use the AT-version from espressif!!

  22. #72
    Senior Member onehorse's Avatar
    Join Date
    Apr 2014
    Location
    Danville, California
    Posts
    920
    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

  23. #73
    Senior Member onehorse's Avatar
    Join Date
    Apr 2014
    Location
    Danville, California
    Posts
    920
    use the AT-version from espressif!!
    I thought I did; no response.

  24. #74
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,438
    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 !

  25. #75
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,375
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •