Latest Espruino build for Esp8266

Posted on
Page
of 8
  • Deep sleep here: https://github.com/espruino/Espruino/blob/master/targets/esp8266/jswrap_esp8266.c#L442

    It's in the current master build. It's not normal Espruino deep sleep though - all state will be lost as it's like a hard reset.

  • @Gordon - safe to assume it requires "reset" to be connected to GPIO16 to work?

  • Yes, I think so - you'd have to ask the people that did it though :)

  • Hi @tve, I am currently exploring scripting languages on my adafruit huzzah feather and the 1v84 you've posted above flashes nicely and a first test with screen worked as expected. It is pretty close to the latest 1v85, which would run on an espruino pico for example. So does this mean there are no major issues to expect?

    For the espruino WebIDE, it seemded to connect but then no keyboard input was possible. I had to use screen. Is this a known error or are there other reasons the web ide does not work with a esp8266?

    Thx!
    Sven

  • @hansamann
    Are you on windows? I found that after a serial flash of a new firmware, you sometimes need to unplug the USB and plug back in again. The on connect form the web console it comes back up.

  • @hansamann - v84? You're using an old version, @tve has a newer one here (page 3 of this thread - direct link to the post in the thread I'm talking about here):

    http://forum.espruino.com/comments/12929332/

    The default baud rate used for the ESP8266 is different from what's used for other boards, if you're connecting via wired serial. I usually connect via wired serial using some other serial client, set up the wifi, and then connect with IDE over the network, though you can change the baud rate the IDE uses.

  • What do we think about just changing the baud rate to 9600?

    So it's slower, but it's not that bad. It seems to be an extremely common problem - made worse by the fact that every other Espruino device uses 9600 baud for compatibility with Bluetooth modules.

  • Just to add: I think most people that complained about it being too slow actually use Telnet now?

    Also, using 9600 means that users could potentially use the headphone jack hack to set up WiFi credentials if they didn't have a USB-TTL connector (it's far fetched I know).

  • The 115200 speed is good for me - especially if you add a few models that need to be uploaded.

    The issue I'm aware of is after a firmware update. There is also the option of connecting the esp8266 to your wifi network, and using wiflash {ip-address}:88 to flash the firmware or adding the ip to the communications part of the web ide to avoid these issues.

  • The 115200 speed is good for me

    Yes, it's fine once you figure it out.

    It's all the people who post here going 'It's not working!' :)

  • ooops, redundant post, deleted...

  • If it always resets to 9600 baud that would definitely be something I would not like at all and that would cause me to make my separate builds. Aside from being totally inconvenient (everything esp8266 is 115200 baud for me) it would totally suck when the device resets and then I can't see what it prints out because it comes out at 9600 baud and not the 115200 that my serial port would be set to.

  • NB: it might help to put a prominent note on the main esp8266 documentation page. It didn't occur to me at the time.

  • I tend to favor 9600, since that's what all the other espruino boards default to. I haven't connected to an esp8266 running espruino over serial except to flash Espruino and set the wifi info.... (which I do with a separate application, because I don't want to change the setting on the IDE and then forget and get all confused when I try to use a Pico again). The telnet console access is awesome, I never realized how much better it would be.

  • That's the problem I guess - it's whether you use Espruino every day, or ESP8266 every day :)

    There's always setBootCode("Serial1.setup(115200)"). I wonder if there is any obvious way to detect a different baud rate - like if at 9600 it gets 0xff as the first received character, or at 115200 it gets a framing error it could swap back to 9600.

  • Does the ide know what board it is connect to? Can this be used for a preferential baud rate - default to 9600 unless the board.py specifies something different?

    I guess it's a catch 22 situation here... Would about using the last board connected setting?

  • Nope, it could maybe read the USB ID, but that's just the type of USB-UART chip, which will be the same for many boards.

    It's up to the board really. I guess it could store the baud rate in the WiFi settings area, so firmware updates wouldn't change it? That might be more sensible.

    using the last board connected setting?

    Well, that's kind of what we have. It remembers the baud rate setting, so if you connected to something last and it worked than you're sorted.

    But that doesn't help new users. The IDE could ask the first time it connects, but honestly I find it hard to see why every single Espruino user (ESP8266 or not) should be inconvenienced because of this.

  • I have downloaded what I think is the latest version, and is currently testing the Wifi-part of it.
    I can load the wifi-module and serve as AP, but when trying to connect as client to my network I just get the response >=Undefined

    Here is an extract of my test

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
    1v85.tve_master_66fde09 Copyright 2016 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:512/512, manuf 0xe0 chip 0x4016
    

    process.memory()
    ={ "free": 1571, "usage": 29, "total": 1600, "history": 13 }
    var wifi = require("Wifi");
    =function () { [native code] }
    wifi.connect("MYSSID", {password:"MYSSIDPWD"}, function(err){console.log("connected? err=", err, "info=", wifi.getIP());});
    =undefined
    wifi.getIP()
    ={
    "ip": "0.0.0.0",
    "netmask": "0.0.0.0",
    "gw": "0.0.0.0",
    "mac": "5c:cf:7f:11:67:28"
    }
    wifi.getStatus()
    ={
    "mode": "sta+ap",
    "station": "connecting",
    "ap": "enabled",
    "phy": "11n",
    "powersave": "ps-poll",
    "savedMode": "off"
    }
    wifi.setDHCPHostname("espruino");
    =undefined
    wifi.startAP("my-ssid")
    =undefined
    wifi.getAPIP()
    ={
    "ip": "192.168.4.1",
    "netmask": "255.255.255.0",
    "gw": "192.168.4.1",
    "mac": "5e:cf:7f:11:67:28"
    }

    The wifi.connect doesn't seem to ever respond

    Anyone tried the ESP8266 as a client ?

  • I had the same problem until I flashed the correct firmware on the ESP8266.
    After that i disconnected and reconnected the ESP and it worked

  • Thx @DrAzzy for the direct link. It would be great if these files would soon be under a link like latest_esp8266.zip :-) I am flashing the build in a moment. It would be amazing to get the espruino web ide and with a wemo esp8266 to work. It would be a $2.5 dev board, perfect for schools and kids. thx for your help!

  • Thx so much @user65089, @DrAzzy and @Gordon. I've changed to baudrate to 115200, something I've done naturally with other apps like Serial Term (Chrome OS). I think it belongs mentioned in red letters in the esp8266 espruino docs somewhere! Now all is fine.

    I'd have one more generic question(s): what is the current state of the build & will it be officially supported in the future, too? Are all the basics working (PINs, PWN, libraries?)...

    I am mainly looking for a dirt cheap dev board for school workshops. That's why I've bought the esp8266 based WeMo boards. With the help of Espruino I can now use the kick-ass Chrome OS based Web IDE for teaching javascript. The espruini Web IDE is really core, I cannot mention it more. The kids at school all have Chrome OS based laptops, they are cheaper and maintenance/admin is not such a hazzle.

    Thx!
    Sven

  • As far as I know:

    • Pins work fine
    • PWM works in software only, and is a bit shaky but fine for LEDs and stuff
    • libraries work fine
    • SPI works fine, I2C could be a bit iffy although that might be fixed now?

    Unless there's a way I can actually make money that pays for the support I give on ESP8266 it won't be 'officially' supported. Having said that everyone's doing a pretty good job of supporting it regardless.

  • @Gordon would you consider a kickstarter? MicroPython just did it and I am sure many here would give a few dollars to support an even better implementation. I'd love see that!

  • He's done Kickstarter successfully already - twice now I think.

  • Yep @Ollie @Gordon I know - I think I also funded both and goth both boards at home. I am just saying that I would be more than willing to fund a 3rd one specifically for advancing the esp8266 (or upcoming esp boards) build.

About

Latest Espruino build for Esp8266

Posted by Avatar for tve @tve

Actions