• Hello, I have purchased an official EspruinoWiFi and the book and both are wonderful. :)

    However, being that the hardware is opensource, and that I am apparently a glutton for punishment, I decided to try my hand at making my own EspruinoWiFi from scratch.

    I had PCBs made by OSH Park and, after one failed attempt at assembly, had a solder paste stencil made by OSH stencil.

    The board actually appears to work with the WebIDE and I am ready to test the WiFi.

    However, the ESP modules, purchased through Digikey, who get them from Adafruit, come with NodeMCU flashed onto them. Obviously not what is required for Espruino.

    I see that the official board that I purchased comes with AT version:0.40.0.0 so I thought it would be good to flash the module with that version.

    I tried following the instructions shown here after altering the code as such:

    digitalWrite(A14,0); // power off
    digitalWrite(A13,0); // boot mode
    digitalWrite(A14,1); // power on
    Serial2.setup(115200, { rx: A3, tx : A2 });
    Serial2.on('data', function(d) { USB.write(d); });
    USB.on('data', function(d) { Serial2.write(d); });
    Serial1.setConsole();
    

    The LED on the ESP module blinked once which I understand means that it has entered bootloader mode.

    After that, I clicked on the disconnect button on the IDE and then tried communicating with the ESP-12 via the Espruino but no joy.

    I just keep getting

    A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header

    I know that I can either try soldering wires directly to the RX/TX pins on the ESP module and try that or just simply flash the ESP before soldering it onto the Espruino but it would be really awesome to get it to work through the Espruino itself.

    Thanks in advance for any suggestions.

  • Sounds like an interesting project :)

    So you also tweaked those values in the bootloader itself? What you're doing with the code there seems fine.

    I guess you could try setting A15 to 1 or 0? That's the 'clear to send' wire. Usually I leave it alone (I'd intended to enable it in a firmware update), but maybe the bootloader pays attention to it.

    Failing that you could try flashing the red & green LEDs in JS code when data is sent/received over USB to see if anything is happening... Maybe you could try the same code on one of the official boards? Not to rewrite the firmware, but maybe just to read it out as a test?

    I guess it's possible there's a short on your board.

  • Hello Gordon, thank you for your reply.

    My apologies, but I think my previous post was not entirely clear and complete based on a couple of things in your reply. (I have not modified the boot loader and A15 should already be tied low per your design)

    The board I am attempting to build is essentially an exact copy of the official EspruinoWiFi built from the Eagle files you have made available and running the latest version of Espruino software updated via the IDE.

    Now, onto my issues attempting to flash the ESP-12 module through the EspruinoWiFi board.

    I had read the following instructions and forum post in an attempt to see if it would work on the EspruinoWiFi board:

    http://www.espruino.com/ESP8266#use-espr­uino

    and

    http://forum.espruino.com/conversations/­308773/#comment13792058

    In the linked forum post, the user soldered wires to RX/TX on the onboard ESP module and I would prefer to avoid that if possible.

    I am actually running the code shown in my previous post on the officially purchased board as a “proof of concept”. Board is connected to the IDE, code shown is pasted into the left side of the IDE and certainly seems to execute as written, disconnect button on IDE is pressed, and then I issue the following command on my PC:

    esptool.py -p COM7 -b 115200 flash_id

    My thinking is that if the non-destructive flash_id command works, then the write_flash command should also work.

    I hope am making some sense.

    Thanks again.

    Dale

    p.s. I finally managed to get the AT firmware flashed onto my leadless, unmounted ESP-12S module so none of the above is any way a show stopper.

  • So you're saying that using those instructions, you can't even get the flash ID on an official Espruino WiFi?

  • Exactly. :)

    I am pretty confident that the ESP is going into boot mode, though.

    I tweaked the code slightly setting the Serial2 baud rate to 74880 and now when I run it I see this in the console window:

    digitalWrite(A14,0); // power off
    =undefined
    digitalWrite(A13,0); // boot mode
    =undefined
    =undefined
    Serial2.setup(74880, { rx: A3, tx : A2 });
    =undefined
    Serial2.on('data', function(d) { USB.write(d); });
    =undefined
    =undefined
    Serial1.setConsole();
    ets Jan 8 2013,rst cause:1, boot mode:(1,0)
    Disconnected

  • Strange, I just noticed that the first time I tried this it said

    boot mode:(1,7)

    now I can only seem to get

    boot mode:(1,0)

    not sure if what that means or if it is relevant

  • Using a logic probe, I have verified that I see activity on RX/TX of the ESP when I am running a "normal" WiFi application but no apparent activity on those pins when trying to communicate with the ESP via the STM32 with the ESP in bootloader mode.

  • Once you've uploaded the code to the Espruino WiFi, is it responsive at all?

    Hopefully when the console is moved over to Serial1 any characters you type in the ide will then go right to the wifi - and you could see those with your probe?

  • Well that is interesting.

    I executed the code as before but this time, before clicking the disconnect button, I pressed the enter key in the console window and saw it respond with

    -> Serial1

    I was then able to run esptool and saw:

    C:\Work\Development\ESP8266\esptool-1.3>­esptool.py -p COM5 -b 115200 flash_id
    esptool.py v1.3
    Connecting...
    Manufacturer: e0
    Device: 4016

    Terrific, it works!!!!

    So what foolish mistake did I make? ;-)

  • Oh, crap. Maybe the missing new-line at the end of the last line of pasted code?

  • Yup, that was it. :(

    So now flash_id is working but read_flash is not...

    C:\Work\Development\ESP8266\esptool-1.3>­esptool.py -p COM5 -b 115200 read_flash 0 1024 test.bin
    esptool.py v1.3
    Connecting...
    Running Cesanta flasher stub...

    A fatal error occurred: Invalid head of packet ('\x13')

    I have changed the sizes in the script to the following as directed, but it appears that this is for writing the flash, not reading:

    # Maximum block sized for RAM and Flash writes, respectively.
    ESP_RAM_BLOCK   = 0x80
    ESP_FLASH_BLOCK = 0x80
    

    I really don't want to try write flash on this board since I don't want to screw up the only good one that I have. :)

    I'll get the ESP module soldered onto my "clone" and see where that leads me.

    Thanks again for your help.

  • Still fighting with this.

    I tried the following code in an attempt to communicate directly with the onboard ESP-12 module but it just resets in it continuously resetting and spewing out the boot up messages.

    Serial2.setup(115200, { rx: A3, tx : A2 });
    Serial2.on('data', function(d) { USB.write(d); });
    USB.on('data', function(d) { Serial2.write(d); });
    Serial1.setConsole();
    

    What am I missing?

  • Well now I am starting to think that my official/known-to-work board is no longer working.

    I just re-tried the following code that I had used earlier to determine the esp8266 firmware version on my EspruinoWiFi:

    var serial = Serial2;
    var pins = { rx: A3, tx : A2 };
    function test(baud) {
      serial.removeAllListeners();
      var l="";
      serial.on('data', function(d) {l+=d;});
      serial.setup(baud, pins);
      serial.write("AT+GMR\r\n");
      setTimeout(function(){console.log(JSON.s­tringify(l));},800);
    }
    //digitalWrite(B9,1); // enable on Pico Shim V2
    digitalWrite(A14,1); // enable on EspruinoWiFi
    setTimeout(function() { test(9600); }, 2000);
    setTimeout(function() { test(115200); }, 3000);
    setTimeout(function() { test(57600); }, 4000);
    setTimeout(function() { console.log("Done!"); }, 5000);
    

    It used to return the response to AT+GMR as expected but now is just appears to be returning the output of the AT+RST command?????!!!!!

    As well, the blue LED on the EspruinoWiFi and the ESP-12 module are continuously blinking on and off after issuing the code as well until the board is unplugged and plugged back in.

    "" "\r\n ets Jan 8 2013,rst cause:1, boot mode:(3,7)\r\n\r\nload
    0x40100000, len 1396, room 16 \r\ntail 4\r\nchksum 0x89\r\nload
    0x3ffe8000, len 776, room 4 \r\ntail 4\r\nchksum 0xe8\r\nload
    0x3ffe8308, len 540, room 4 \r\ntail 8\r\nchksum 0xc0\r\ncsum
    0xc0\r\n\r\n2nd boot version : 1.4(b1)\r\n SPI Speed : 40MHz\r\n
    SPI Mode : DIO\r\n SPI Flash Size & Map:
    8Mbit(512KB+512KB)\r\njump to run user1 @ 1000\r\n\r\n" "" Done!

    I am at a loss, but at least I can still blink LEDs. :)

    Update

    It's looking like this EspruinoWiFi is definitely broken. The two test programs (1. get esp8266 firmware version and 2. Get hello.txt webpage) that I have tried from the documentation pages have failed.

    I soldered a flashed ESP-12 module onto the clone EspruinoWiFi that I build and I was pleased to see that the same two samples work on it! :)

    I am guessing that I may have corrupted the esp8266 firmware on the EspruinoWiFi board that I purchased.

    I am going to remove the WiFi module from the board and put it into my programming jig in the morning if unless there are other suggestions on things to try first before then.

    This stuff makes desoldering multi-leaded components a breeze. :D

    http://www.chipquik.com/store/product_in­fo.php?products_id=210001

  • I am guessing that I may have corrupted the esp8266 firmware on the EspruinoWiFi board that I purchased.

    Looks like that could be the case... If you did this code:

    digitalWrite(A14,0); // power off
    digitalWrite(A13,0); // boot mode
    digitalWrite(A14,1); // power on
    Serial2.setup(115200, { rx: A3, tx : A2 });
    Serial2.on('data', function(d) { USB.write(d); });
    USB.on('data', function(d) { Serial2.write(d); });
    Serial1.setConsole();
    

    I'd have thought you might be able to reflash it.

    But if you do decide to reflash it externally, try and give it a try without resoldering. You can issue JS commands to boot the ESP8266 into bootloader mode, and can set the RX and TX lines to be open circuit with (digitalRead(A2) and A3).

    The holes in the ESP8266 are small enough that you can actually just push dupont male pins (the standard jumper leads that you get with everything now) right into the holes and they'll stay there enough - all you need to connect is RX and TX (ground should already be handled by USB)

  • Looks like that could be the case... If you did this code: ...
    I'd have thought you might be able to reflash it.

    Well, I'd hoped it would be possible. So am I to conclude that it isn't? I don't want to spend any more of your time or mine on this if it isn't. Time, maybe, to back way up and use it as intended. New to JS so I have lots to learn. :)

    But if you do decide to reflash it externally, try and give it a try without resoldering. You can >issue JS commands to boot the ESP8266 into bootloader mode, and can set the RX and TX lines >to be open circuit with (digitalRead(A2) and A3).

    I will give that a try first. Likely easier than removing the ESP8266 since that would likely be tougher than I first thought without removing the 2.54mm breadboard headers first.

    The holes in the ESP8266 are small enough that you can actually just push dupont male pins
    (the standard jumper leads that you get with everything now) right into the holes and they'll
    stay there enough - all you need to connect is RX and TX (ground should already be handled by
    USB)

    I see the holes but the board I received from Adafruit have the RX/TX ones filled with solder. A bit of flux and desolder wick should do the trick, though. (Not relevant, but interesting, the ESP-12S modules that Adafruit is selling don't even have holes, just the castellations.)

    Thanks again for your help.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Introduction and AAARRRRRRRGGGGGG!!!! Trying to get ESP-12 for EspruinoWiFi Flashed with Correct Firmware.

Posted by Avatar for daw @daw

Actions