FYI - ESP8266 0.95 firmware requires minor changes to driver under Espurino 1v74 #4518
Replies: 1 comment
-
Posted at 2015-02-17 by @gfwilliams Thanks - that's interesting... When connecting to an AP on earlier versions it returns almost instantly and it's hard to tell when it's connected (hence the polling for IP address). They obviously fixed that in later ones. I'll have to check if just sending Is 0.95 actually an official firmware? I wonder if it's something specific to ai-thinker.com ? EspressIF have pulled it from being Open Source now so I'm not 100% sure what's going on. I know Adafruit seem to ship with 0.94, and I just ordered a bunch of ESP8266 modules for the KickStarter and that's what they ship with too. Posted at 2015-02-19 by magore Yes 0.9.5 (b1) is the latest offical firmware Once I work this out everything should start working and I can post diffs to network_esp8266.c - just in cases others don't want to wait for an offical fix by the Author. This is what I am now getting after the CWJAP command "OK" response - see first post Posted at 2015-02-19 by @gfwilliams
Wow, that's a huge bug! They must have tested that surely as it makes HTTP requests pretty much impossible. Do you think your changes are going to be compatible with 0.94? The reason I ask is I'll be sending out 0.94 ESP8266s with the Pico KickStarter, and I want to be sure that they'll still work without a firmware update! I'm not sure how you're developing, but did you know that you can run Espruino under Linux and can use the Serial ports? It makes it much faster to compile run and debug on the host machine :) Also I don't know what you think but I'm considering modifying the ESP8266 support so that there's C code that handles sending commands and listening for return values, but the actual interaction with the ESP8266 is done in JavaScript (which is more sensible for all the 'do this then that then that' stuff). Main reason is that I've had a few requests for GSM/GPRS (and SMS) support, and while other modules use similar commands, they're not identical. Posted at 2015-02-20 by magore HI Gordon, Posted at 2015-03-16 by net-tobi Hello, I have firmware 0.924 as recommended in the documentation and I have a similar problem. The callback function of the connect function of the driver is never getting called. I checked the response of the ESP8266 by using Serial4.on('data', ...) and I got the AT+CWJAP error as well.
I am using Espruino 1.75. Best, Tobias Posted at 2015-03-16 by @gfwilliams Yes, I'm finding problems too - the boards I got for the KickStarter rewards are @user6134 if you don't mind, please could you contribute your changes? Right this second I'm actually making a JavaScript ESP8266 library which should make it easier to account for all these quirks. Posted at 2015-03-16 by @allObjects ...sounds like: testing Espruino Pico is one thing... having to test (all) the ESP8266 was not part of the plan... held-up by 3rd party firmware flaw that can be sw-'compensated' should not become a held-up, at least it is not a held-up for me... Libraries and mixed greens salad - sorry, meant to say mixed versions - recalls / echoes @boneskull 's thread... Posted at 2015-03-16 by @gfwilliams Yes, so sadly Espruino ships with ESP8266 support as it is right now. Hopefully by the time they're received a software update will fix it though. Posted at 2015-03-16 by @gfwilliams For anyone interested: https://github.com/espruino/EspruinoDocs/blob/master/devices/ESP8266.js This should be a lot easier to hack around with. I haven't pushed the version of Espruino this needs yet, but in terms of network connection/etc it'd work on Espruino as it is now - it's just the link from the HTTP server back to JS that's missing. Again, a port of this to GSM should be trivial, and I'll be trying to do that soon. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-02-16 by magore
I just debugged a problem with ESP8266 v0.95(b1) firmware and the latest Espurino build in file network_esp8266.c:
Sending the command AT+CWJAP="",""
now longer seems to work, so this code now always fails:
libs/network/esp8266/network_esp8266.c: JsVar *cmd = jsvNewFromString("AT+CWJAP="",""\r\n");
I changed this command to AT+CWQAP for now to test
Sending any AT commands with \r\n fails - use \r only when sending to the esp8266
Looks like the esp8266_connect() timeout of 500ms is way way to fast especially when connecting to an AP (should be over 5 seconds, ie 10000)
Adding -dESP8266_DEBUG to the defines section of the Makefile helps watch the progress of the failures
Code I used to test: (note I have an STM32F4 (407) Discovery board)
Serial4.setup(9600, { rx: A1, tx : A0 });
console.log("Connecting to ESP8266");
var wifi = require("ESP8266").connect(Serial4, function() {
console.log("Connecting to WiFi");
wifi.connect("your_ssid_here","your_password", function() {
console.log("Connected");
require("http").get("http://192.168.1.1", function(res) {
console.log("Response: ",res);
res.on('data', function(d) {
console.log("--->"+d);
});
});
});
});
Debug Log so far all timeouts updated to 10000 in libs/network/esp8266/network_esp8266.c
>Serial4.setup(9600, { rx: A1, tx : A0 });
=undefined
>console.log("Connecting to ESP8266");
Connecting to ESP8266
=undefined
>var wifi = require("ESP8266").connect(Serial4, function() {
: console.log("Connecting to WiFi");
: wifi.connect("your_ssid_here","your_password_here", function() {
: console.log("Connected");
: require("http").get("http://192.168.200.1", function(res) {
: console.log("Response: ",res);
: res.on('data', function(d) {
: console.log("--->"+d);
: });
: });
: });
:});
>>> "AT+CWQAP\r"
={ }
ESP8266> "AT+CWQAP"
ESP8266> ""
ESP8266> "OK"
>>> "AT+CWMODE=1\r"
ESP8266> "AT+CWMODE=1"
ESP8266> ""
ESP8266> "OK"
>>> "AT+RST\r"
ESP8266> "AT+RST"
ESP8266> ""
ESP8266> "OK"
ESP8266> "D�I\x11�H\x112�\x00�a�k#��'��"\b\x11\x00���"
ESP8266> ""
ESP8266> "Vendor:www.ai-thinker.com"
ESP8266> ""
ESP8266> "SDK Version:0.9.5(b1)"
ESP8266> "Compiled @:Dec 25 2014, 21:50:58"
ESP8266> "ready"
>>> "AT+CIPMUX=1\r"
ESP8266> "AT+CIPMUX=1"
ESP8266> ""
ESP8266> "OK"
Connecting to WiFi
>>> "AT+CWJAP="your_ssid_here","your_password_here"\r"
ESP8266> "AT+CWJAP="your_ssid_here","your_password_here""
ESP8266> ""
ESP8266> "OK"
>>>> "AT+CIFSR\r"
ESP8266> "AT+CIFSR"
ESP8266> "+CIFSR:STAIP,"192.168.200.232""
ESP8266> "+CIFSR:STAMAC,"18:fe:34:9e:2d:29""
ESP8266> ""
ESP8266> "OK"
Uncaught Error: WiFi network connection failed
You can see the connection works - but the return status is wrong
Beta Was this translation helpful? Give feedback.
All reactions