ESP12 - something very wrong

Posted on
  • Something very wrong here or there are two ESPRUINOS...

    So I flashed a 4MB ESP12 - no problem pops up and says V1.91

    So firstly - the terminal keeps throwing back "undefined" when entering perfectly valid Javascript like "var a=1;" for no reason - how do you turn that off.

    Secondly - the manual refers to the default speed being 9600. Well, either I'm going blind or mine is defaulting to 115k.

    Thirdly the first examples you see relate to LED1 - but mine knows nothing about LED1. I can use "0" and get a flashing light working but if I use LED1 - I get errors

    Secondly, above error message repeat several times.

    Ideas anyone?

  • Please read this first.

  • Hi Spocki - I've read that - not sure of the relevance of it to the issues I've mentioned above.

  • Also - this - in the docs - is unrecognised.

    ESP8266.getFreeFlash()

    Mentioned here.. espruino.com/EspruinoESP8266­

  • So firstly - the terminal keeps throwing back "undefined" when entering perfectly valid Javascript

    Are you certain? The code you specified should echo 1 on the console.

    the manual refers to the default speed being 9600. Well, either I'm going blind or mine is defaulting to 115k.

    115200 baud rate. Probably info refers to AT commands to ESP8266-12*.

    Thirdly the first examples you see relate to LED1 - but mine knows nothing about LED1.

    No onboard LEDs that you are intended to control on ESP8266-12*. You can control the Wifi light. Pin varies from board to board. D2 from memory on the NodeMCU, which uses ESP8266-12E

    Also - this - in the docs - is unrecognised. ESP8266.getFreeFlash()

    You need to require the module.

    var esp = require("ESP8266");
    esp.getFreeFlash(); // returns the info you wanted
    
  • Mon 2017.04.10

    @user75617

    Hi Spocki - I've read that - not sure of the relevance of it to the issues I've mentioned above.

    and

    So firstly - the terminal keeps throwing back "undefined"

    After a quick review, I'm with @Spocki and @Ollie that everything is as it should be.

    Ollie has pointed out the coding omission.

    Spocki may have been referring to espruino.com/FAQ for the explanation of 'undefined' See heading: "When I type a command, why does Espruino print '=undefined'?"

    9600 is the default when connecting over USB-TTL prior to flashing
    espruino.com/Troubleshooting­

    115200 is the rate after initial flashing
    espruino.com/ESP8266_Flashing­

    The WebIDE also has this statement under heading 'Baud Rate' within the settings option.
    WebIDE >> Settings >> Communications >> Baud Rate

    Also - this - in the docs - is unrecognised. ESP8266.getFreeFlash()

    Beneath Heading "ESP8266 Library" espruino.com/Reference#softw­are getFreeFlash()
    As Ollie points out, the missing inclusion.

    At times I thought there were mysterious errors creeping in. I discovered that taking a bit of extra time to comprehend the reading material was all that it took. The above links should be re-visited.

  • HI there

    Thanks to all for the feedback - I'm sure someone will see that it is entirely possible to get this wrong as a first time user.
    About the only thing driving me nuts now that I understand, is this "undefined" thing... Shame you can't turn that off - it happens after many lines entered manually - though everything appears to work.

    I noted that despite using a 4MB ESP12, there's only, what, 12K to store programs? That's what I read in the docs - is there a way around that now ? Seems to me there is around 3MB spare (now I have that getFreeFlash() working - thanks Ollie.

    This looks like it might be fun.

  • Check out the Flash EEPROM module here espruino.com/FlashEEPROM

  • Hi Ollie - that looks good - but before I investigate further - should I expect this to work on an ESP12? It says something about STM32?

  • It works.

  • I've been playing with the IDE and it does seem to have issues talking to a board from power up - if I go to my serial terminal, reboot the ESP8266 and talk to the Espruino THEN switch to the IDE all is well, but if I reboot the board in the IDE - I get nothing... any ideas?

  • Thanks Ollie. Your help with someone very new to this particular setup is much appreciated.

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

ESP12 - something very wrong

Posted by Avatar for Scargill @Scargill

Actions